Linux Perf
debug.h File Reference
#include <stdbool.h>
#include <string.h>
#include <linux/compiler.h>
#include "event.h"
#include "../ui/helpline.h"
#include "../ui/progress.h"
#include "../ui/util.h"
Include dependency graph for debug.h:

Go to the source code of this file.

Macros

#define pr_fmt(fmt)   fmt
 
#define pr_err(fmt, ...)   eprintf(0, verbose, pr_fmt(fmt), ##__VA_ARGS__)
 
#define pr_warning(fmt, ...)   eprintf(0, verbose, pr_fmt(fmt), ##__VA_ARGS__)
 
#define pr_info(fmt, ...)   eprintf(0, verbose, pr_fmt(fmt), ##__VA_ARGS__)
 
#define pr_debug(fmt, ...)   eprintf(1, verbose, pr_fmt(fmt), ##__VA_ARGS__)
 
#define pr_debugN(n, fmt, ...)   eprintf(n, verbose, pr_fmt(fmt), ##__VA_ARGS__)
 
#define pr_debug2(fmt, ...)   pr_debugN(2, pr_fmt(fmt), ##__VA_ARGS__)
 
#define pr_debug3(fmt, ...)   pr_debugN(3, pr_fmt(fmt), ##__VA_ARGS__)
 
#define pr_debug4(fmt, ...)   pr_debugN(4, pr_fmt(fmt), ##__VA_ARGS__)
 
#define pr_time_N(n, var, t, fmt, ...)   eprintf_time(n, var, t, fmt, ##__VA_ARGS__)
 
#define pr_oe_time(t, fmt, ...)   pr_time_N(1, debug_ordered_events, t, pr_fmt(fmt), ##__VA_ARGS__)
 
#define pr_oe_time2(t, fmt, ...)   pr_time_N(2, debug_ordered_events, t, pr_fmt(fmt), ##__VA_ARGS__)
 
#define STRERR_BUFSIZE   128 /* For the buffer size of str_error_r */
 

Functions

int dump_printf (const char *fmt,...) __printf(1
 
int void trace_event (union perf_event *event)
 
int ui__error (const char *format,...) __printf(1
 
int int ui__warning (const char *format,...) __printf(1
 
int int void pr_stat (const char *fmt,...)
 
int eprintf (int level, int var, const char *fmt,...) __printf(3
 
int int eprintf_time (int level, int var, u64 t, const char *fmt,...) __printf(4
 
int int int veprintf (int level, int var, const char *fmt, va_list args)
 
int perf_debug_option (const char *str)
 
void perf_debug_setup (void)
 
int perf_quiet_option (void)
 
void dump_stack (void)
 
void sighandler_dump_stack (int sig)
 

Variables

int verbose
 
bool quiet
 
bool dump_trace
 
int debug_ordered_events
 
int debug_data_convert
 

Macro Definition Documentation

◆ pr_debug

#define pr_debug (   fmt,
  ... 
)    eprintf(1, verbose, pr_fmt(fmt), ##__VA_ARGS__)

Definition at line 29 of file debug.h.

◆ pr_debug2

#define pr_debug2 (   fmt,
  ... 
)    pr_debugN(2, pr_fmt(fmt), ##__VA_ARGS__)

Definition at line 33 of file debug.h.

◆ pr_debug3

#define pr_debug3 (   fmt,
  ... 
)    pr_debugN(3, pr_fmt(fmt), ##__VA_ARGS__)

Definition at line 34 of file debug.h.

◆ pr_debug4

#define pr_debug4 (   fmt,
  ... 
)    pr_debugN(4, pr_fmt(fmt), ##__VA_ARGS__)

Definition at line 35 of file debug.h.

◆ pr_debugN

#define pr_debugN (   n,
  fmt,
  ... 
)    eprintf(n, verbose, pr_fmt(fmt), ##__VA_ARGS__)

Definition at line 31 of file debug.h.

◆ pr_err

#define pr_err (   fmt,
  ... 
)    eprintf(0, verbose, pr_fmt(fmt), ##__VA_ARGS__)

Definition at line 23 of file debug.h.

◆ pr_fmt

#define pr_fmt (   fmt)    fmt

Definition at line 20 of file debug.h.

◆ pr_info

#define pr_info (   fmt,
  ... 
)    eprintf(0, verbose, pr_fmt(fmt), ##__VA_ARGS__)

Definition at line 27 of file debug.h.

◆ pr_oe_time

#define pr_oe_time (   t,
  fmt,
  ... 
)    pr_time_N(1, debug_ordered_events, t, pr_fmt(fmt), ##__VA_ARGS__)

Definition at line 40 of file debug.h.

◆ pr_oe_time2

#define pr_oe_time2 (   t,
  fmt,
  ... 
)    pr_time_N(2, debug_ordered_events, t, pr_fmt(fmt), ##__VA_ARGS__)

Definition at line 41 of file debug.h.

◆ pr_time_N

#define pr_time_N (   n,
  var,
  t,
  fmt,
  ... 
)    eprintf_time(n, var, t, fmt, ##__VA_ARGS__)

Definition at line 37 of file debug.h.

◆ pr_warning

#define pr_warning (   fmt,
  ... 
)    eprintf(0, verbose, pr_fmt(fmt), ##__VA_ARGS__)

Definition at line 25 of file debug.h.

◆ STRERR_BUFSIZE

#define STRERR_BUFSIZE   128 /* For the buffer size of str_error_r */

Definition at line 43 of file debug.h.

Function Documentation

◆ dump_printf()

int dump_printf ( const char *  fmt,
  ... 
)

◆ dump_stack()

void dump_stack ( void  )

Definition at line 275 of file debug.c.

◆ eprintf()

int eprintf ( int  level,
int  var,
const char *  fmt,
  ... 
)

Definition at line 56 of file jevents.c.

◆ eprintf_time()

int int eprintf_time ( int  level,
int  var,
u64  t,
const char *  fmt,
  ... 
)

◆ perf_debug_option()

int perf_debug_option ( const char *  str)

Definition at line 186 of file debug.c.

Here is the call graph for this function:

◆ perf_debug_setup()

void perf_debug_setup ( void  )

Definition at line 253 of file debug.c.

Here is the call graph for this function:

◆ perf_quiet_option()

int perf_quiet_option ( void  )

Definition at line 225 of file debug.c.

◆ pr_stat()

int int void pr_stat ( const char *  fmt,
  ... 
)

Definition at line 91 of file debug.c.

Here is the call graph for this function:

◆ sighandler_dump_stack()

void sighandler_dump_stack ( int  sig)

Definition at line 278 of file debug.c.

Here is the call graph for this function:

◆ trace_event()

int void trace_event ( union perf_event event)

Definition at line 164 of file debug.c.

Here is the call graph for this function:

◆ ui__error()

int ui__error ( const char *  format,
  ... 
)

◆ ui__warning()

int int ui__warning ( const char *  format,
  ... 
)

◆ veprintf()

int int int veprintf ( int  level,
int  var,
const char *  fmt,
va_list  args 
)

Definition at line 32 of file debug.c.

Here is the call graph for this function:

Variable Documentation

◆ debug_data_convert

int debug_data_convert

Definition at line 30 of file debug.c.

◆ debug_ordered_events

int debug_ordered_events

Definition at line 28 of file debug.c.

◆ dump_trace

bool dump_trace

Definition at line 27 of file debug.c.

◆ quiet

bool quiet

Definition at line 54 of file builtin-probe.c.

◆ verbose

int verbose

Definition at line 53 of file jevents.c.