[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <tip-0973ad97c187e06aece61f685b9c3b2d93290a73@git.kernel.org>
Date: Tue, 11 Apr 2017 22:41:03 -0700
From: tip-bot for David Carrillo-Cisneros <tipbot@...or.com>
To: linux-tip-commits@...r.kernel.org
Cc: linux-kernel@...r.kernel.org, davidcc@...gle.com,
peterz@...radead.org, hekuang@...wei.com, tglx@...utronix.de,
eranian@...gle.com, wangnan0@...wei.com, sque@...omium.org,
hpa@...or.com, acme@...hat.com, jolsa@...nel.org,
ak@...ux.intel.com, mhiramat@...nel.org, mingo@...nel.org,
pjt@...gle.com, alexander.shishkin@...ux.intel.com
Subject: [tip:perf/core] perf session: Don't rely on evlist in pipe mode
Commit-ID: 0973ad97c187e06aece61f685b9c3b2d93290a73
Gitweb: http://git.kernel.org/tip/0973ad97c187e06aece61f685b9c3b2d93290a73
Author: David Carrillo-Cisneros <davidcc@...gle.com>
AuthorDate: Mon, 10 Apr 2017 13:14:30 -0700
Committer: Arnaldo Carvalho de Melo <acme@...hat.com>
CommitDate: Tue, 11 Apr 2017 16:22:20 -0300
perf session: Don't rely on evlist in pipe mode
Session sets a number parameters that rely on evlist. These parameters
are not used in pipe-mode and should not be set, since evlist is
unavailable. Fix that.
Signed-off-by: David Carrillo-Cisneros <davidcc@...gle.com>
Acked-by: Jiri Olsa <jolsa@...nel.org>
Cc: Alexander Shishkin <alexander.shishkin@...ux.intel.com>
Cc: Andi Kleen <ak@...ux.intel.com>
Cc: He Kuang <hekuang@...wei.com>
Cc: Masami Hiramatsu <mhiramat@...nel.org>
Cc: Paul Turner <pjt@...gle.com>
Cc: Peter Zijlstra <peterz@...radead.org>
Cc: Simon Que <sque@...omium.org>
Cc: Stephane Eranian <eranian@...gle.com>
Cc: Wang Nan <wangnan0@...wei.com>
Link: http://lkml.kernel.org/r/20170410201432.24807-6-davidcc@google.com
[ Check if file != NULL in perf_session__new(), like when used by builtin-top.c ]
Signed-off-by: Arnaldo Carvalho de Melo <acme@...hat.com>
---
tools/perf/util/session.c | 16 +++++++++++++---
1 file changed, 13 insertions(+), 3 deletions(-)
diff --git a/tools/perf/util/session.c b/tools/perf/util/session.c
index a25302b..7b740a7 100644
--- a/tools/perf/util/session.c
+++ b/tools/perf/util/session.c
@@ -140,8 +140,14 @@ struct perf_session *perf_session__new(struct perf_data_file *file,
if (perf_session__open(session) < 0)
goto out_close;
- perf_session__set_id_hdr_size(session);
- perf_session__set_comm_exec(session);
+ /*
+ * set session attributes that are present in perf.data
+ * but not in pipe-mode.
+ */
+ if (!file->is_pipe) {
+ perf_session__set_id_hdr_size(session);
+ perf_session__set_comm_exec(session);
+ }
}
} else {
session->machines.host.env = &perf_env;
@@ -156,7 +162,11 @@ struct perf_session *perf_session__new(struct perf_data_file *file,
pr_warning("Cannot read kernel map\n");
}
- if (tool && tool->ordering_requires_timestamps &&
+ /*
+ * In pipe-mode, evlist is empty until PERF_RECORD_HEADER_ATTR is
+ * processed, so perf_evlist__sample_id_all is not meaningful here.
+ */
+ if ((!file || !file->is_pipe) && tool && tool->ordering_requires_timestamps &&
tool->ordered_events && !perf_evlist__sample_id_all(session->evlist)) {
dump_printf("WARNING: No sample_id_all support, falling back to unordered processing\n");
tool->ordered_events = false;
Powered by blists - more mailing lists