blob: 2c27e158de6b1fcd8ab0a93a4f4359a395c0d52a [file] [log] [blame]
Jiri Olsaa1556f82019-07-21 13:24:14 +02001/* SPDX-License-Identifier: GPL-2.0 */
2#ifndef __LIBPERF_INTERNAL_H
3#define __LIBPERF_INTERNAL_H
4
Jiri Olsadcc68542019-10-17 12:59:18 +02005#include <perf/core.h>
6
Jiri Olsaa1556f82019-07-21 13:24:14 +02007void libperf_print(enum libperf_print_level level,
8 const char *format, ...)
9 __attribute__((format(printf, 2, 3)));
10
11#define __pr(level, fmt, ...) \
12do { \
13 libperf_print(level, "libperf: " fmt, ##__VA_ARGS__); \
14} while (0)
15
Jiri Olsadcc68542019-10-17 12:59:18 +020016#define pr_err(fmt, ...) __pr(LIBPERF_ERR, fmt, ##__VA_ARGS__)
Jiri Olsaa1556f82019-07-21 13:24:14 +020017#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 Olsa7c4d4182019-10-07 14:53:18 +020020#define pr_debug2(fmt, ...) __pr(LIBPERF_DEBUG2, fmt, ##__VA_ARGS__)
21#define pr_debug3(fmt, ...) __pr(LIBPERF_DEBUG3, fmt, ##__VA_ARGS__)
Jiri Olsaa1556f82019-07-21 13:24:14 +020022
23#endif /* __LIBPERF_INTERNAL_H */