perf ui: Introduce struct perf_error_ops
[linux-2.6/linux-acpi-2.6/ibm-acpi-2.6.git] / tools / perf / util / debug.h
blob015c91dbc096310554ba6f7bcec51c16d7cabfac
1 /* For debugging general purposes */
2 #ifndef __PERF_DEBUG_H
3 #define __PERF_DEBUG_H
5 #include <stdbool.h>
6 #include "event.h"
8 extern int verbose;
9 extern bool quiet, dump_trace;
11 int dump_printf(const char *fmt, ...) __attribute__((format(printf, 1, 2)));
12 void trace_event(union perf_event *event);
14 struct ui_progress;
15 struct perf_error_ops;
17 #if defined(NO_NEWT_SUPPORT) && defined(NO_GTK2_SUPPORT)
18 static inline int ui_helpline__show_help(const char *format __used, va_list ap __used)
20 return 0;
23 static inline void ui_progress__update(u64 curr __used, u64 total __used,
24 const char *title __used) {}
26 #define ui__error(format, arg...) ui__warning(format, ##arg)
28 static inline int
29 perf_error__register(struct perf_error_ops *eops __used)
31 return 0;
34 static inline int
35 perf_error__unregister(struct perf_error_ops *eops __used)
37 return 0;
40 #else /* NO_NEWT_SUPPORT && NO_GTK2_SUPPORT */
42 extern char ui_helpline__last_msg[];
43 int ui_helpline__show_help(const char *format, va_list ap);
44 #include "../ui/progress.h"
45 int ui__error(const char *format, ...) __attribute__((format(printf, 1, 2)));
46 #include "../ui/util.h"
48 #endif /* NO_NEWT_SUPPORT && NO_GTK2_SUPPORT */
50 int ui__warning(const char *format, ...) __attribute__((format(printf, 1, 2)));
51 int ui__error_paranoid(void);
53 #endif /* __PERF_DEBUG_H */