Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1030530AbcDMHSH (ORCPT ); Wed, 13 Apr 2016 03:18:07 -0400 Received: from terminus.zytor.com ([198.137.202.10]:50536 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1030505AbcDMHSE (ORCPT ); Wed, 13 Apr 2016 03:18:04 -0400 Date: Wed, 13 Apr 2016 00:17:44 -0700 From: tip-bot for Jiri Olsa Message-ID: Cc: hollmann@in.tum.de, mingo@kernel.org, jolsa@kernel.org, milian.wolff@kdab.com, tglx@linutronix.de, dsahern@gmail.com, acme@redhat.com, hpa@zytor.com, linux-kernel@vger.kernel.org, a.p.zijlstra@chello.nl, namhyung@kernel.org Reply-To: hollmann@in.tum.de, mingo@kernel.org, tglx@linutronix.de, jolsa@kernel.org, milian.wolff@kdab.com, linux-kernel@vger.kernel.org, acme@redhat.com, hpa@zytor.com, dsahern@gmail.com, namhyung@kernel.org, a.p.zijlstra@chello.nl In-Reply-To: <1460013073-18444-3-git-send-email-jolsa@kernel.org> References: <1460013073-18444-3-git-send-email-jolsa@kernel.org> To: linux-tip-commits@vger.kernel.org Subject: [tip:perf/core] perf script: Process event update events Git-Commit-ID: 91daee306a51ca7b4d3ca7fdcf7472b0ed2c80c1 X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2614 Lines: 65 Commit-ID: 91daee306a51ca7b4d3ca7fdcf7472b0ed2c80c1 Gitweb: http://git.kernel.org/tip/91daee306a51ca7b4d3ca7fdcf7472b0ed2c80c1 Author: Jiri Olsa AuthorDate: Thu, 7 Apr 2016 09:11:13 +0200 Committer: Arnaldo Carvalho de Melo CommitDate: Fri, 8 Apr 2016 09:58:12 -0300 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 ^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 Signed-off-by: Jiri Olsa Tested-by: Arnaldo Carvalho de Melo Cc: David Ahern Cc: Milian Wolff Cc: Namhyung Kim Cc: Peter Zijlstra Link: http://lkml.kernel.org/r/1460013073-18444-3-git-send-email-jolsa@kernel.org Signed-off-by: Arnaldo Carvalho de Melo --- 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 3770c3d..59009aa 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,