Linux Perf
builtin-probe.c File Reference
#include <sys/utsname.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <errno.h>
#include <stdio.h>
#include <unistd.h>
#include <stdlib.h>
#include <string.h>
#include "perf.h"
#include "builtin.h"
#include "util/util.h"
#include "util/strlist.h"
#include "util/strfilter.h"
#include "util/symbol.h"
#include "util/debug.h"
#include <subcmd/parse-options.h>
#include "util/probe-finder.h"
#include "util/probe-event.h"
#include "util/probe-file.h"
Include dependency graph for builtin-probe.c:

Go to the source code of this file.

Macros

#define DEFAULT_VAR_FILTER   "!__k???tab_* & !__crc_*"
 
#define DEFAULT_FUNC_FILTER   "!_*"
 
#define DEFAULT_LIST_FILTER   "*"
 
#define opt_show_lines   NULL
 
#define opt_show_vars   NULL
 
#define PROBEDEF_STR   "[EVENT=]FUNC[+OFF|%return] [[NAME=]ARG ...]"
 
#define set_nobuild(s, l, c)   set_option_nobuild(options, s, l, "NO_DWARF=1", c)
 

Functions

static int parse_probe_event (const char *str)
 
static int params_add_filter (const char *str)
 
static int set_target (const char *ptr)
 
static int parse_probe_event_argv (int argc, const char **argv)
 
static int opt_set_target (const struct option *opt, const char *str, int unset __maybe_unused)
 
static int opt_set_target_ns (const struct option *opt __maybe_unused, const char *str, int unset __maybe_unused)
 
static int opt_add_probe_event (const struct option *opt, const char *str, int unset __maybe_unused)
 
static int opt_set_filter_with_command (const struct option *opt, const char *str, int unset)
 
static int opt_set_filter (const struct option *opt __maybe_unused, const char *str, int unset __maybe_unused)
 
static int init_params (void)
 
static void cleanup_params (void)
 
static void pr_err_with_code (const char *msg, int err)
 
static int perf_add_probe_events (struct perf_probe_event *pevs, int npevs)
 
static int del_perf_probe_caches (struct strfilter *filter)
 
static int perf_del_probe_events (struct strfilter *filter)
 
static int __cmd_probe (int argc, const char **argv)
 
int cmd_probe (int argc, const char **argv)
 

Variables

struct {
   int   command
 
   bool   list_events
 
   bool   uprobes
 
   bool   quiet
 
   bool   target_used
 
   int   nevents
 
   struct perf_probe_event   events [MAX_PROBES]
 
   struct line_range   line_range
 
   char *   target
 
   struct strfilter *   filter
 
   struct nsinfo *   nsi
 
params
 

Macro Definition Documentation

◆ DEFAULT_FUNC_FILTER

#define DEFAULT_FUNC_FILTER   "!_*"

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

◆ DEFAULT_LIST_FILTER

#define DEFAULT_LIST_FILTER   "*"

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

◆ DEFAULT_VAR_FILTER

#define DEFAULT_VAR_FILTER   "!__k???tab_* & !__crc_*"

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

◆ opt_show_lines

#define opt_show_lines   NULL

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

◆ opt_show_vars

#define opt_show_vars   NULL

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

◆ PROBEDEF_STR

#define PROBEDEF_STR   "[EVENT=]FUNC[+OFF|%return] [[NAME=]ARG ...]"

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

◆ set_nobuild

#define set_nobuild (   s,
  l,
 
)    set_option_nobuild(options, s, l, "NO_DWARF=1", c)

Function Documentation

◆ __cmd_probe()

static int __cmd_probe ( int  argc,
const char **  argv 
)
static

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

Here is the call graph for this function:

◆ cleanup_params()

static void cleanup_params ( void  )
static

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

Here is the call graph for this function:

◆ cmd_probe()

int cmd_probe ( int  argc,
const char **  argv 
)

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

Here is the call graph for this function:

◆ del_perf_probe_caches()

static int del_perf_probe_caches ( struct strfilter filter)
static

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

Here is the call graph for this function:

◆ init_params()

static int init_params ( void  )
static

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

Here is the call graph for this function:

◆ opt_add_probe_event()

static int opt_add_probe_event ( const struct option *  opt,
const char *  str,
int unset  __maybe_unused 
)
static

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

Here is the call graph for this function:

◆ opt_set_filter()

static int opt_set_filter ( const struct option *opt  __maybe_unused,
const char *  str,
int unset  __maybe_unused 
)
static

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

Here is the call graph for this function:

◆ opt_set_filter_with_command()

static int opt_set_filter_with_command ( const struct option *  opt,
const char *  str,
int  unset 
)
static

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

Here is the call graph for this function:

◆ opt_set_target()

static int opt_set_target ( const struct option *  opt,
const char *  str,
int unset  __maybe_unused 
)
static

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

Here is the call graph for this function:

◆ opt_set_target_ns()

static int opt_set_target_ns ( const struct option *opt  __maybe_unused,
const char *  str,
int unset  __maybe_unused 
)
static

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

Here is the call graph for this function:

◆ params_add_filter()

static int params_add_filter ( const char *  str)
static

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

Here is the call graph for this function:

◆ parse_probe_event()

static int parse_probe_event ( const char *  str)
static

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

Here is the call graph for this function:

◆ parse_probe_event_argv()

static int parse_probe_event_argv ( int  argc,
const char **  argv 
)
static

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

Here is the call graph for this function:

◆ perf_add_probe_events()

static int perf_add_probe_events ( struct perf_probe_event pevs,
int  npevs 
)
static

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

Here is the call graph for this function:

◆ perf_del_probe_events()

static int perf_del_probe_events ( struct strfilter filter)
static

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

Here is the call graph for this function:

◆ pr_err_with_code()

static void pr_err_with_code ( const char *  msg,
int  err 
)
static

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

◆ set_target()

static int set_target ( const char *  ptr)
static

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

Variable Documentation

◆ command

int command

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

◆ events

struct perf_probe_event events[MAX_PROBES]

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

◆ filter

struct strfilter* filter

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

◆ line_range

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

◆ list_events

bool list_events

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

◆ nevents

int nevents

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

◆ nsi

struct nsinfo* nsi

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

◆ params

struct { ... } params

◆ quiet

bool quiet

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

◆ target

char* target

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

◆ target_used

bool target_used

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

◆ uprobes

bool uprobes

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