mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jiri Olsa <jolsa@kernel.org>
To: Arnaldo Carvalho de Melo <acme@kernel.org>
Cc: lkml <linux-kernel@vger.kernel.org>,
	David Ahern <dsahern@gmail.com>, Ingo Molnar <mingo@kernel.org>,
	Namhyung Kim <namhyung@kernel.org>,
	Peter Zijlstra <a.p.zijlstra@chello.nl>,
	Andreas Hollmann <hollmann@in.tum.de>,
	Milian Wolff <milian.wolff@kdab.com>
Subject: [PATCH 3/3] perf script: Process event update events
Date: Thu,  7 Apr 2016 09:11:13 +0200	[thread overview]
Message-ID: <1460013073-18444-3-git-send-email-jolsa@kernel.org> (raw)
In-Reply-To: <1460013073-18444-1-git-send-email-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

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@in.tum.de>
Link: http://lkml.kernel.org/n/tip-5tyy9xeoiyg1nvy32tkjrlv1@git.kernel.org
Signed-off-by: Jiri Olsa <jolsa@kernel.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

  parent reply	other threads:[~2016-04-07  7:11 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-07  7:11 [PATCH 1/3] perf tools: Introduce trim function Jiri Olsa
2016-04-07  7:11 ` [PATCH 2/3] perf tools: Add dedicated unwind addr_space member into thread struct Jiri Olsa
2016-04-13  7:17   ` [tip:perf/core] " tip-bot for Jiri Olsa
2016-04-07  7:11 ` Jiri Olsa [this message]
2016-04-13  7:17   ` [tip:perf/core] perf script: Process event update events tip-bot for Jiri Olsa
2016-04-07 13:50 ` [PATCH 1/3] perf tools: Introduce trim function Arnaldo Carvalho de Melo
2016-04-07 14:03   ` Jiri Olsa
2016-04-07 15:45     ` Milian Wolff
2016-04-13  7:16 ` [tip:perf/core] " tip-bot for Jiri Olsa

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1460013073-18444-3-git-send-email-jolsa@kernel.org \
    --to=jolsa@kernel.org \
    --cc=a.p.zijlstra@chello.nl \
    --cc=acme@kernel.org \
    --cc=dsahern@gmail.com \
    --cc=hollmann@in.tum.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=milian.wolff@kdab.com \
    --cc=mingo@kernel.org \
    --cc=namhyung@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome