Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1620704

[PATCH 1/7] perf inject: don't proceed if perf_session__process_event fails

From David Carrillo-Cisneros <davidcc@google.com>
Newsgroups linux.kernel
Subject [PATCH 1/7] perf inject: don't proceed if perf_session__process_event fails
Date 2017-04-10 22:20 +0200
Message-ID <tuNX4-5AE-33@gated-at.bofh.it> (permalink)
References <tuNX3-5AE-3@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


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>
---
 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 42dff0b1375a..65e1c026a2f0 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)
-- 
2.12.2.715.g7642488e1d-goog

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH 0/7] perf tool: pipe-mode fixes David Carrillo-Cisneros <davidcc@google.com> - 2017-04-10 22:20 +0200
  [PATCH 1/7] perf inject: don't proceed if perf_session__process_event fails David Carrillo-Cisneros <davidcc@google.com> - 2017-04-10 22:20 +0200
    [tip:perf/core] perf inject: Don't proceed if  perf_session__process_event() fails tip-bot for David Carrillo-Cisneros <tipbot@zytor.com> - 2017-04-12 07:50 +0200
  [PATCH 2/7] perf inject: copy events when reordering events in pipe mode David Carrillo-Cisneros <davidcc@google.com> - 2017-04-10 22:20 +0200
    Re: [PATCH 2/7] perf inject: copy events when reordering events in  pipe mode Jiri Olsa <jolsa@redhat.com> - 2017-04-11 11:50 +0200
      Re: [PATCH 2/7] perf inject: copy events when reordering events in  pipe mode David Carrillo-Cisneros <davidcc@google.com> - 2017-04-11 21:00 +0200
    [tip:perf/core] perf inject: Copy events when reordering events in  pipe mode tip-bot for David Carrillo-Cisneros <tipbot@zytor.com> - 2017-04-12 07:50 +0200
  [PATCH 4/7] perf annotate: process attr and build_id records David Carrillo-Cisneros <davidcc@google.com> - 2017-04-10 22:20 +0200
    [tip:perf/core] perf annotate: Process attr and build_id records tip-bot for David Carrillo-Cisneros <tipbot@zytor.com> - 2017-04-12 07:50 +0200
  [PATCH 6/7] perf tool: protect empty evlists David Carrillo-Cisneros <davidcc@google.com> - 2017-04-10 22:20 +0200
    Re: [PATCH 6/7] perf tool: protect empty evlists Arnaldo Carvalho de Melo <acme@kernel.org> - 2017-04-11 20:20 +0200
      Re: [PATCH 6/7] perf tool: protect empty evlists David Carrillo-Cisneros <davidcc@google.com> - 2017-04-11 20:40 +0200
  [PATCH 7/7] perf tool: do not print missing features in pipe-mode David Carrillo-Cisneros <davidcc@google.com> - 2017-04-10 22:20 +0200
    [tip:perf/core] perf tools: Do not print missing features in  pipe-mode tip-bot for David Carrillo-Cisneros <tipbot@zytor.com> - 2017-04-12 07:50 +0200
  [PATCH 5/7] perf session: don't rely on evlist in pipe mode David Carrillo-Cisneros <davidcc@google.com> - 2017-04-10 22:20 +0200
    Re: [PATCH 5/7] perf session: don't rely on evlist in pipe mode Arnaldo Carvalho de Melo <acme@kernel.org> - 2017-04-11 20:50 +0200
      Re: [PATCH 5/7] perf session: don't rely on evlist in pipe mode David Carrillo-Cisneros <davidcc@google.com> - 2017-04-11 21:00 +0200
        Re: [PATCH 5/7] perf session: don't rely on evlist in pipe mode Arnaldo Carvalho de Melo <acme@kernel.org> - 2017-04-11 21:50 +0200
    Re: [PATCH 5/7] perf session: don't rely on evlist in pipe mode Arnaldo Carvalho de Melo <acme@kernel.org> - 2017-04-11 20:50 +0200
    Re: [PATCH 5/7] perf session: don't rely on evlist in pipe mode Arnaldo Carvalho de Melo <acme@kernel.org> - 2017-04-11 20:50 +0200
    [tip:perf/core] perf session: Don't rely on evlist in pipe mode tip-bot for David Carrillo-Cisneros <tipbot@zytor.com> - 2017-04-12 07:50 +0200
  Re: [PATCH 0/7] perf tool: pipe-mode fixes Jiri Olsa <jolsa@redhat.com> - 2017-04-11 11:50 +0200
    Re: [PATCH 0/7] perf tool: pipe-mode fixes Arnaldo Carvalho de Melo <acme@kernel.org> - 2017-04-11 20:20 +0200

csiph-web