debug.h 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  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(NO_GTK2_SUPPORT)
  14. static inline void ui_progress__update(u64 curr __maybe_unused,
  15. u64 total __maybe_unused,
  16. const char *title __maybe_unused) {}
  17. #define ui__error(format, arg...) ui__warning(format, ##arg)
  18. static inline int
  19. perf_error__register(struct perf_error_ops *eops __maybe_unused)
  20. {
  21. return 0;
  22. }
  23. static inline int
  24. perf_error__unregister(struct perf_error_ops *eops __maybe_unused)
  25. {
  26. return 0;
  27. }
  28. #else /* !NEWT_SUPPORT && NO_GTK2_SUPPORT */
  29. #include "../ui/progress.h"
  30. int ui__error(const char *format, ...) __attribute__((format(printf, 1, 2)));
  31. #include "../ui/util.h"
  32. #endif /* !NEWT_SUPPORT && NO_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 */