Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1373773
| From | Arnaldo Carvalho de Melo <acme@kernel.org> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | [PATCH 13/19] perf script: Process event update events |
| Date | 2016-04-07 23:10 +0200 |
| Message-ID | <rlplG-1qw-41@gated-at.bofh.it> (permalink) |
| References | <rlpbX-16R-3@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
From: Jiri Olsa <jolsa@kernel.org>
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
^C
#
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 'perf stat
report'.
Committer note:
After the patch:
# perf stat -a -I 1000 -e cycles,"cpu/config=0x6530160,name=krava/" record | perf script -s test.py
event krava cpu -1, thread -1, time 1000239179, val 1789051, ena 4000690920, run 4000690920
event krava cpu -1, thread -1, time 2000479061, val 2391338, ena 4000879596, run 4000879596
event krava cpu -1, thread -1, time 3000740802, val 1939121, ena 4000977209, run 4000977209
event krava cpu -1, thread -1, time 4001006730, val 2356115, ena 4001000489, run 4001000489
^C
#
Reported-by: Andreas Hollmann <hollmann@in.tum.de>
Signed-off-by: Jiri Olsa <jolsa@kernel.org>
Tested-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Milian Wolff <milian.wolff@kdab.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/r/1460013073-18444-3-git-send-email-jolsa@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
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.5.5
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[GIT PULL 00/19] perf/core improvements and fixes Arnaldo Carvalho de Melo <acme@kernel.org> - 2016-04-07 23:00 +0200
[PATCH 04/19] perf tools: Remove superfluous ARCH Makefile includes Arnaldo Carvalho de Melo <acme@kernel.org> - 2016-04-07 23:00 +0200
[PATCH 18/19] perf symbols: Record text offset in dso to calculate objdump address Arnaldo Carvalho de Melo <acme@kernel.org> - 2016-04-07 23:00 +0200
[PATCH 08/19] perf trace: Infrastructure to show COMM strings for syscalls returning PIDs Arnaldo Carvalho de Melo <acme@kernel.org> - 2016-04-07 23:00 +0200
[PATCH 01/19] perf config: Fix build with older toolchain. Arnaldo Carvalho de Melo <acme@kernel.org> - 2016-04-07 23:10 +0200
[PATCH 11/19] perf tools: Introduce trim function Arnaldo Carvalho de Melo <acme@kernel.org> - 2016-04-07 23:10 +0200
[PATCH 03/19] perf script perl: Do error checking on new backtrace routine Arnaldo Carvalho de Melo <acme@kernel.org> - 2016-04-07 23:10 +0200
[PATCH 06/19] perf trace: Beautify sched_setscheduler 'policy' argument Arnaldo Carvalho de Melo <acme@kernel.org> - 2016-04-07 23:10 +0200
[PATCH 07/19] perf trace: Beautify wait4/waitid 'options' argument Arnaldo Carvalho de Melo <acme@kernel.org> - 2016-04-07 23:10 +0200
[PATCH 09/19] perf trace: Beautify set_tid_address, getpid, getppid return values Arnaldo Carvalho de Melo <acme@kernel.org> - 2016-04-07 23:10 +0200
[PATCH 15/19] perf trace: Move syscall table id <-> name routines to separate class Arnaldo Carvalho de Melo <acme@kernel.org> - 2016-04-07 23:10 +0200
[PATCH 14/19] perf trace: Beautify mode_t arguments Arnaldo Carvalho de Melo <acme@kernel.org> - 2016-04-07 23:10 +0200
[PATCH 12/19] perf tools: Add dedicated unwind addr_space member into thread struct Arnaldo Carvalho de Melo <acme@kernel.org> - 2016-04-07 23:10 +0200
[PATCH 13/19] perf script: Process event update events Arnaldo Carvalho de Melo <acme@kernel.org> - 2016-04-07 23:10 +0200
[PATCH 16/19] perf tools: Allow generating per-arch syscall table arrays Arnaldo Carvalho de Melo <acme@kernel.org> - 2016-04-07 23:10 +0200
[PATCH 05/19] perf list: Document event specifications better Arnaldo Carvalho de Melo <acme@kernel.org> - 2016-04-07 23:10 +0200
[PATCH 02/19] perf probe: Check if dwarf_getlocations() is available Arnaldo Carvalho de Melo <acme@kernel.org> - 2016-04-07 23:10 +0200
[PATCH 10/19] perf trace: Beautify pid_t arguments Arnaldo Carvalho de Melo <acme@kernel.org> - 2016-04-07 23:10 +0200
Re: [GIT PULL 00/19] perf/core improvements and fixes Arnaldo Carvalho de Melo <acme@kernel.org> - 2016-04-08 15:20 +0200
Re: [GIT PULL 00/19] perf/core improvements and fixes Ingo Molnar <mingo@kernel.org> - 2016-04-13 09:00 +0200
csiph-web