blob: 83e8d234af6b149a045902c267dbb8c6b8926ad0 [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"
Namhyung Kim0985a942012-08-16 17:14:54 +09007#include "../ui/helpline.h"
Arnaldo Carvalho de Melo8f411462009-11-16 16:32:42 -02008
Frederic Weisbeckercd84c2a2009-08-12 10:03:49 +02009extern int verbose;
Arnaldo Carvalho de Melob44308f2010-10-26 15:20:09 -020010extern bool quiet, dump_trace;
Frederic Weisbeckercd84c2a2009-08-12 10:03:49 +020011
Frederic Weisbecker2cec19d2009-08-16 19:24:21 +020012int dump_printf(const char *fmt, ...) __attribute__((format(printf, 1, 2)));
Arnaldo Carvalho de Melo8115d602011-01-29 14:01:45 -020013void trace_event(union perf_event *event);
Arnaldo Carvalho de Melo567e5472010-03-12 21:05:10 -030014
Arnaldo Carvalho de Melo5f4d3f82010-03-26 21:16:22 -030015struct ui_progress;
Namhyung Kimba47a142012-05-29 13:22:58 +090016struct perf_error_ops;
Arnaldo Carvalho de Melo5f4d3f82010-03-26 21:16:22 -030017
Namhyung Kimf9f526e2012-09-28 18:32:03 +090018#if defined(NEWT_SUPPORT) || defined(GTK2_SUPPORT)
19
20#include "../ui/progress.h"
21int ui__error(const char *format, ...) __attribute__((format(printf, 1, 2)));
22#include "../ui/util.h"
23
24#else
25
Irina Tirdea1d037ca2012-09-11 01:15:03 +030026static inline void ui_progress__update(u64 curr __maybe_unused,
27 u64 total __maybe_unused,
28 const char *title __maybe_unused) {}
Namhyung Kima5580f32012-11-13 22:30:34 +090029static inline void ui_progress__finish(void) {}
Arnaldo Carvalho de Melob8631e62011-10-26 08:02:55 -020030
31#define ui__error(format, arg...) ui__warning(format, ##arg)
Namhyung Kimba47a142012-05-29 13:22:58 +090032
33static inline int
Irina Tirdea1d037ca2012-09-11 01:15:03 +030034perf_error__register(struct perf_error_ops *eops __maybe_unused)
Namhyung Kimba47a142012-05-29 13:22:58 +090035{
36 return 0;
37}
38
39static inline int
Irina Tirdea1d037ca2012-09-11 01:15:03 +030040perf_error__unregister(struct perf_error_ops *eops __maybe_unused)
Namhyung Kimba47a142012-05-29 13:22:58 +090041{
42 return 0;
43}
44
Namhyung Kimf9f526e2012-09-28 18:32:03 +090045#endif /* NEWT_SUPPORT || GTK2_SUPPORT */
John Kacur8b40f522009-09-24 18:02:18 +020046
Arnaldo Carvalho de Melo4610e412011-10-26 12:04:37 -020047int ui__warning(const char *format, ...) __attribute__((format(printf, 1, 2)));
48int ui__error_paranoid(void);
Arnaldo Carvalho de Melo068ffaa2010-11-27 02:41:01 -020049
John Kacur8b40f522009-09-24 18:02:18 +020050#endif /* __PERF_DEBUG_H */