mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: tip-bot for David Carrillo-Cisneros <tipbot@zytor.com>
To: linux-tip-commits@vger.kernel.org
Cc: mingo@kernel.org, avagin@openvz.org,
	alexander.shishkin@linux.intel.com, hekuang@huawei.com,
	tglx@linutronix.de, wangnan0@huawei.com, ak@linux.intel.com,
	sque@chromium.org, pjt@google.com, jolsa@kernel.org,
	davidcc@google.com, peterz@infradead.org, mhiramat@kernel.org,
	linux-kernel@vger.kernel.org, acme@redhat.com,
	eranian@google.com, hpa@zytor.com
Subject: [tip:perf/core] perf inject: Don't proceed if perf_session__process_event() fails
Date: Tue, 11 Apr 2017 22:39:03 -0700	[thread overview]
Message-ID: <tip-bb8d521f77f3e68a713456b7fb1e99f52ff3342c@git.kernel.org> (raw)
In-Reply-To: <20170410201432.24807-2-davidcc@google.com>

Commit-ID:  bb8d521f77f3e68a713456b7fb1e99f52ff3342c
Gitweb:     http://git.kernel.org/tip/bb8d521f77f3e68a713456b7fb1e99f52ff3342c
Author:     David Carrillo-Cisneros <davidcc@google.com>
AuthorDate: Mon, 10 Apr 2017 13:14:26 -0700
Committer:  Arnaldo Carvalho de Melo <acme@redhat.com>
CommitDate: Tue, 11 Apr 2017 15:23:40 -0300

perf inject: Don't proceed if perf_session__process_event() fails

All paths following perf_session__process_event() in __cmd_inject() are
useless if __cmd_inject() is to fail, some depend on a correct
session->evlist.

First commit to add code that depends on session->evlist without checking
error was commmit e558a5bd8b ("perf inject: Work with files"). It has
grown since then.

Change __cmd_inject() to fail immediately after
perf_session__process_event() fails.

Signed-off-by: David Carrillo-Cisneros <davidcc@google.com>
Acked-by: Jiri Olsa <jolsa@kernel.org>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Andi Kleen <ak@linux.intel.com>
Cc: Andrew Vagin <avagin@openvz.org>
Cc: He Kuang <hekuang@huawei.com>
Cc: Masami Hiramatsu <mhiramat@kernel.org>
Cc: Paul Turner <pjt@google.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Simon Que <sque@chromium.org>
Cc: Stephane Eranian <eranian@google.com>
Cc: Wang Nan <wangnan0@huawei.com>
Fixes: e558a5bd8b74 ("perf inject: Work with files")
Link: http://lkml.kernel.org/r/20170410201432.24807-2-davidcc@google.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/builtin-inject.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/tools/perf/builtin-inject.c b/tools/perf/builtin-inject.c
index 42dff0b..65e1c02 100644
--- a/tools/perf/builtin-inject.c
+++ b/tools/perf/builtin-inject.c
@@ -694,6 +694,8 @@ static int __cmd_inject(struct perf_inject *inject)
 		lseek(fd, output_data_offset, SEEK_SET);
 
 	ret = perf_session__process_events(session);
+	if (ret)
+		return ret;
 
 	if (!file_out->is_pipe) {
 		if (inject->build_ids)

  reply	other threads:[~2017-04-12  5:43 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-10 20:14 [PATCH 0/7] perf tool: pipe-mode fixes David Carrillo-Cisneros
2017-04-10 20:14 ` [PATCH 1/7] perf inject: don't proceed if perf_session__process_event fails David Carrillo-Cisneros
2017-04-12  5:39   ` tip-bot for David Carrillo-Cisneros [this message]
2017-04-10 20:14 ` [PATCH 2/7] perf inject: copy events when reordering events in pipe mode David Carrillo-Cisneros
2017-04-11  9:40   ` Jiri Olsa
2017-04-11 18:56     ` David Carrillo-Cisneros
2017-04-12  5:39   ` [tip:perf/core] perf inject: Copy " tip-bot for David Carrillo-Cisneros
2017-04-10 20:14 ` [PATCH 3/7] perf tool: describe pipe mode in perf.data-file-fomat.txt David Carrillo-Cisneros
2017-04-12  5:40   ` [tip:perf/core] perf tools: Describe " tip-bot for David Carrillo-Cisneros
2017-04-10 20:14 ` [PATCH 4/7] perf annotate: process attr and build_id records David Carrillo-Cisneros
2017-04-12  5:40   ` [tip:perf/core] perf annotate: Process " tip-bot for David Carrillo-Cisneros
2017-04-10 20:14 ` [PATCH 5/7] perf session: don't rely on evlist in pipe mode David Carrillo-Cisneros
2017-04-11 18:40   ` Arnaldo Carvalho de Melo
2017-04-11 18:40     ` Arnaldo Carvalho de Melo
2017-04-11 18:44       ` Arnaldo Carvalho de Melo
2017-04-11 18:59         ` David Carrillo-Cisneros
2017-04-11 19:44           ` Arnaldo Carvalho de Melo
2017-04-12  5:41   ` [tip:perf/core] perf session: Don't " tip-bot for David Carrillo-Cisneros
2017-04-10 20:14 ` [PATCH 6/7] perf tool: protect empty evlists David Carrillo-Cisneros
2017-04-11 18:12   ` Arnaldo Carvalho de Melo
2017-04-11 18:34     ` David Carrillo-Cisneros
2017-04-10 20:14 ` [PATCH 7/7] perf tool: do not print missing features in pipe-mode David Carrillo-Cisneros
2017-04-12  5:41   ` [tip:perf/core] perf tools: Do " tip-bot for David Carrillo-Cisneros
2017-04-11  9:49 ` [PATCH 0/7] perf tool: pipe-mode fixes Jiri Olsa
2017-04-11 18:17   ` Arnaldo Carvalho de Melo

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-bb8d521f77f3e68a713456b7fb1e99f52ff3342c@git.kernel.org \
    --to=tipbot@zytor.com \
    --cc=acme@redhat.com \
    --cc=ak@linux.intel.com \
    --cc=alexander.shishkin@linux.intel.com \
    --cc=avagin@openvz.org \
    --cc=davidcc@google.com \
    --cc=eranian@google.com \
    --cc=hekuang@huawei.com \
    --cc=hpa@zytor.com \
    --cc=jolsa@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tip-commits@vger.kernel.org \
    --cc=mhiramat@kernel.org \
    --cc=mingo@kernel.org \
    --cc=peterz@infradead.org \
    --cc=pjt@google.com \
    --cc=sque@chromium.org \
    --cc=tglx@linutronix.de \
    --cc=wangnan0@huawei.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

Powered by JetHome