debug.h 1.1 KB

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