perf bpf: Rename bpf__foreach_tev() to bpf__foreach_event()
Following commit will allow BPF script attach to tracepoints. bpf__foreach_tev() will iterate over all events, not only kprobes. Rename it to bpf__foreach_event(). Since only group and event are used by caller, there's no need to pass full 'struct probe_trace_event' to bpf_prog_iter_callback_t. Pass only these two strings. After this patch bpf_prog_iter_callback_t natually support tracepoints. Signed-off-by: Wang Nan <wangnan0@huawei.com> Cc: Alexei Starovoitov <ast@kernel.org> Cc: Jiri Olsa <jolsa@kernel.org> Cc: Zefan Li <lizefan@huawei.com> Cc: pi3orama@163.com Link: http://lkml.kernel.org/r/1468406646-21642-5-git-send-email-wangnan0@huawei.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
This commit is contained in:

committed by
Arnaldo Carvalho de Melo

parent
8c619d6a33
commit
cd102d70fe
@@ -693,9 +693,9 @@ int bpf__load(struct bpf_object *obj)
|
||||
return 0;
|
||||
}
|
||||
|
||||
int bpf__foreach_tev(struct bpf_object *obj,
|
||||
bpf_prog_iter_callback_t func,
|
||||
void *arg)
|
||||
int bpf__foreach_event(struct bpf_object *obj,
|
||||
bpf_prog_iter_callback_t func,
|
||||
void *arg)
|
||||
{
|
||||
struct bpf_program *prog;
|
||||
int err;
|
||||
@@ -728,7 +728,7 @@ int bpf__foreach_tev(struct bpf_object *obj,
|
||||
return fd;
|
||||
}
|
||||
|
||||
err = (*func)(tev, fd, arg);
|
||||
err = (*func)(tev->group, tev->event, fd, arg);
|
||||
if (err) {
|
||||
pr_debug("bpf: call back failed, stop iterate\n");
|
||||
return err;
|
||||
|
Reference in New Issue
Block a user