Linux Perf
probe-file.h
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0 */
2 #ifndef __PROBE_FILE_H
3 #define __PROBE_FILE_H
4 
5 #include "probe-event.h"
6 
7 struct strlist;
8 struct strfilter;
9 
10 /* Cache of probe definitions */
12  struct list_head node;
13  bool sdt;
15  char *spev;
16  struct strlist *tevlist;
17 };
18 
19 struct probe_cache {
20  int fd;
21  struct list_head entries;
22 };
23 
24 enum probe_type {
31 };
32 
33 #define PF_FL_UPROBE 1
34 #define PF_FL_RW 2
35 #define for_each_probe_cache_entry(entry, pcache) \
36  list_for_each_entry(entry, &pcache->entries, node)
37 
38 /* probe-file.c depends on libelf */
39 #ifdef HAVE_LIBELF_SUPPORT
40 int open_trace_file(const char *trace_file, bool readwrite);
41 int probe_file__open(int flag);
42 int probe_file__open_both(int *kfd, int *ufd, int flag);
43 struct strlist *probe_file__get_namelist(int fd);
44 struct strlist *probe_file__get_rawlist(int fd);
45 int probe_file__add_event(int fd, struct probe_trace_event *tev);
46 
47 int probe_file__del_events(int fd, struct strfilter *filter);
48 int probe_file__get_events(int fd, struct strfilter *filter,
49  struct strlist *plist);
50 int probe_file__del_strlist(int fd, struct strlist *namelist);
51 
53  struct probe_trace_event **tevs);
54 
55 struct probe_cache *probe_cache__new(const char *target, struct nsinfo *nsi);
56 int probe_cache__add_entry(struct probe_cache *pcache,
57  struct perf_probe_event *pev,
58  struct probe_trace_event *tevs, int ntevs);
59 int probe_cache__scan_sdt(struct probe_cache *pcache, const char *pathname);
60 int probe_cache__commit(struct probe_cache *pcache);
61 void probe_cache__purge(struct probe_cache *pcache);
62 void probe_cache__delete(struct probe_cache *pcache);
63 int probe_cache__filter_purge(struct probe_cache *pcache,
64  struct strfilter *filter);
65 struct probe_cache_entry *probe_cache__find(struct probe_cache *pcache,
66  struct perf_probe_event *pev);
68  const char *group, const char *event);
70 bool probe_type_is_available(enum probe_type type);
72 #else /* ! HAVE_LIBELF_SUPPORT */
73 static inline struct probe_cache *probe_cache__new(const char *tgt __maybe_unused, struct nsinfo *nsi __maybe_unused)
74 {
75  return NULL;
76 }
77 #define probe_cache__delete(pcache) do {} while (0)
78 #endif
79 #endif
#define probe_cache__delete(pcache)
Definition: probe-file.h:77
int probe_cache__add_entry(struct probe_cache *pcache, struct perf_probe_event *pev, struct probe_trace_event *tevs, int ntevs)
Definition: probe-file.c:651
struct probe_cache_entry * probe_cache__find(struct probe_cache *pcache, struct perf_probe_event *pev)
Definition: probe-file.c:601
Definition: mem2node.c:7
int probe_file__open_both(int *kfd, int *ufd, int flag)
Definition: probe-file.c:125
int probe_file__add_event(int fd, struct probe_trace_event *tev)
Definition: probe-file.c:235
int probe_file__del_strlist(int fd, struct strlist *namelist)
Definition: probe-file.c:321
struct strlist * probe_file__get_namelist(int fd)
Definition: probe-file.c:230
Definition: probe-file.h:11
struct nsinfo * nsi
Definition: builtin-probe.c:61
bool kretprobe_offset_is_supported(void)
Definition: probe-file.c:1063
bool probe_type_is_available(enum probe_type type)
Definition: probe-file.c:1053
static struct probe_cache * probe_cache__new(const char *tgt __maybe_unused, struct nsinfo *nsi __maybe_unused)
Definition: probe-file.h:73
probe_type
Definition: probe-file.h:24
struct strlist * tevlist
Definition: probe-file.h:16
int probe_file__del_events(int fd, struct strfilter *filter)
Definition: probe-file.c:334
static int entry(u64 ip, struct unwind_info *ui)
Definition: unwind-libdw.c:71
void probe_cache__purge(struct probe_cache *pcache)
Definition: probe-file.c:541
bool sdt
Definition: probe-file.h:13
#define event
static bool group
Definition: builtin-stat.c:160
int open_trace_file(const char *trace_file, bool readwrite)
Definition: probe-file.c:82
char * spev
Definition: probe-file.h:15
struct strfilter * filter
Definition: builtin-probe.c:60
struct probe_cache_entry * probe_cache__find_by_name(struct probe_cache *pcache, const char *group, const char *event)
Definition: probe-file.c:634
int probe_cache__commit(struct probe_cache *pcache)
Definition: probe-file.c:902
int probe_cache__filter_purge(struct probe_cache *pcache, struct strfilter *filter)
Definition: probe-file.c:938
struct perf_probe_event pev
Definition: probe-file.h:14
int probe_cache_entry__get_event(struct probe_cache_entry *entry, struct probe_trace_event **tevs)
Definition: probe-file.c:389
int probe_cache__show_all_caches(struct strfilter *filter)
Definition: probe-file.c:966
int probe_file__open(int flag)
Definition: probe-file.c:111
int probe_file__get_events(int fd, struct strfilter *filter, struct strlist *plist)
Definition: probe-file.c:293
Definition: target.h:8
struct strlist * probe_file__get_rawlist(int fd)
Definition: probe-file.c:141