blob: 05e660cbf7e2f90f9c237031bf4057e87c52cb47 [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 Kimba47a142012-05-29 13:22:58 +090018#if defined(NO_NEWT_SUPPORT) && defined(NO_GTK2_SUPPORT)
Arnaldo Carvalho de Meloca59bcb2011-10-25 13:29:11 -020019static inline void ui_progress__update(u64 curr __used, u64 total __used,
20 const char *title __used) {}
Arnaldo Carvalho de Melob8631e62011-10-26 08:02:55 -020021
22#define ui__error(format, arg...) ui__warning(format, ##arg)
Namhyung Kimba47a142012-05-29 13:22:58 +090023
24static inline int
25perf_error__register(struct perf_error_ops *eops __used)
26{
27 return 0;
28}
29
30static inline int
31perf_error__unregister(struct perf_error_ops *eops __used)
32{
33 return 0;
34}
35
36#else /* NO_NEWT_SUPPORT && NO_GTK2_SUPPORT */
37
Namhyung Kimaca7a942012-04-04 00:14:26 -070038#include "../ui/progress.h"
Arnaldo Carvalho de Melo4610e412011-10-26 12:04:37 -020039int ui__error(const char *format, ...) __attribute__((format(printf, 1, 2)));
Namhyung Kimba47a142012-05-29 13:22:58 +090040#include "../ui/util.h"
41
42#endif /* NO_NEWT_SUPPORT && NO_GTK2_SUPPORT */
John Kacur8b40f522009-09-24 18:02:18 +020043
Arnaldo Carvalho de Melo4610e412011-10-26 12:04:37 -020044int ui__warning(const char *format, ...) __attribute__((format(printf, 1, 2)));
45int ui__error_paranoid(void);
Arnaldo Carvalho de Melo068ffaa2010-11-27 02:41:01 -020046
John Kacur8b40f522009-09-24 18:02:18 +020047#endif /* __PERF_DEBUG_H */