linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] perf: fix multi-event parsing bug
@ 2011-05-17 13:36 Stephane Eranian
  2011-05-18  5:21 ` [tip:perf/core] perf: Fix " tip-bot for Stephane Eranian
  0 siblings, 1 reply; 2+ messages in thread
From: Stephane Eranian @ 2011-05-17 13:36 UTC (permalink / raw)
  To: linux-kernel; +Cc: mingo, acme, peterz, fweisbec


This patch fixes an issue with event parsing.
The following commit appears to have broken the
ability to specify a comma separated list of events:

   commit ceb53fbf6dbb1df26d38379a262c6981fe73dd36
   Author: Ingo Molnar <mingo@elte.hu>
   Date:   Wed Apr 27 04:06:33 2011 +0200

       perf stat: Fail more clearly when an invalid modifier is specified

This patch fixes this while preserving the desired effect:

$ perf stat -e instructions:u,instructions:k ls /dev/null
/dev/null

 Performance counter stats for 'ls /dev/null':

            365956 instructions:u           #    0.00  insns per cycle        
            731806 instructions:k           #    0.00  insns per cycle        

        0.001108862  seconds time elapsed

$ perf stat -e task-clock-msecs true
invalid event modifier: '-msecs'
Run 'perf list' for a list of valid events and modifiers

Signed-off-by: Stephane Eranian <eranian@google.com>

---
diff --git a/tools/perf/util/parse-events.c b/tools/perf/util/parse-events.c
index ffa493a..41982c3 100644
--- a/tools/perf/util/parse-events.c
+++ b/tools/perf/util/parse-events.c
@@ -734,6 +734,9 @@ parse_event_modifier(const char **strp, struct perf_event_attr *attr)
 	if (!*str)
 		return 0;
 
+	if (*str == ',')
+		return 0;
+
 	if (*str++ != ':')
 		return -1;
 

^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2011-05-18  5:22 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-05-17 13:36 [PATCH] perf: fix multi-event parsing bug Stephane Eranian
2011-05-18  5:21 ` [tip:perf/core] perf: Fix " tip-bot for Stephane Eranian

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).