~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/tools/perf/util/debug.h

Version: ~ [ linux-6.11.5 ] ~ [ linux-6.10.14 ] ~ [ linux-6.9.12 ] ~ [ linux-6.8.12 ] ~ [ linux-6.7.12 ] ~ [ linux-6.6.58 ] ~ [ linux-6.5.13 ] ~ [ linux-6.4.16 ] ~ [ linux-6.3.13 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.114 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.169 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.228 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.284 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.322 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.336 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.337 ] ~ [ linux-4.4.302 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.9 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 /* SPDX-License-Identifier: GPL-2.0 */
  2 /* For debugging general purposes */
  3 #ifndef __PERF_DEBUG_H
  4 #define __PERF_DEBUG_H
  5 
  6 #include <stdarg.h>
  7 #include <stdbool.h>
  8 #include <stdio.h>
  9 #include <linux/compiler.h>
 10 
 11 extern int verbose;
 12 extern int debug_kmaps;
 13 extern int debug_peo_args;
 14 extern bool quiet, dump_trace;
 15 extern int debug_ordered_events;
 16 extern int debug_data_convert;
 17 extern int debug_type_profile;
 18 
 19 #ifndef pr_fmt
 20 #define pr_fmt(fmt) fmt
 21 #endif
 22 
 23 #define pr_err(fmt, ...) \
 24         eprintf(0, verbose, pr_fmt(fmt), ##__VA_ARGS__)
 25 #define pr_warning(fmt, ...) \
 26         eprintf(0, verbose, pr_fmt(fmt), ##__VA_ARGS__)
 27 #define pr_warning_once(fmt, ...) ({            \
 28         static int __warned;                    \
 29         if (unlikely(!__warned)) {              \
 30                 pr_warning(fmt, ##__VA_ARGS__); \
 31                 __warned = 1;                   \
 32         }                                       \
 33 })
 34 #define pr_info(fmt, ...) \
 35         eprintf(0, verbose, pr_fmt(fmt), ##__VA_ARGS__)
 36 #define pr_debug(fmt, ...) \
 37         eprintf(1, verbose, pr_fmt(fmt), ##__VA_ARGS__)
 38 #define pr_debugN(n, fmt, ...) \
 39         eprintf(n, verbose, pr_fmt(fmt), ##__VA_ARGS__)
 40 #define pr_debug2(fmt, ...) pr_debugN(2, pr_fmt(fmt), ##__VA_ARGS__)
 41 #define pr_debug3(fmt, ...) pr_debugN(3, pr_fmt(fmt), ##__VA_ARGS__)
 42 #define pr_debug4(fmt, ...) pr_debugN(4, pr_fmt(fmt), ##__VA_ARGS__)
 43 
 44 /* Special macro to print perf_event_open arguments/return value. */
 45 #define pr_debug2_peo(fmt, ...) {                               \
 46         if (debug_peo_args)                                             \
 47                 pr_debugN(0, pr_fmt(fmt), ##__VA_ARGS__);       \
 48         else                                                    \
 49                 pr_debugN(2, pr_fmt(fmt), ##__VA_ARGS__);       \
 50 }
 51 
 52 #define pr_time_N(n, var, t, fmt, ...) \
 53         eprintf_time(n, var, t, fmt, ##__VA_ARGS__)
 54 
 55 #define pr_oe_time(t, fmt, ...)  pr_time_N(1, debug_ordered_events, t, pr_fmt(fmt), ##__VA_ARGS__)
 56 #define pr_oe_time2(t, fmt, ...) pr_time_N(2, debug_ordered_events, t, pr_fmt(fmt), ##__VA_ARGS__)
 57 
 58 #define STRERR_BUFSIZE  128     /* For the buffer size of str_error_r */
 59 
 60 union perf_event;
 61 
 62 int dump_printf(const char *fmt, ...) __printf(1, 2);
 63 void trace_event(union perf_event *event);
 64 
 65 int ui__error(const char *format, ...) __printf(1, 2);
 66 int ui__warning(const char *format, ...) __printf(1, 2);
 67 #define ui__warning_once(format, ...) ({                \
 68         static int __warned;                            \
 69         if (unlikely(!__warned)) {                      \
 70                 ui__warning(format, ##__VA_ARGS__);     \
 71                 __warned = 1;                           \
 72         }                                               \
 73 })
 74 
 75 void pr_stat(const char *fmt, ...);
 76 
 77 int eprintf(int level, int var, const char *fmt, ...) __printf(3, 4);
 78 int eprintf_time(int level, int var, u64 t, const char *fmt, ...) __printf(4, 5);
 79 int veprintf(int level, int var, const char *fmt, va_list args);
 80 
 81 int perf_debug_option(const char *str);
 82 FILE *debug_file(void);
 83 void debug_set_file(FILE *file);
 84 void debug_set_display_time(bool set);
 85 void perf_debug_setup(void);
 86 int perf_quiet_option(void);
 87 
 88 void dump_stack(void);
 89 void sighandler_dump_stack(int sig);
 90 
 91 #endif  /* __PERF_DEBUG_H */
 92 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

sflogo.php