[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <tip-cbd5c1787bab4643e5959522275b46de94eba5ac@git.kernel.org>
Date: Sat, 18 Nov 2017 00:25:57 -0800
From: tip-bot for Andrei Vagin <tipbot@...or.com>
To: linux-tip-commits@...r.kernel.org
Cc: jolsa@...hat.com, linux-kernel@...r.kernel.org, avagin@...nvz.org,
tglx@...utronix.de, acme@...hat.com, mingo@...nel.org,
hpa@...or.com, namhyung@...nel.org,
alexander.shishkin@...ux.intel.com, peterz@...radead.org,
vvs@...tuozzo.com
Subject: [tip:perf/core] perf trace: Fix an exit code of trace__symbols_init
Commit-ID: cbd5c1787bab4643e5959522275b46de94eba5ac
Gitweb: https://git.kernel.org/tip/cbd5c1787bab4643e5959522275b46de94eba5ac
Author: Andrei Vagin <avagin@...nvz.org>
AuthorDate: Tue, 7 Nov 2017 16:22:46 -0800
Committer: Arnaldo Carvalho de Melo <acme@...hat.com>
CommitDate: Thu, 16 Nov 2017 14:49:52 -0300
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: Andrei Vagin <avagin@...nvz.org>
Reviewed-by: Jiri Olsa <jolsa@...hat.com>
Cc: Alexander Shishkin <alexander.shishkin@...ux.intel.com>
Cc: Namhyung Kim <namhyung@...nel.org>
Cc: Peter Zijlstra <peterz@...radead.org>
Cc: Vasily Averin <vvs@...tuozzo.com>
Link: http://lkml.kernel.org/r/20171108002246.8924-2-avagin@openvz.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@...hat.com>
---
tools/perf/builtin-trace.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/tools/perf/builtin-trace.c b/tools/perf/builtin-trace.c
index f2757d3..84debdb 100644
--- a/tools/perf/builtin-trace.c
+++ b/tools/perf/builtin-trace.c
@@ -1152,12 +1152,14 @@ static int trace__symbols_init(struct trace *trace, struct perf_evlist *evlist)
if (trace->host == NULL)
return -ENOMEM;
- if (trace_event__register_resolver(trace->host, trace__machine__resolve_kernel_addr) < 0)
- return -errno;
+ err = trace_event__register_resolver(trace->host, trace__machine__resolve_kernel_addr);
+ if (err < 0)
+ goto out;
err = __machine__synthesize_threads(trace->host, &trace->tool, &trace->opts.target,
evlist->threads, trace__tool_process, false,
trace->opts.proc_map_timeout, 1);
+out:
if (err)
symbol__exit();
Powered by blists - more mailing lists