[<prev] [next>] [day] [month] [year] [list]
Message-ID: <tip-27z7169pvfxgj8upic636syv@git.kernel.org>
Date: Fri, 1 May 2015 03:13:17 -0700
From: tip-bot for Arnaldo Carvalho de Melo <tipbot@...or.com>
To: linux-tip-commits@...r.kernel.org
Cc: mingo@...nel.org, acme@...hat.com, dzickus@...hat.com,
hpa@...or.com, jolsa@...hat.com, fweisbec@...il.com,
adrian.hunter@...el.com, tglx@...utronix.de, namhyung@...nel.org,
linux-kernel@...r.kernel.org, eranian@...gle.com,
dsahern@...il.com, bp@...e.de
Subject: [tip:perf/urgent] perf trace:
Enable events when doing system wide tracing and starting a workload
Commit-ID: cb24d01d217497fb32467de22d773655f47d3896
Gitweb: http://git.kernel.org/tip/cb24d01d217497fb32467de22d773655f47d3896
Author: Arnaldo Carvalho de Melo <acme@...hat.com>
AuthorDate: Wed, 22 Apr 2015 10:04:23 -0300
Committer: Arnaldo Carvalho de Melo <acme@...hat.com>
CommitDate: Thu, 23 Apr 2015 17:07:59 -0300
perf trace: Enable events when doing system wide tracing and starting a workload
commit f7aa222ff397
Author: Arnaldo Carvalho de Melo <acme@...hat.com>
Date: Tue Feb 3 13:25:39 2015 -0300
perf trace: No need to enable evsels for workload started from perf
The assumption was that whenever a workload is specified, the
attr.enable_on_exec evsel flag would be set, but that is not happening
when perf_record_opts.system_wide is set, for instance
That resulted in both perf_evlist__enable() and attr.enable_on_exec
being not called/set, which made the events to remain disabled while the
workload runs, producing no output.
Fix it, by calling perf_evlist__enable() in the 'trace' tool
when forking and not targetting a workload started from trace
v2: Test against !target__none(), as suggested by Namhyung Kim, that is
what is used in perf_evsel__config() when deciding if the
attr.enable_on_exec flag to be set. More work is needed to cover other
cases such as opts->initial_delay.
Acked-by: Jiri Olsa <jolsa@...hat.com>
Cc: Adrian Hunter <adrian.hunter@...el.com>
Cc: Borislav Petkov <bp@...e.de>
Cc: David Ahern <dsahern@...il.com>
Cc: Don Zickus <dzickus@...hat.com>
Cc: Frederic Weisbecker <fweisbec@...il.com>
Cc: Namhyung Kim <namhyung@...nel.org>
Cc: Stephane Eranian <eranian@...gle.com>
Link: http://lkml.kernel.org/n/tip-27z7169pvfxgj8upic636syv@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@...hat.com>
---
tools/perf/builtin-trace.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/tools/perf/builtin-trace.c b/tools/perf/builtin-trace.c
index e124741..8842218 100644
--- a/tools/perf/builtin-trace.c
+++ b/tools/perf/builtin-trace.c
@@ -2241,10 +2241,11 @@ static int trace__run(struct trace *trace, int argc, const char **argv)
if (err < 0)
goto out_error_mmap;
+ if (!target__none(&trace->opts.target))
+ perf_evlist__enable(evlist);
+
if (forks)
perf_evlist__start_workload(evlist);
- else
- perf_evlist__enable(evlist);
trace->multiple_threads = evlist->threads->map[0] == -1 ||
evlist->threads->nr > 1 ||
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists