Linux Perf
debug.c File Reference
#include "../perf.h"
#include <inttypes.h>
#include <string.h>
#include <stdarg.h>
#include <stdio.h>
#include <sys/wait.h>
#include <api/debug.h>
#include <linux/time64.h>
#include "cache.h"
#include "color.h"
#include "event.h"
#include "debug.h"
#include "print_binary.h"
#include "util.h"
#include "target.h"
#include "sane_ctype.h"
Include dependency graph for debug.c:

Go to the source code of this file.

Classes

struct  debug_variable
 

Macros

#define DEBUG_WRAPPER(__n, __l)
 

Functions

int veprintf (int level, int var, const char *fmt, va_list args)
 
int eprintf (int level, int var, const char *fmt,...)
 
static int veprintf_time (u64 t, const char *fmt, va_list args)
 
int eprintf_time (int level, int var, u64 t, const char *fmt,...)
 
void pr_stat (const char *fmt,...)
 
int dump_printf (const char *fmt,...)
 
static int trace_event_printer (enum binary_printer_ops op, unsigned int val, void *extra, FILE *fp)
 
void trace_event (union perf_event *event)
 
int perf_debug_option (const char *str)
 
int perf_quiet_option (void)
 
 DEBUG_WRAPPER (warning, 0)
 
 DEBUG_WRAPPER (debug, 1)
 
void perf_debug_setup (void)
 
void dump_stack (void)
 
void sighandler_dump_stack (int sig)
 

Variables

int verbose
 
bool dump_trace = false
 
bool quiet = false
 
int debug_ordered_events
 
static int redirect_to_stderr
 
int debug_data_convert
 
static struct debug_variable debug_variables []
 

Macro Definition Documentation

◆ DEBUG_WRAPPER

#define DEBUG_WRAPPER (   __n,
  __l 
)
Value:
static int pr_ ## __n ## _wrapper(const char *fmt, ...) \
{ \
va_list args; \
int ret; \
\
va_start(args, fmt); \
ret = veprintf(__l, verbose, fmt, args); \
va_end(args); \
return ret; \
}
int veprintf(int level, int var, const char *fmt, va_list args)
Definition: debug.c:32
const char * fmt
Definition: dso.c:193
int verbose
Definition: debug.c:26

Definition at line 238 of file debug.c.

Function Documentation

◆ DEBUG_WRAPPER() [1/2]

DEBUG_WRAPPER ( warning  ,
 
)

◆ DEBUG_WRAPPER() [2/2]

DEBUG_WRAPPER ( debug  ,
 
)

◆ dump_printf()

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

Definition at line 101 of file debug.c.

◆ 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 46 of file debug.c.

Here is the call graph for this function:

◆ eprintf_time()

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

Definition at line 73 of file debug.c.

Here is the call graph for this function:

◆ 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()

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()

void trace_event ( union perf_event event)

Definition at line 164 of file debug.c.

Here is the call graph for this function:

◆ trace_event_printer()

static int trace_event_printer ( enum binary_printer_ops  op,
unsigned int  val,
void *  extra,
FILE *  fp 
)
static

Definition at line 115 of file debug.c.

Here is the call graph for this function:

◆ veprintf()

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:

◆ veprintf_time()

static int veprintf_time ( u64  t,
const char *  fmt,
va_list  args 
)
static

Definition at line 58 of file debug.c.

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.

◆ debug_variables

struct debug_variable debug_variables[]
static
Initial value:
= {
{ .name = "verbose", .ptr = &verbose },
{ .name = "ordered-events", .ptr = &debug_ordered_events},
{ .name = "stderr", .ptr = &redirect_to_stderr},
{ .name = "data-convert", .ptr = &debug_data_convert },
{ .name = NULL, }
}
int debug_ordered_events
Definition: debug.c:28
int verbose
Definition: debug.c:26
int debug_data_convert
Definition: debug.c:30
static int redirect_to_stderr
Definition: debug.c:29

◆ dump_trace

bool dump_trace = false

Definition at line 27 of file debug.c.

◆ quiet

bool quiet = false

Definition at line 27 of file debug.c.

◆ redirect_to_stderr

int redirect_to_stderr
static

Definition at line 29 of file debug.c.

◆ verbose

int verbose

Definition at line 26 of file debug.c.