blob: 6bebe7f0a20c6cb6b12cac9d041203d3221f2b1a [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;
15
Arnaldo Carvalho de Melo567e5472010-03-12 21:05:10 -030016#ifdef NO_NEWT_SUPPORT
Arnaldo Carvalho de Melo1e6dd072010-08-10 15:58:50 -030017static inline int ui_helpline__show_help(const char *format __used, va_list ap __used)
Arnaldo Carvalho de Melo567e5472010-03-12 21:05:10 -030018{
19 return 0;
20}
Arnaldo Carvalho de Melo5f4d3f82010-03-26 21:16:22 -030021
Arnaldo Carvalho de Meloca59bcb2011-10-25 13:29:11 -020022static inline void ui_progress__update(u64 curr __used, u64 total __used,
23 const char *title __used) {}
Arnaldo Carvalho de Melob8631e62011-10-26 08:02:55 -020024
25#define ui__error(format, arg...) ui__warning(format, ##arg)
Arnaldo Carvalho de Melo567e5472010-03-12 21:05:10 -030026#else
Arnaldo Carvalho de Melo1e6dd072010-08-10 15:58:50 -030027extern char ui_helpline__last_msg[];
28int ui_helpline__show_help(const char *format, va_list ap);
Namhyung Kimaca7a942012-04-04 00:14:26 -070029#include "../ui/progress.h"
Arnaldo Carvalho de Melo4610e412011-10-26 12:04:37 -020030int ui__error(const char *format, ...) __attribute__((format(printf, 1, 2)));
Arnaldo Carvalho de Melo567e5472010-03-12 21:05:10 -030031#endif
John Kacur8b40f522009-09-24 18:02:18 +020032
Arnaldo Carvalho de Melo4610e412011-10-26 12:04:37 -020033int ui__warning(const char *format, ...) __attribute__((format(printf, 1, 2)));
34int ui__error_paranoid(void);
Arnaldo Carvalho de Melo068ffaa2010-11-27 02:41:01 -020035
John Kacur8b40f522009-09-24 18:02:18 +020036#endif /* __PERF_DEBUG_H */