]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
perf top: Synthesize BPF events for pre-existing loaded BPF programs
authorArnaldo Carvalho de Melo <acme@redhat.com>
Thu, 17 Jan 2019 16:15:20 +0000 (08:15 -0800)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Mon, 21 Jan 2019 20:38:56 +0000 (17:38 -0300)
So that we can resolve symbols and map names.

Cc: Alexei Starovoitov <ast@kernel.org>
Cc: Daniel Borkmann <daniel@iogearbox.net>
Cc: David Ahern <dsahern@gmail.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Song Liu <songliubraving@fb.com>
Cc: kernel-team@fb.com
Cc: netdev@vger.kernel.org
Link: http://lkml.kernel.org/r/20190117161521.1341602-9-songliubraving@fb.com
Signed-off-by: Song Liu <songliubraving@fb.com>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/perf/builtin-top.c

index f64e312db787a046e82f8440f14de70f7b92eed3..5a486d4de56e449e218ba89bbcf5eaf761b0c706 100644 (file)
@@ -22,6 +22,7 @@
 #include "perf.h"
 
 #include "util/annotate.h"
+#include "util/bpf-event.h"
 #include "util/config.h"
 #include "util/color.h"
 #include "util/drv_configs.h"
@@ -1215,6 +1216,12 @@ static int __cmd_top(struct perf_top *top)
 
        init_process_thread(top);
 
+       ret = perf_event__synthesize_bpf_events(&top->tool, perf_event__process,
+                                               &top->session->machines.host,
+                                               &top->record_opts);
+       if (ret < 0)
+               pr_warning("Couldn't synthesize bpf events.\n");
+
        machine__synthesize_threads(&top->session->machines.host, &opts->target,
                                    top->evlist->threads, false,
                                    top->nr_threads_synthesize);