]> Git Repo - linux.git/blob - tools/lib/bpf/libbpf_util.h
scsi: sd: Inline sd_probe_part2()
[linux.git] / tools / lib / bpf / libbpf_util.h
1 /* SPDX-License-Identifier: (LGPL-2.1 OR BSD-2-Clause) */
2 /* Copyright (c) 2019 Facebook */
3
4 #ifndef __LIBBPF_LIBBPF_UTIL_H
5 #define __LIBBPF_LIBBPF_UTIL_H
6
7 #include <stdbool.h>
8
9 #ifdef __cplusplus
10 extern "C" {
11 #endif
12
13 extern void libbpf_print(enum libbpf_print_level level,
14                          const char *format, ...)
15         __attribute__((format(printf, 2, 3)));
16
17 #define __pr(level, fmt, ...)   \
18 do {                            \
19         libbpf_print(level, "libbpf: " fmt, ##__VA_ARGS__);     \
20 } while (0)
21
22 #define pr_warning(fmt, ...)    __pr(LIBBPF_WARN, fmt, ##__VA_ARGS__)
23 #define pr_info(fmt, ...)       __pr(LIBBPF_INFO, fmt, ##__VA_ARGS__)
24 #define pr_debug(fmt, ...)      __pr(LIBBPF_DEBUG, fmt, ##__VA_ARGS__)
25
26 #ifdef __cplusplus
27 } /* extern "C" */
28 #endif
29
30 #endif
This page took 0.033892 seconds and 4 git commands to generate.