diff options
author | Arnaldo Carvalho de Melo <acme@redhat.com> | 2018-08-07 15:19:05 -0400 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2018-08-08 14:55:58 -0400 |
commit | 78e890ea8683f7d570f911637b23b23d27be4aed (patch) | |
tree | 06e74fa399e98744f89cc77ea1b41151726ca541 /tools/perf/builtin-trace.c | |
parent | e0b6d2ef329098bd9780ec00a75db3b11922031a (diff) |
perf bpf: Make bpf__setup_output_event() return the bpf-output event
We're calling it to setup that event, and we'll need it later to decide
if the bpf-output event we're handling is the one setup for a specific
purpose, return it using ERR_PTR, etc.
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Wang Nan <wangnan0@huawei.com>
Link: https://lkml.kernel.org/n/tip-zhachv7il2n1lopt9aonwhu7@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/builtin-trace.c')
-rw-r--r-- | tools/perf/builtin-trace.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/tools/perf/builtin-trace.c b/tools/perf/builtin-trace.c index 9b4e24217c46..43a699cfcadf 100644 --- a/tools/perf/builtin-trace.c +++ b/tools/perf/builtin-trace.c | |||
@@ -3216,8 +3216,9 @@ int cmd_trace(int argc, const char **argv) | |||
3216 | }; | 3216 | }; |
3217 | bool __maybe_unused max_stack_user_set = true; | 3217 | bool __maybe_unused max_stack_user_set = true; |
3218 | bool mmap_pages_user_set = true; | 3218 | bool mmap_pages_user_set = true; |
3219 | struct perf_evsel *evsel; | ||
3219 | const char * const trace_subcommands[] = { "record", NULL }; | 3220 | const char * const trace_subcommands[] = { "record", NULL }; |
3220 | int err; | 3221 | int err = -1; |
3221 | char bf[BUFSIZ]; | 3222 | char bf[BUFSIZ]; |
3222 | 3223 | ||
3223 | signal(SIGSEGV, sighandler_dump_stack); | 3224 | signal(SIGSEGV, sighandler_dump_stack); |
@@ -3240,9 +3241,9 @@ int cmd_trace(int argc, const char **argv) | |||
3240 | "cgroup monitoring only available in system-wide mode"); | 3241 | "cgroup monitoring only available in system-wide mode"); |
3241 | } | 3242 | } |
3242 | 3243 | ||
3243 | err = bpf__setup_output_event(trace.evlist, "__augmented_syscalls__"); | 3244 | evsel = bpf__setup_output_event(trace.evlist, "__augmented_syscalls__"); |
3244 | if (err) { | 3245 | if (IS_ERR(evsel)) { |
3245 | bpf__strerror_setup_output_event(trace.evlist, err, bf, sizeof(bf)); | 3246 | bpf__strerror_setup_output_event(trace.evlist, PTR_ERR(evsel), bf, sizeof(bf)); |
3246 | pr_err("ERROR: Setup trace syscalls enter failed: %s\n", bf); | 3247 | pr_err("ERROR: Setup trace syscalls enter failed: %s\n", bf); |
3247 | goto out; | 3248 | goto out; |
3248 | } | 3249 | } |