blob: 047ac3324ebe0948aefddac341f6994f1f896cce [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;
Ian Munsiec0555642010-04-13 18:37:33 +10009extern bool 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)));
Frederic Weisbecker8f288272009-08-16 22:05:48 +020012void trace_event(event_t *event);
Arnaldo Carvalho de Melo567e5472010-03-12 21:05:10 -030013
Arnaldo Carvalho de Melo5f4d3f82010-03-26 21:16:22 -030014struct ui_progress;
15
Arnaldo Carvalho de Melo567e5472010-03-12 21:05:10 -030016#ifdef NO_NEWT_SUPPORT
17static inline int browser__show_help(const char *format __used, va_list ap __used)
18{
19 return 0;
20}
Arnaldo Carvalho de Melo5f4d3f82010-03-26 21:16:22 -030021
22static inline struct ui_progress *ui_progress__new(const char *title __used,
23 u64 total __used)
24{
25 return (struct ui_progress *)1;
26}
27
28static inline void ui_progress__update(struct ui_progress *self __used,
29 u64 curr __used) {}
30
31static inline void ui_progress__delete(struct ui_progress *self __used) {}
Arnaldo Carvalho de Melo567e5472010-03-12 21:05:10 -030032#else
Arnaldo Carvalho de Melof9224c52010-03-11 20:12:44 -030033int browser__show_help(const char *format, va_list ap);
Arnaldo Carvalho de Melo5f4d3f82010-03-26 21:16:22 -030034struct ui_progress *ui_progress__new(const char *title, u64 total);
35void ui_progress__update(struct ui_progress *self, u64 curr);
36void ui_progress__delete(struct ui_progress *self);
Arnaldo Carvalho de Melo567e5472010-03-12 21:05:10 -030037#endif
John Kacur8b40f522009-09-24 18:02:18 +020038
39#endif /* __PERF_DEBUG_H */