Commit cbd5c178 authored by Andrei Vagin's avatar Andrei Vagin Committed by Arnaldo Carvalho de Melo

perf trace: Fix an exit code of trace__symbols_init

Currently if trace_event__register_resolver() fails, we return -errno,
but we can't be sure that errno isn't zero in this case.
Signed-off-by: default avatarAndrei Vagin <avagin@openvz.org>
Reviewed-by: default avatarJiri Olsa <jolsa@redhat.com>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Vasily Averin <vvs@virtuozzo.com>
Link: http://lkml.kernel.org/r/20171108002246.8924-2-avagin@openvz.orgSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
parent d0565132
...@@ -1152,12 +1152,14 @@ static int trace__symbols_init(struct trace *trace, struct perf_evlist *evlist) ...@@ -1152,12 +1152,14 @@ static int trace__symbols_init(struct trace *trace, struct perf_evlist *evlist)
if (trace->host == NULL) if (trace->host == NULL)
return -ENOMEM; return -ENOMEM;
if (trace_event__register_resolver(trace->host, trace__machine__resolve_kernel_addr) < 0) err = trace_event__register_resolver(trace->host, trace__machine__resolve_kernel_addr);
return -errno; if (err < 0)
goto out;
err = __machine__synthesize_threads(trace->host, &trace->tool, &trace->opts.target, err = __machine__synthesize_threads(trace->host, &trace->tool, &trace->opts.target,
evlist->threads, trace__tool_process, false, evlist->threads, trace__tool_process, false,
trace->opts.proc_map_timeout, 1); trace->opts.proc_map_timeout, 1);
out:
if (err) if (err)
symbol__exit(); symbol__exit();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment