xref: /linux/tools/lib/perf/internal.h (revision 8ca4fc323d2e4ab9dabbdd57633af40b0c7e6af9)
1 /* SPDX-License-Identifier: GPL-2.0 */
2 #ifndef __LIBPERF_INTERNAL_H
3 #define __LIBPERF_INTERNAL_H
4 
5 #include <perf/core.h>
6 
7 void libperf_print(enum libperf_print_level level,
8 		   const char *format, ...)
9 	__attribute__((format(printf, 2, 3)));
10 
11 #define __pr(level, fmt, ...)   \
12 do {                            \
13 	libperf_print(level, "libperf: " fmt, ##__VA_ARGS__);     \
14 } while (0)
15 
16 #define pr_err(fmt, ...)        __pr(LIBPERF_ERR, fmt, ##__VA_ARGS__)
17 #define pr_warning(fmt, ...)    __pr(LIBPERF_WARN, fmt, ##__VA_ARGS__)
18 #define pr_info(fmt, ...)       __pr(LIBPERF_INFO, fmt, ##__VA_ARGS__)
19 #define pr_debug(fmt, ...)      __pr(LIBPERF_DEBUG, fmt, ##__VA_ARGS__)
20 #define pr_debug2(fmt, ...)     __pr(LIBPERF_DEBUG2, fmt, ##__VA_ARGS__)
21 #define pr_debug3(fmt, ...)     __pr(LIBPERF_DEBUG3, fmt, ##__VA_ARGS__)
22 
23 #endif /* __LIBPERF_INTERNAL_H */
24