aboutsummaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorIngo Molnar <mingo@elte.hu>2011-04-26 21:55:40 -0400
committerIngo Molnar <mingo@elte.hu>2011-04-26 14:04:55 -0400
commitb908debd4eef91471016138569f7a9e292be682e (patch)
treedad9b16b552416cfaf12a2654a35a6639ae82e46 /tools
parentd58f4c82fed69fdd4a79fa54fe17fd14d98c27aa (diff)
perf tools: Accept case-insensitive symbolic event variants
We currently fail on something like '-e CPU-migrations', with: invalid or unsupported event: 'CPU-migrations' While 'CPU-migrations' is how we actually print out the event in the default perf stat output: Performance counter stats for 'true': 0.202204 task-clock-msecs # 0.282 CPUs 0 context-switches # 0.000 M/sec 0 CPU-migrations # 0.000 M/sec So change the matching to be case-insensitive. Acked-by: Peter Zijlstra <a.p.zijlstra@chello.nl> Acked-by: Arnaldo Carvalho de Melo <acme@redhat.com> Cc: Frederic Weisbecker <fweisbec@gmail.com> Link: http://lkml.kernel.org/n/tip-omcm3edjjtx83a4kh2e244se@git.kernel.org Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'tools')
-rw-r--r--tools/perf/util/parse-events.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/tools/perf/util/parse-events.c b/tools/perf/util/parse-events.c
index 1869e4c646db..8e54bdb553c3 100644
--- a/tools/perf/util/parse-events.c
+++ b/tools/perf/util/parse-events.c
@@ -649,13 +649,15 @@ static int check_events(const char *str, unsigned int i)
649 int n; 649 int n;
650 650
651 n = strlen(event_symbols[i].symbol); 651 n = strlen(event_symbols[i].symbol);
652 if (!strncmp(str, event_symbols[i].symbol, n)) 652 if (!strncasecmp(str, event_symbols[i].symbol, n))
653 return n; 653 return n;
654 654
655 n = strlen(event_symbols[i].alias); 655 n = strlen(event_symbols[i].alias);
656 if (n) 656 if (n) {
657 if (!strncmp(str, event_symbols[i].alias, n)) 657 if (!strncasecmp(str, event_symbols[i].alias, n))
658 return n; 658 return n;
659 }
660
659 return 0; 661 return 0;
660} 662}
661 663