Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1344831
| From | Arnaldo Carvalho de Melo <acme@kernel.org> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | [PATCH 18/19] perf trace: Call bpf__apply_obj_config in 'perf trace' |
| Date | 2016-02-27 00:30 +0100 |
| Message-ID | <r6zZD-2as-13@gated-at.bofh.it> (permalink) |
| References | <r6zPY-26L-3@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
From: Wang Nan <wangnan0@huawei.com>
Without this patch BPF map configuration is not applied.
Command like this:
# ./perf trace --ev bpf-output/no-inherit,name=evt/ \
--ev ./test_bpf_trace.c/map:channel.event=evt/ \
usleep 100000
Load BPF files without error, but since map:channel.event=evt is not
applied, bpf-output event not work.
This patch allows 'perf trace' load and run BPF scripts.
Signed-off-by: Wang Nan <wangnan0@huawei.com>
Cc: Alexei Starovoitov <ast@kernel.org>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Li Zefan <lizefan@huawei.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: pi3orama@163.com
Link: http://lkml.kernel.org/r/1456479154-136027-7-git-send-email-wangnan0@huawei.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
tools/perf/builtin-trace.c | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/tools/perf/builtin-trace.c b/tools/perf/builtin-trace.c
index 20916dd77aac..254149ca5e1b 100644
--- a/tools/perf/builtin-trace.c
+++ b/tools/perf/builtin-trace.c
@@ -33,6 +33,7 @@
#include "util/stat.h"
#include "trace-event.h"
#include "util/parse-events.h"
+#include "util/bpf-loader.h"
#include <libaudit.h>
#include <stdlib.h>
@@ -2586,6 +2587,16 @@ static int trace__run(struct trace *trace, int argc, const char **argv)
if (err < 0)
goto out_error_open;
+ err = bpf__apply_obj_config();
+ if (err) {
+ char errbuf[BUFSIZ];
+
+ bpf__strerror_apply_obj_config(err, errbuf, sizeof(errbuf));
+ pr_err("ERROR: Apply config to BPF failed: %s\n",
+ errbuf);
+ goto out_error_open;
+ }
+
/*
* Better not use !target__has_task() here because we need to cover the
* case where no threads were specified in the command line, but a
--
2.5.0
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[GIT PULL 00/19] perf/core improvements and fixes Arnaldo Carvalho de Melo <acme@kernel.org> - 2016-02-27 00:20 +0100 [PATCH 04/19] perf script: Exception handling when the print fmt is empty Arnaldo Carvalho de Melo <acme@kernel.org> - 2016-02-27 00:20 +0100 [PATCH 13/19] perf report: Left align dynamic entries in hierarchy Arnaldo Carvalho de Melo <acme@kernel.org> - 2016-02-27 00:20 +0100 [PATCH 11/19] perf hists: Fix comparing of dynamic entries Arnaldo Carvalho de Melo <acme@kernel.org> - 2016-02-27 00:20 +0100 [PATCH 15/19] perf report: Update column width of dynamic entries Arnaldo Carvalho de Melo <acme@kernel.org> - 2016-02-27 00:30 +0100 [PATCH 10/19] perf report: Show message for percent limit on gtk Arnaldo Carvalho de Melo <acme@kernel.org> - 2016-02-27 00:30 +0100 [PATCH 06/19] perf hists: Add more helper functions for the hierarchy mode Arnaldo Carvalho de Melo <acme@kernel.org> - 2016-02-27 00:30 +0100 [PATCH 18/19] perf trace: Call bpf__apply_obj_config in 'perf trace' Arnaldo Carvalho de Melo <acme@kernel.org> - 2016-02-27 00:30 +0100 [PATCH 14/19] perf hists: Fix dynamic entry display in hierarchy Arnaldo Carvalho de Melo <acme@kernel.org> - 2016-02-27 00:30 +0100 [PATCH 03/19] perf tools: Fix parsing of pmu events with empty list of modifiers Arnaldo Carvalho de Melo <acme@kernel.org> - 2016-02-27 00:30 +0100 [PATCH 16/19] perf config: Bring perf_default_config to the very beginning at main() Arnaldo Carvalho de Melo <acme@kernel.org> - 2016-02-27 00:30 +0100 [PATCH 08/19] perf hists browser: Cleanup hist_browser__update_percent_limit() Arnaldo Carvalho de Melo <acme@kernel.org> - 2016-02-27 00:30 +0100 [PATCH 01/19] perf tools: Use asprintf() for simple string formatting/allocation Arnaldo Carvalho de Melo <acme@kernel.org> - 2016-02-27 00:30 +0100 [PATCH 02/19] perf jvmti: improve error message in Makefile Arnaldo Carvalho de Melo <acme@kernel.org> - 2016-02-27 00:30 +0100 [PATCH 19/19] perf trace: Print content of bpf-output event Arnaldo Carvalho de Melo <acme@kernel.org> - 2016-02-27 00:30 +0100 [PATCH 09/19] perf hists browser: Show message for percent limit Arnaldo Carvalho de Melo <acme@kernel.org> - 2016-02-27 00:30 +0100 [PATCH 05/19] perf script: Remove duplicated code and needless script_spec__findnew() Arnaldo Carvalho de Melo <acme@kernel.org> - 2016-02-27 00:30 +0100 [PATCH 07/19] perf report: Show message for percent limit on stdio Arnaldo Carvalho de Melo <acme@kernel.org> - 2016-02-27 00:30 +0100 Re: [GIT PULL 00/19] perf/core improvements and fixes Ingo Molnar <mingo@kernel.org> - 2016-02-27 10:40 +0100
csiph-web