public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: tip-bot for Andrei Vagin <tipbot@zytor.com>
To: linux-tip-commits@vger.kernel.org
Cc: jolsa@redhat.com, linux-kernel@vger.kernel.org,
	avagin@openvz.org, tglx@linutronix.de, acme@redhat.com,
	mingo@kernel.org, hpa@zytor.com, namhyung@kernel.org,
	alexander.shishkin@linux.intel.com, peterz@infradead.org,
	vvs@virtuozzo.com
Subject: [tip:perf/core] perf trace: Fix an exit code of trace__symbols_init
Date: Sat, 18 Nov 2017 00:25:57 -0800	[thread overview]
Message-ID: <tip-cbd5c1787bab4643e5959522275b46de94eba5ac@git.kernel.org> (raw)
In-Reply-To: <20171108002246.8924-2-avagin@openvz.org>

Commit-ID:  cbd5c1787bab4643e5959522275b46de94eba5ac
Gitweb:     https://git.kernel.org/tip/cbd5c1787bab4643e5959522275b46de94eba5ac
Author:     Andrei Vagin <avagin@openvz.org>
AuthorDate: Tue, 7 Nov 2017 16:22:46 -0800
Committer:  Arnaldo Carvalho de Melo <acme@redhat.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@openvz.org>
Reviewed-by: Jiri 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.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.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();
 

  reply	other threads:[~2017-11-18  8:28 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-08  0:22 [PATCH 1/2] perf/trace: call machine__exit() at exiting Andrei Vagin
2017-11-08  0:22 ` [PATCH 2/2] perf/trace: fix an exit code of trace__symbols_init Andrei Vagin
2017-11-18  8:25   ` tip-bot for Andrei Vagin [this message]
2017-11-29  6:28   ` [tip:perf/core] perf trace: Fix " tip-bot for Andrei Vagin
2017-11-08 10:39 ` [PATCH 1/2] perf/trace: call machine__exit() at exiting Jiri Olsa
2017-11-08 13:33   ` Arnaldo Carvalho de Melo
2017-11-11  8:13 ` [tip:perf/urgent] perf trace: Call machine__exit() at exit tip-bot for Andrei Vagin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=tip-cbd5c1787bab4643e5959522275b46de94eba5ac@git.kernel.org \
    --to=tipbot@zytor.com \
    --cc=acme@redhat.com \
    --cc=alexander.shishkin@linux.intel.com \
    --cc=avagin@openvz.org \
    --cc=hpa@zytor.com \
    --cc=jolsa@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tip-commits@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=namhyung@kernel.org \
    --cc=peterz@infradead.org \
    --cc=tglx@linutronix.de \
    --cc=vvs@virtuozzo.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox