]> git.ipfire.org Git - thirdparty/kernel/linux.git/blobdiff - tools/perf/util/bpf-event.c
perf bpf: Make synthesize_bpf_events() receive perf_session pointer instead of perf_tool
[thirdparty/kernel/linux.git] / tools / perf / util / bpf-event.c
index e0cbe7f8717035c1cb344a28d2d9105c67ff9c25..5237e8f119974b19693f8442cb29c2682dc5d65e 100644 (file)
@@ -10,6 +10,7 @@
 #include "debug.h"
 #include "symbol.h"
 #include "machine.h"
+#include "session.h"
 
 #define ptr_to_u64(ptr)    ((__u64)(unsigned long)(ptr))
 
@@ -42,7 +43,7 @@ int machine__process_bpf_event(struct machine *machine __maybe_unused,
  *   -1 for failures;
  *   -2 for lack of kernel support.
  */
-static int perf_event__synthesize_one_bpf_prog(struct perf_tool *tool,
+static int perf_event__synthesize_one_bpf_prog(struct perf_session *session,
                                               perf_event__handler_t process,
                                               struct machine *machine,
                                               int fd,
@@ -52,6 +53,7 @@ static int perf_event__synthesize_one_bpf_prog(struct perf_tool *tool,
        struct ksymbol_event *ksymbol_event = &event->ksymbol_event;
        struct bpf_event *bpf_event = &event->bpf_event;
        struct bpf_prog_info_linear *info_linear;
+       struct perf_tool *tool = session->tool;
        struct bpf_prog_info *info;
        struct btf *btf = NULL;
        bool has_btf = false;
@@ -175,7 +177,7 @@ out:
        return err ? -1 : 0;
 }
 
-int perf_event__synthesize_bpf_events(struct perf_tool *tool,
+int perf_event__synthesize_bpf_events(struct perf_session *session,
                                      perf_event__handler_t process,
                                      struct machine *machine,
                                      struct record_opts *opts)
@@ -209,7 +211,7 @@ int perf_event__synthesize_bpf_events(struct perf_tool *tool,
                        continue;
                }
 
-               err = perf_event__synthesize_one_bpf_prog(tool, process,
+               err = perf_event__synthesize_one_bpf_prog(session, process,
                                                          machine, fd,
                                                          event, opts);
                close(fd);