int probe_file__open(int flag) { int fd; if (flag & PF_FL_UPROBE) fd = open_uprobe_events(flag & PF_FL_RW); else fd = open_kprobe_events(flag & PF_FL_RW); if (fd < 0) print_open_warning(fd, flag & PF_FL_UPROBE); return fd; }
int probe_file__open_both(int *kfd, int *ufd, int flag) { if (!kfd || !ufd) return -EINVAL; *kfd = open_kprobe_events(flag & PF_FL_RW); *ufd = open_uprobe_events(flag & PF_FL_RW); if (*kfd < 0 && *ufd < 0) { print_both_open_warning(*kfd, *ufd); return *kfd; } return 0; }
/* List up current perf-probe events */ void show_perf_probe_events(void) { int fd; struct probe_point pp; struct strlist *rawlist; struct str_node *ent; setup_pager(); memset(&pp, 0, sizeof(pp)); fd = open_kprobe_events(O_RDONLY, 0); rawlist = get_trace_kprobe_event_rawlist(fd); close(fd); strlist__for_each(ent, rawlist) { parse_trace_kprobe_event(ent->s, &pp); /* Synthesize only event probe point */ synthesize_perf_probe_point(&pp); /* Show an event */ show_perf_probe_event(pp.event, pp.probes[0], &pp); clear_probe_point(&pp); }