debug.h 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. /* For debugging general purposes */
  2. #ifndef __PERF_DEBUG_H
  3. #define __PERF_DEBUG_H
  4. #include <stdbool.h>
  5. #include "event.h"
  6. extern int verbose;
  7. extern bool quiet, dump_trace;
  8. int dump_printf(const char *fmt, ...) __attribute__((format(printf, 1, 2)));
  9. void trace_event(union perf_event *event);
  10. struct ui_progress;
  11. struct perf_error_ops;
  12. #if defined(NO_NEWT_SUPPORT) && defined(NO_GTK2_SUPPORT)
  13. static inline int ui_helpline__show_help(const char *format __used, va_list ap __used)
  14. {
  15. return 0;
  16. }
  17. static inline void ui_progress__update(u64 curr __used, u64 total __used,
  18. const char *title __used) {}
  19. #define ui__error(format, arg...) ui__warning(format, ##arg)
  20. static inline int
  21. perf_error__register(struct perf_error_ops *eops __used)
  22. {
  23. return 0;
  24. }
  25. static inline int
  26. perf_error__unregister(struct perf_error_ops *eops __used)
  27. {
  28. return 0;
  29. }
  30. #else /* NO_NEWT_SUPPORT && NO_GTK2_SUPPORT */
  31. extern char ui_helpline__last_msg[];
  32. int ui_helpline__show_help(const char *format, va_list ap);
  33. #include "../ui/progress.h"
  34. int ui__error(const char *format, ...) __attribute__((format(printf, 1, 2)));
  35. #include "../ui/util.h"
  36. #endif /* NO_NEWT_SUPPORT && NO_GTK2_SUPPORT */
  37. int ui__warning(const char *format, ...) __attribute__((format(printf, 1, 2)));
  38. int ui__error_paranoid(void);
  39. #endif /* __PERF_DEBUG_H */