blob: 015c91dbc096310554ba6f7bcec51c16d7cabfac [file] [log] [blame]
Frederic Weisbeckercd84c2a2009-08-12 10:03:49 +02001/* For debugging general purposes */
John Kacur8b40f522009-09-24 18:02:18 +02002#ifndef __PERF_DEBUG_H
3#define __PERF_DEBUG_H
Frederic Weisbeckercd84c2a2009-08-12 10:03:49 +02004
Ian Munsiec0555642010-04-13 18:37:33 +10005#include <stdbool.h>
Arnaldo Carvalho de Melo8f411462009-11-16 16:32:42 -02006#include "event.h"
7
Frederic Weisbeckercd84c2a2009-08-12 10:03:49 +02008extern int verbose;
Arnaldo Carvalho de Melob44308f2010-10-26 15:20:09 -02009extern bool quiet, dump_trace;
Frederic Weisbeckercd84c2a2009-08-12 10:03:49 +020010
Frederic Weisbecker2cec19d2009-08-16 19:24:21 +020011int dump_printf(const char *fmt, ...) __attribute__((format(printf, 1, 2)));
Arnaldo Carvalho de Melo8115d602011-01-29 14:01:45 -020012void trace_event(union perf_event *event);
Arnaldo Carvalho de Melo567e5472010-03-12 21:05:10 -030013
Arnaldo Carvalho de Melo5f4d3f82010-03-26 21:16:22 -030014struct ui_progress;
Namhyung Kimba47a142012-05-29 13:22:58 +090015struct perf_error_ops;
Arnaldo Carvalho de Melo5f4d3f82010-03-26 21:16:22 -030016
Namhyung Kimba47a142012-05-29 13:22:58 +090017#if defined(NO_NEWT_SUPPORT) && defined(NO_GTK2_SUPPORT)
Arnaldo Carvalho de Melo1e6dd072010-08-10 15:58:50 -030018static inline int ui_helpline__show_help(const char *format __used, va_list ap __used)
Arnaldo Carvalho de Melo567e5472010-03-12 21:05:10 -030019{
20 return 0;
21}
Arnaldo Carvalho de Melo5f4d3f82010-03-26 21:16:22 -030022
Arnaldo Carvalho de Meloca59bcb2011-10-25 13:29:11 -020023static inline void ui_progress__update(u64 curr __used, u64 total __used,
24 const char *title __used) {}
Arnaldo Carvalho de Melob8631e62011-10-26 08:02:55 -020025
26#define ui__error(format, arg...) ui__warning(format, ##arg)
Namhyung Kimba47a142012-05-29 13:22:58 +090027
28static inline int
29perf_error__register(struct perf_error_ops *eops __used)
30{
31 return 0;
32}
33
34static inline int
35perf_error__unregister(struct perf_error_ops *eops __used)
36{
37 return 0;
38}
39
40#else /* NO_NEWT_SUPPORT && NO_GTK2_SUPPORT */
41
Arnaldo Carvalho de Melo1e6dd072010-08-10 15:58:50 -030042extern char ui_helpline__last_msg[];
43int ui_helpline__show_help(const char *format, va_list ap);
Namhyung Kimaca7a942012-04-04 00:14:26 -070044#include "../ui/progress.h"
Arnaldo Carvalho de Melo4610e412011-10-26 12:04:37 -020045int ui__error(const char *format, ...) __attribute__((format(printf, 1, 2)));
Namhyung Kimba47a142012-05-29 13:22:58 +090046#include "../ui/util.h"
47
48#endif /* NO_NEWT_SUPPORT && NO_GTK2_SUPPORT */
John Kacur8b40f522009-09-24 18:02:18 +020049
Arnaldo Carvalho de Melo4610e412011-10-26 12:04:37 -020050int ui__warning(const char *format, ...) __attribute__((format(printf, 1, 2)));
51int ui__error_paranoid(void);
Arnaldo Carvalho de Melo068ffaa2010-11-27 02:41:01 -020052
John Kacur8b40f522009-09-24 18:02:18 +020053#endif /* __PERF_DEBUG_H */