* [PATCH] perf, tools: Make alias matching case-insensitive
@ 2015-08-28 21:43 Andi Kleen
2015-08-31 18:54 ` Sukadev Bhattiprolu
0 siblings, 1 reply; 2+ messages in thread
From: Andi Kleen @ 2015-08-28 21:43 UTC (permalink / raw)
To: sukadev; +Cc: acme, linux-kernel, Andi Kleen
From: Andi Kleen <ak@linux.intel.com>
Make alias matching the events parser case-insensitive. This is useful
with the JSON events. perf uses lower case events, but the CPU manuals
generally use upper case event names. The JSON files use lower
case by default too. But if we search case insensitively then
users can cut-n-paste the upper case event names.
So the following works:
% perf stat -e BR_INST_EXEC.TAKEN_INDIRECT_NEAR_CALL true
Performance counter stats for 'true':
305 BR_INST_EXEC.TAKEN_INDIRECT_NEAR_CALL
0.000492799 seconds time elapsed
Signed-off-by: Andi Kleen <ak@linux.intel.com>
---
tools/perf/util/parse-events.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/perf/util/parse-events.c b/tools/perf/util/parse-events.c
index e14ceb6..2347840 100644
--- a/tools/perf/util/parse-events.c
+++ b/tools/perf/util/parse-events.c
@@ -981,7 +981,7 @@ comp_pmu(const void *p1, const void *p2)
struct perf_pmu_event_symbol *pmu1 = (struct perf_pmu_event_symbol *) p1;
struct perf_pmu_event_symbol *pmu2 = (struct perf_pmu_event_symbol *) p2;
- return strcmp(pmu1->symbol, pmu2->symbol);
+ return strcasecmp(pmu1->symbol, pmu2->symbol);
}
static void perf_pmu__parse_cleanup(void)
--
2.4.3
^ permalink raw reply [flat|nested] 2+ messages in thread* Re: [PATCH] perf, tools: Make alias matching case-insensitive
2015-08-28 21:43 [PATCH] perf, tools: Make alias matching case-insensitive Andi Kleen
@ 2015-08-31 18:54 ` Sukadev Bhattiprolu
0 siblings, 0 replies; 2+ messages in thread
From: Sukadev Bhattiprolu @ 2015-08-31 18:54 UTC (permalink / raw)
To: Andi Kleen; +Cc: acme, linux-kernel, Andi Kleen
Andi Kleen [andi@firstfloor.org] wrote:
| From: Andi Kleen <ak@linux.intel.com>
|
| Make alias matching the events parser case-insensitive. This is useful
| with the JSON events. perf uses lower case events, but the CPU manuals
| generally use upper case event names. The JSON files use lower
| case by default too. But if we search case insensitively then
| users can cut-n-paste the upper case event names.
|
| So the following works:
|
| % perf stat -e BR_INST_EXEC.TAKEN_INDIRECT_NEAR_CALL true
|
| Performance counter stats for 'true':
|
| 305 BR_INST_EXEC.TAKEN_INDIRECT_NEAR_CALL
|
| 0.000492799 seconds time elapsed
|
| Signed-off-by: Andi Kleen <ak@linux.intel.com>
Tested-by: Sukadev Bhattiprolu <sukadev@linux.vnet.ibm.com>
I have also pushed this to 'json-v16' branch of my github tree:
https://github.com/sukadev/linux
Sukadev
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2015-08-31 18:56 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-08-28 21:43 [PATCH] perf, tools: Make alias matching case-insensitive Andi Kleen
2015-08-31 18:54 ` Sukadev Bhattiprolu
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®