diff options
author | Arnaldo Carvalho de Melo <acme@redhat.com> | 2018-08-07 16:19:05 -0300 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2018-08-08 15:55:58 -0300 |
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) }; bool __maybe_unused max_stack_user_set = true; bool mmap_pages_user_set = true; + struct perf_evsel *evsel; const char * const trace_subcommands[] = { "record", NULL }; - int err; + int err = -1; char bf[BUFSIZ]; signal(SIGSEGV, sighandler_dump_stack); @@ -3240,9 +3241,9 @@ int cmd_trace(int argc, const char **argv) "cgroup monitoring only available in system-wide mode"); } - err = bpf__setup_output_event(trace.evlist, "__augmented_syscalls__"); - if (err) { - bpf__strerror_setup_output_event(trace.evlist, err, bf, sizeof(bf)); + evsel = bpf__setup_output_event(trace.evlist, "__augmented_syscalls__"); + if (IS_ERR(evsel)) { + bpf__strerror_setup_output_event(trace.evlist, PTR_ERR(evsel), bf, sizeof(bf)); pr_err("ERROR: Setup trace syscalls enter failed: %s\n", bf); goto out; } |