Frederic Weisbecker | cd84c2a | 2009-08-12 10:03:49 +0200 | [diff] [blame] | 1 | /* For debugging general purposes */ |
John Kacur | 8b40f52 | 2009-09-24 18:02:18 +0200 | [diff] [blame] | 2 | #ifndef __PERF_DEBUG_H |
| 3 | #define __PERF_DEBUG_H |
Frederic Weisbecker | cd84c2a | 2009-08-12 10:03:49 +0200 | [diff] [blame] | 4 | |
Ian Munsie | c055564 | 2010-04-13 18:37:33 +1000 | [diff] [blame] | 5 | #include <stdbool.h> |
Arnaldo Carvalho de Melo | 8f41146 | 2009-11-16 16:32:42 -0200 | [diff] [blame] | 6 | #include "event.h" |
Namhyung Kim | 0985a94 | 2012-08-16 17:14:54 +0900 | [diff] [blame] | 7 | #include "../ui/helpline.h" |
Namhyung Kim | 7529142 | 2012-11-15 01:47:40 +0900 | [diff] [blame] | 8 | #include "../ui/progress.h" |
| 9 | #include "../ui/util.h" |
Arnaldo Carvalho de Melo | 8f41146 | 2009-11-16 16:32:42 -0200 | [diff] [blame] | 10 | |
Frederic Weisbecker | cd84c2a | 2009-08-12 10:03:49 +0200 | [diff] [blame] | 11 | extern int verbose; |
Arnaldo Carvalho de Melo | b44308f | 2010-10-26 15:20:09 -0200 | [diff] [blame] | 12 | extern bool quiet, dump_trace; |
Frederic Weisbecker | cd84c2a | 2009-08-12 10:03:49 +0200 | [diff] [blame] | 13 | |
Jiri Olsa | 84f5d36 | 2014-07-14 23:46:48 +0200 | [diff] [blame^] | 14 | #ifndef pr_fmt |
| 15 | #define pr_fmt(fmt) fmt |
| 16 | #endif |
| 17 | |
| 18 | #define pr_err(fmt, ...) \ |
| 19 | eprintf(0, pr_fmt(fmt), ##__VA_ARGS__) |
| 20 | #define pr_warning(fmt, ...) \ |
| 21 | eprintf(0, pr_fmt(fmt), ##__VA_ARGS__) |
| 22 | #define pr_info(fmt, ...) \ |
| 23 | eprintf(0, pr_fmt(fmt), ##__VA_ARGS__) |
| 24 | #define pr_debug(fmt, ...) \ |
| 25 | eprintf(1, pr_fmt(fmt), ##__VA_ARGS__) |
| 26 | #define pr_debugN(n, fmt, ...) \ |
| 27 | eprintf(n, pr_fmt(fmt), ##__VA_ARGS__) |
| 28 | #define pr_debug2(fmt, ...) pr_debugN(2, pr_fmt(fmt), ##__VA_ARGS__) |
| 29 | #define pr_debug3(fmt, ...) pr_debugN(3, pr_fmt(fmt), ##__VA_ARGS__) |
| 30 | #define pr_debug4(fmt, ...) pr_debugN(4, pr_fmt(fmt), ##__VA_ARGS__) |
| 31 | |
Frederic Weisbecker | 2cec19d | 2009-08-16 19:24:21 +0200 | [diff] [blame] | 32 | int dump_printf(const char *fmt, ...) __attribute__((format(printf, 1, 2))); |
Arnaldo Carvalho de Melo | 8115d60 | 2011-01-29 14:01:45 -0200 | [diff] [blame] | 33 | void trace_event(union perf_event *event); |
Arnaldo Carvalho de Melo | 567e547 | 2010-03-12 21:05:10 -0300 | [diff] [blame] | 34 | |
Namhyung Kim | f9f526e | 2012-09-28 18:32:03 +0900 | [diff] [blame] | 35 | int ui__error(const char *format, ...) __attribute__((format(printf, 1, 2))); |
Arnaldo Carvalho de Melo | 4610e41 | 2011-10-26 12:04:37 -0200 | [diff] [blame] | 36 | int ui__warning(const char *format, ...) __attribute__((format(printf, 1, 2))); |
Arnaldo Carvalho de Melo | 068ffaa | 2010-11-27 02:41:01 -0200 | [diff] [blame] | 37 | |
Jiri Olsa | f772abc | 2013-12-03 14:09:25 +0100 | [diff] [blame] | 38 | void pr_stat(const char *fmt, ...); |
| 39 | |
Jiri Olsa | 84f5d36 | 2014-07-14 23:46:48 +0200 | [diff] [blame^] | 40 | int eprintf(int level, const char *fmt, ...) __attribute__((format(printf, 2, 3))); |
| 41 | |
John Kacur | 8b40f52 | 2009-09-24 18:02:18 +0200 | [diff] [blame] | 42 | #endif /* __PERF_DEBUG_H */ |