aboutsummaryrefslogtreecommitdiffstats
path: root/tools/lib/bpf/libbpf_internal.h
diff options
context:
space:
mode:
Diffstat (limited to 'tools/lib/bpf/libbpf_internal.h')
-rw-r--r--tools/lib/bpf/libbpf_internal.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/tools/lib/bpf/libbpf_internal.h b/tools/lib/bpf/libbpf_internal.h
index 789e435b5900..f3025b4d90e1 100644
--- a/tools/lib/bpf/libbpf_internal.h
+++ b/tools/lib/bpf/libbpf_internal.h
@@ -21,6 +21,19 @@
21#define BTF_PARAM_ENC(name, type) (name), (type) 21#define BTF_PARAM_ENC(name, type) (name), (type)
22#define BTF_VAR_SECINFO_ENC(type, offset, size) (type), (offset), (size) 22#define BTF_VAR_SECINFO_ENC(type, offset, size) (type), (offset), (size)
23 23
24extern void libbpf_print(enum libbpf_print_level level,
25 const char *format, ...)
26 __attribute__((format(printf, 2, 3)));
27
28#define __pr(level, fmt, ...) \
29do { \
30 libbpf_print(level, "libbpf: " fmt, ##__VA_ARGS__); \
31} while (0)
32
33#define pr_warning(fmt, ...) __pr(LIBBPF_WARN, fmt, ##__VA_ARGS__)
34#define pr_info(fmt, ...) __pr(LIBBPF_INFO, fmt, ##__VA_ARGS__)
35#define pr_debug(fmt, ...) __pr(LIBBPF_DEBUG, fmt, ##__VA_ARGS__)
36
24int libbpf__probe_raw_btf(const char *raw_types, size_t types_len, 37int libbpf__probe_raw_btf(const char *raw_types, size_t types_len,
25 const char *str_sec, size_t str_len); 38 const char *str_sec, size_t str_len);
26 39