perf symbols: Fix a memory leak in vmlinux_path__init()
[deliverable/linux.git] / tools / perf / util / debug.h
1 /* For debugging general purposes */
2 #ifndef __PERF_DEBUG_H
3 #define __PERF_DEBUG_H
4
5 #include <stdbool.h>
6 #include "event.h"
7 #include "../ui/helpline.h"
8 #include "../ui/progress.h"
9 #include "../ui/util.h"
10
11 extern int verbose;
12 extern bool quiet, dump_trace;
13 extern int debug_ordered_events;
14
15 #ifndef pr_fmt
16 #define pr_fmt(fmt) fmt
17 #endif
18
19 #define pr_err(fmt, ...) \
20 eprintf(0, verbose, pr_fmt(fmt), ##__VA_ARGS__)
21 #define pr_warning(fmt, ...) \
22 eprintf(0, verbose, pr_fmt(fmt), ##__VA_ARGS__)
23 #define pr_info(fmt, ...) \
24 eprintf(0, verbose, pr_fmt(fmt), ##__VA_ARGS__)
25 #define pr_debug(fmt, ...) \
26 eprintf(1, verbose, pr_fmt(fmt), ##__VA_ARGS__)
27 #define pr_debugN(n, fmt, ...) \
28 eprintf(n, verbose, pr_fmt(fmt), ##__VA_ARGS__)
29 #define pr_debug2(fmt, ...) pr_debugN(2, pr_fmt(fmt), ##__VA_ARGS__)
30 #define pr_debug3(fmt, ...) pr_debugN(3, pr_fmt(fmt), ##__VA_ARGS__)
31 #define pr_debug4(fmt, ...) pr_debugN(4, pr_fmt(fmt), ##__VA_ARGS__)
32
33 #define pr_time_N(n, var, t, fmt, ...) \
34 eprintf_time(n, var, t, fmt, ##__VA_ARGS__)
35
36 #define pr_oe_time(t, fmt, ...) pr_time_N(1, debug_ordered_events, t, pr_fmt(fmt), ##__VA_ARGS__)
37 #define pr_oe_time2(t, fmt, ...) pr_time_N(2, debug_ordered_events, t, pr_fmt(fmt), ##__VA_ARGS__)
38
39 int dump_printf(const char *fmt, ...) __attribute__((format(printf, 1, 2)));
40 void trace_event(union perf_event *event);
41
42 int ui__error(const char *format, ...) __attribute__((format(printf, 1, 2)));
43 int ui__warning(const char *format, ...) __attribute__((format(printf, 1, 2)));
44
45 void pr_stat(const char *fmt, ...);
46
47 int eprintf(int level, int var, const char *fmt, ...) __attribute__((format(printf, 3, 4)));
48 int eprintf_time(int level, int var, u64 t, const char *fmt, ...) __attribute__((format(printf, 4, 5)));
49
50 int perf_debug_option(const char *str);
51
52 #endif /* __PERF_DEBUG_H */
This page took 0.038761 seconds and 5 git commands to generate.