Jiri Olsa | a1556f8 | 2019-07-21 13:24:14 +0200 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0 */ |
| 2 | #ifndef __LIBPERF_INTERNAL_H |
| 3 | #define __LIBPERF_INTERNAL_H |
| 4 | |
Jiri Olsa | dcc6854 | 2019-10-17 12:59:18 +0200 | [diff] [blame] | 5 | #include <perf/core.h> |
| 6 | |
Jiri Olsa | a1556f8 | 2019-07-21 13:24:14 +0200 | [diff] [blame] | 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 | |
Jiri Olsa | dcc6854 | 2019-10-17 12:59:18 +0200 | [diff] [blame] | 16 | #define pr_err(fmt, ...) __pr(LIBPERF_ERR, fmt, ##__VA_ARGS__) |
Jiri Olsa | a1556f8 | 2019-07-21 13:24:14 +0200 | [diff] [blame] | 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__) |
Jiri Olsa | 7c4d418 | 2019-10-07 14:53:18 +0200 | [diff] [blame] | 20 | #define pr_debug2(fmt, ...) __pr(LIBPERF_DEBUG2, fmt, ##__VA_ARGS__) |
| 21 | #define pr_debug3(fmt, ...) __pr(LIBPERF_DEBUG3, fmt, ##__VA_ARGS__) |
Jiri Olsa | a1556f8 | 2019-07-21 13:24:14 +0200 | [diff] [blame] | 22 | |
| 23 | #endif /* __LIBPERF_INTERNAL_H */ |