ceph: use i_size_{read,write} to get/set i_size
[linux/fpc-iii.git] / tools / perf / util / debug.h
blob8b9a088c32ab4e330ece47ae91397bdd87bdd0ee
1 /* For debugging general purposes */
2 #ifndef __PERF_DEBUG_H
3 #define __PERF_DEBUG_H
5 #include <stdbool.h>
6 #include <string.h>
7 #include "event.h"
8 #include "../ui/helpline.h"
9 #include "../ui/progress.h"
10 #include "../ui/util.h"
12 extern int verbose;
13 extern bool quiet, dump_trace;
14 extern int debug_ordered_events;
15 extern int debug_data_convert;
17 #ifndef pr_fmt
18 #define pr_fmt(fmt) fmt
19 #endif
21 #define pr_err(fmt, ...) \
22 eprintf(0, verbose, pr_fmt(fmt), ##__VA_ARGS__)
23 #define pr_warning(fmt, ...) \
24 eprintf(0, verbose, pr_fmt(fmt), ##__VA_ARGS__)
25 #define pr_info(fmt, ...) \
26 eprintf(0, verbose, pr_fmt(fmt), ##__VA_ARGS__)
27 #define pr_debug(fmt, ...) \
28 eprintf(1, verbose, pr_fmt(fmt), ##__VA_ARGS__)
29 #define pr_debugN(n, fmt, ...) \
30 eprintf(n, verbose, pr_fmt(fmt), ##__VA_ARGS__)
31 #define pr_debug2(fmt, ...) pr_debugN(2, pr_fmt(fmt), ##__VA_ARGS__)
32 #define pr_debug3(fmt, ...) pr_debugN(3, pr_fmt(fmt), ##__VA_ARGS__)
33 #define pr_debug4(fmt, ...) pr_debugN(4, pr_fmt(fmt), ##__VA_ARGS__)
35 #define pr_time_N(n, var, t, fmt, ...) \
36 eprintf_time(n, var, t, fmt, ##__VA_ARGS__)
38 #define pr_oe_time(t, fmt, ...) pr_time_N(1, debug_ordered_events, t, pr_fmt(fmt), ##__VA_ARGS__)
39 #define pr_oe_time2(t, fmt, ...) pr_time_N(2, debug_ordered_events, t, pr_fmt(fmt), ##__VA_ARGS__)
41 #define STRERR_BUFSIZE 128 /* For the buffer size of strerror_r */
43 int dump_printf(const char *fmt, ...) __attribute__((format(printf, 1, 2)));
44 void trace_event(union perf_event *event);
46 int ui__error(const char *format, ...) __attribute__((format(printf, 1, 2)));
47 int ui__warning(const char *format, ...) __attribute__((format(printf, 1, 2)));
49 void pr_stat(const char *fmt, ...);
51 int eprintf(int level, int var, const char *fmt, ...) __attribute__((format(printf, 3, 4)));
52 int eprintf_time(int level, int var, u64 t, const char *fmt, ...) __attribute__((format(printf, 4, 5)));
53 int veprintf(int level, int var, const char *fmt, va_list args);
55 int perf_debug_option(const char *str);
57 #endif /* __PERF_DEBUG_H */