1 /* SPDX-License-Identifier: GPL-2.0 */
5 #include "probe-event.h"
10 /* Cache of probe definitions */
11 struct probe_cache_entry {
12 struct list_head node;
14 struct perf_probe_event pev;
16 struct strlist *tevlist;
21 struct list_head entries;
33 #define PF_FL_UPROBE 1
35 #define for_each_probe_cache_entry(entry, pcache) \
36 list_for_each_entry(entry, &pcache->entries, node)
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);
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);
52 int probe_cache_entry__get_event(struct probe_cache_entry *entry,
53 struct probe_trace_event **tevs);
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);
67 struct probe_cache_entry *probe_cache__find_by_name(struct probe_cache *pcache,
68 const char *group, const char *event);
69 int probe_cache__show_all_caches(struct strfilter *filter);
70 bool probe_type_is_available(enum probe_type type);
71 bool kretprobe_offset_is_supported(void);
72 bool uprobe_ref_ctr_is_supported(void);
73 bool user_access_is_supported(void);
74 bool multiprobe_event_is_supported(void);
75 bool immediate_value_is_supported(void);
76 #else /* ! HAVE_LIBELF_SUPPORT */
77 static inline struct probe_cache *probe_cache__new(const char *tgt __maybe_unused, struct nsinfo *nsi __maybe_unused)
81 #define probe_cache__delete(pcache) do {} while (0)