Linux Perf
probe-file.c File Reference
#include <errno.h>
#include <fcntl.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <sys/uio.h>
#include <unistd.h>
#include "util.h"
#include "event.h"
#include "strlist.h"
#include "strfilter.h"
#include "debug.h"
#include "cache.h"
#include "color.h"
#include "symbol.h"
#include "thread.h"
#include <api/fs/tracing_path.h>
#include "probe-event.h"
#include "probe-file.h"
#include "session.h"
#include "perf_regs.h"
#include "string2.h"
Include dependency graph for probe-file.c:

Go to the source code of this file.

Macros

#define MAX_CMDLEN   4094
 
#define DEFINE_TYPE(idx, pat)   [idx] = {.pattern = pat, .avail = false}
 

Enumerations

enum  ftrace_readme { FTRACE_README_PROBE_TYPE_X = 0, FTRACE_README_KRETPROBE_OFFSET, FTRACE_README_END }
 

Functions

static void print_open_warning (int err, bool uprobe)
 
static void print_both_open_warning (int kerr, int uerr)
 
int open_trace_file (const char *trace_file, bool readwrite)
 
static int open_kprobe_events (bool readwrite)
 
static int open_uprobe_events (bool readwrite)
 
int probe_file__open (int flag)
 
int probe_file__open_both (int *kfd, int *ufd, int flag)
 
struct strlistprobe_file__get_rawlist (int fd)
 
static struct strlist__probe_file__get_namelist (int fd, bool include_group)
 
struct strlistprobe_file__get_namelist (int fd)
 
int probe_file__add_event (int fd, struct probe_trace_event *tev)
 
static int __del_trace_probe_event (int fd, struct str_node *ent)
 
int probe_file__get_events (int fd, struct strfilter *filter, struct strlist *plist)
 
int probe_file__del_strlist (int fd, struct strlist *namelist)
 
int probe_file__del_events (int fd, struct strfilter *filter)
 
static void probe_cache_entry__delete (struct probe_cache_entry *entry)
 
static struct probe_cache_entryprobe_cache_entry__new (struct perf_probe_event *pev)
 
int probe_cache_entry__get_event (struct probe_cache_entry *entry, struct probe_trace_event **tevs)
 
static int probe_cache__open (struct probe_cache *pcache, const char *target, struct nsinfo *nsi)
 
static int probe_cache__load (struct probe_cache *pcache)
 
static struct probe_cacheprobe_cache__alloc (void)
 
void probe_cache__purge (struct probe_cache *pcache)
 
void probe_cache__delete (struct probe_cache *pcache)
 
struct probe_cacheprobe_cache__new (const char *target, struct nsinfo *nsi)
 
static bool streql (const char *a, const char *b)
 
struct probe_cache_entryprobe_cache__find (struct probe_cache *pcache, struct perf_probe_event *pev)
 
struct probe_cache_entryprobe_cache__find_by_name (struct probe_cache *pcache, const char *group, const char *event)
 
int probe_cache__add_entry (struct probe_cache *pcache, struct perf_probe_event *pev, struct probe_trace_event *tevs, int ntevs)
 
static int probe_cache_entry__write (struct probe_cache_entry *entry, int fd)
 
int probe_cache__commit (struct probe_cache *pcache)
 
static bool probe_cache_entry__compare (struct probe_cache_entry *entry, struct strfilter *filter)
 
int probe_cache__filter_purge (struct probe_cache *pcache, struct strfilter *filter)
 
static int probe_cache__show_entries (struct probe_cache *pcache, struct strfilter *filter)
 
int probe_cache__show_all_caches (struct strfilter *filter)
 
static bool scan_ftrace_readme (enum ftrace_readme type)
 
bool probe_type_is_available (enum probe_type type)
 
bool kretprobe_offset_is_supported (void)
 

Variables

struct {
   const char *   pattern
 
   bool   avail
 
ftrace_readme_table []
 

Macro Definition Documentation

◆ DEFINE_TYPE

#define DEFINE_TYPE (   idx,
  pat 
)    [idx] = {.pattern = pat, .avail = false}

◆ MAX_CMDLEN

#define MAX_CMDLEN   4094

Definition at line 40 of file probe-file.c.

Enumeration Type Documentation

◆ ftrace_readme

Enumerator
FTRACE_README_PROBE_TYPE_X 
FTRACE_README_KRETPROBE_OFFSET 
FTRACE_README_END 

Definition at line 998 of file probe-file.c.

Function Documentation

◆ __del_trace_probe_event()

static int __del_trace_probe_event ( int  fd,
struct str_node ent 
)
static

Definition at line 259 of file probe-file.c.

Here is the call graph for this function:

◆ __probe_file__get_namelist()

static struct strlist* __probe_file__get_namelist ( int  fd,
bool  include_group 
)
static

Definition at line 192 of file probe-file.c.

Here is the call graph for this function:

◆ kretprobe_offset_is_supported()

bool kretprobe_offset_is_supported ( void  )

Definition at line 1063 of file probe-file.c.

Here is the call graph for this function:

◆ open_kprobe_events()

static int open_kprobe_events ( bool  readwrite)
static

Definition at line 101 of file probe-file.c.

Here is the call graph for this function:

◆ open_trace_file()

int open_trace_file ( const char *  trace_file,
bool  readwrite 
)

Definition at line 82 of file probe-file.c.

Here is the call graph for this function:

◆ open_uprobe_events()

static int open_uprobe_events ( bool  readwrite)
static

Definition at line 106 of file probe-file.c.

Here is the call graph for this function:

◆ print_both_open_warning()

static void print_both_open_warning ( int  kerr,
int  uerr 
)
static

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

◆ print_open_warning()

static void print_open_warning ( int  err,
bool  uprobe 
)
static

Definition at line 42 of file probe-file.c.

◆ probe_cache__add_entry()

int probe_cache__add_entry ( struct probe_cache pcache,
struct perf_probe_event pev,
struct probe_trace_event tevs,
int  ntevs 
)

Definition at line 651 of file probe-file.c.

Here is the call graph for this function:

◆ probe_cache__alloc()

static struct probe_cache* probe_cache__alloc ( void  )
static

Definition at line 530 of file probe-file.c.

Here is the call graph for this function:

◆ probe_cache__commit()

int probe_cache__commit ( struct probe_cache pcache)

Definition at line 902 of file probe-file.c.

Here is the call graph for this function:

◆ probe_cache__delete()

void probe_cache__delete ( struct probe_cache pcache)

Definition at line 551 of file probe-file.c.

Here is the call graph for this function:

◆ probe_cache__filter_purge()

int probe_cache__filter_purge ( struct probe_cache pcache,
struct strfilter filter 
)

Definition at line 938 of file probe-file.c.

Here is the call graph for this function:

◆ probe_cache__find()

struct probe_cache_entry* probe_cache__find ( struct probe_cache pcache,
struct perf_probe_event pev 
)

Definition at line 601 of file probe-file.c.

Here is the call graph for this function:

◆ probe_cache__find_by_name()

struct probe_cache_entry* probe_cache__find_by_name ( struct probe_cache pcache,
const char *  group,
const char *  event 
)

Definition at line 634 of file probe-file.c.

Here is the call graph for this function:

◆ probe_cache__load()

static int probe_cache__load ( struct probe_cache pcache)
static

Definition at line 475 of file probe-file.c.

Here is the call graph for this function:

◆ probe_cache__new()

struct probe_cache* probe_cache__new ( const char *  target,
struct nsinfo nsi 
)

Definition at line 562 of file probe-file.c.

Here is the call graph for this function:

◆ probe_cache__open()

static int probe_cache__open ( struct probe_cache pcache,
const char *  target,
struct nsinfo nsi 
)
static

Definition at line 415 of file probe-file.c.

Here is the call graph for this function:

◆ probe_cache__purge()

void probe_cache__purge ( struct probe_cache pcache)

Definition at line 541 of file probe-file.c.

Here is the call graph for this function:

◆ probe_cache__show_all_caches()

int probe_cache__show_all_caches ( struct strfilter filter)

Definition at line 966 of file probe-file.c.

Here is the call graph for this function:

◆ probe_cache__show_entries()

static int probe_cache__show_entries ( struct probe_cache pcache,
struct strfilter filter 
)
static

Definition at line 953 of file probe-file.c.

Here is the call graph for this function:

◆ probe_cache_entry__compare()

static bool probe_cache_entry__compare ( struct probe_cache_entry entry,
struct strfilter filter 
)
static

Definition at line 926 of file probe-file.c.

Here is the call graph for this function:

◆ probe_cache_entry__delete()

static void probe_cache_entry__delete ( struct probe_cache_entry entry)
static

Definition at line 354 of file probe-file.c.

Here is the call graph for this function:

◆ probe_cache_entry__get_event()

int probe_cache_entry__get_event ( struct probe_cache_entry entry,
struct probe_trace_event **  tevs 
)

Definition at line 389 of file probe-file.c.

Here is the call graph for this function:

◆ probe_cache_entry__new()

static struct probe_cache_entry* probe_cache_entry__new ( struct perf_probe_event pev)
static

Definition at line 367 of file probe-file.c.

Here is the call graph for this function:

◆ probe_cache_entry__write()

static int probe_cache_entry__write ( struct probe_cache_entry entry,
int  fd 
)
static

Definition at line 862 of file probe-file.c.

◆ probe_file__add_event()

int probe_file__add_event ( int  fd,
struct probe_trace_event tev 
)

Definition at line 235 of file probe-file.c.

Here is the call graph for this function:

◆ probe_file__del_events()

int probe_file__del_events ( int  fd,
struct strfilter filter 
)

Definition at line 334 of file probe-file.c.

Here is the call graph for this function:

◆ probe_file__del_strlist()

int probe_file__del_strlist ( int  fd,
struct strlist namelist 
)

Definition at line 321 of file probe-file.c.

Here is the call graph for this function:

◆ probe_file__get_events()

int probe_file__get_events ( int  fd,
struct strfilter filter,
struct strlist plist 
)

Definition at line 293 of file probe-file.c.

Here is the call graph for this function:

◆ probe_file__get_namelist()

struct strlist* probe_file__get_namelist ( int  fd)

Definition at line 230 of file probe-file.c.

Here is the call graph for this function:

◆ probe_file__get_rawlist()

struct strlist* probe_file__get_rawlist ( int  fd)

Definition at line 141 of file probe-file.c.

Here is the call graph for this function:

◆ probe_file__open()

int probe_file__open ( int  flag)

Definition at line 111 of file probe-file.c.

Here is the call graph for this function:

◆ probe_file__open_both()

int probe_file__open_both ( int *  kfd,
int *  ufd,
int  flag 
)

Definition at line 125 of file probe-file.c.

Here is the call graph for this function:

◆ probe_type_is_available()

bool probe_type_is_available ( enum probe_type  type)

Definition at line 1053 of file probe-file.c.

Here is the call graph for this function:

◆ scan_ftrace_readme()

static bool scan_ftrace_readme ( enum ftrace_readme  type)
static

Definition at line 1014 of file probe-file.c.

Here is the call graph for this function:

◆ streql()

static bool streql ( const char *  a,
const char *  b 
)
static

Definition at line 589 of file probe-file.c.

Variable Documentation

◆ avail

bool avail

Definition at line 1006 of file probe-file.c.

◆ ftrace_readme_table

struct { ... } ftrace_readme_table[]
Initial value:
= {
#define DEFINE_TYPE(idx, pat)
DEFINE_TYPE(FTRACE_README_PROBE_TYPE_X, "*type: * x8/16/32/64,*"),
DEFINE_TYPE(FTRACE_README_KRETPROBE_OFFSET, "*place (kretprobe): *"),
}
#define DEFINE_TYPE(idx, pat)

◆ pattern

const char* pattern

Definition at line 1005 of file probe-file.c.