[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1460013073-18444-3-git-send-email-jolsa@kernel.org>
Date: Thu, 7 Apr 2016 09:11:13 +0200
From: Jiri Olsa <jolsa@...nel.org>
To: Arnaldo Carvalho de Melo <acme@...nel.org>
Cc: lkml <linux-kernel@...r.kernel.org>,
David Ahern <dsahern@...il.com>,
Ingo Molnar <mingo@...nel.org>,
Namhyung Kim <namhyung@...nel.org>,
Peter Zijlstra <a.p.zijlstra@...llo.nl>,
Andreas Hollmann <hollmann@...tum.de>,
Milian Wolff <milian.wolff@...b.com>
Subject: [PATCH 3/3] perf script: Process event update events
Andreas reported following command produces no output:
$ cat test.py
#!/usr/bin/env python
def stat__krava(cpu, thread, time, val, ena, run):
print "event %s cpu %d, thread %d, time %d, val %d, ena %d, run %d" % \
("krava", cpu, thread, time, val, ena, run)
$ perf stat -a -I 1000 -e cycles,"cpu/config=0x6530160,name=krava/" record | perf script -s test.py
The reason is that perf script does not process event update
events and will never get the event name update thus the
python callback is never called.
The fix is just to add already existing callback we use
in the perf stat report.
Reported-by: Andreas Hollmann <hollmann@...tum.de>
Link: http://lkml.kernel.org/n/tip-5tyy9xeoiyg1nvy32tkjrlv1@git.kernel.org
Signed-off-by: Jiri Olsa <jolsa@...nel.org>
---
tools/perf/builtin-script.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/tools/perf/builtin-script.c b/tools/perf/builtin-script.c
index 3770c3dffe5e..59009aa7e2ca 100644
--- a/tools/perf/builtin-script.c
+++ b/tools/perf/builtin-script.c
@@ -1961,6 +1961,7 @@ int cmd_script(int argc, const char **argv, const char *prefix __maybe_unused)
.exit = perf_event__process_exit,
.fork = perf_event__process_fork,
.attr = process_attr,
+ .event_update = perf_event__process_event_update,
.tracing_data = perf_event__process_tracing_data,
.build_id = perf_event__process_build_id,
.id_index = perf_event__process_id_index,
--
2.4.11
Powered by blists - more mailing lists