aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf
diff options
context:
space:
mode:
authorAndi Kleen <ak@linux.intel.com>2016-09-15 18:24:46 -0400
committerArnaldo Carvalho de Melo <acme@redhat.com>2016-10-03 20:35:46 -0400
commitfc06e2a5aad9fcf7efaabd7550ac31f648d2f2bc (patch)
treed7f58db003523fa4859e37e60aa8f61c5036992d /tools/perf
parent1c5f01fe8660fc48625a94a5ed10e4dbaea95d5f (diff)
perf pmu: Add override support for event list CPUID
Add a PERF_CPUID variable to override the CPUID of the current CPU (within the current architecture). This is useful for testing, so that all event lists can be tested on a single system. Signed-off-by: Andi Kleen <ak@linux.intel.com> Signed-off-by: Sukadev Bhattiprolu <sukadev@linux.vnet.ibm.com> Acked-by: Ingo Molnar <mingo@kernel.org> Acked-by: Jiri Olsa <jolsa@redhat.com> Cc: Madhavan Srinivasan <maddy@linux.vnet.ibm.com> Cc: Peter Zijlstra <peterz@infradead.org> Cc: linuxppc-dev@lists.ozlabs.org Link: http://lkml.kernel.org/r/1473978296-20712-10-git-send-email-sukadev@linux.vnet.ibm.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf')
-rw-r--r--tools/perf/util/pmu.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/tools/perf/util/pmu.c b/tools/perf/util/pmu.c
index 9dc3506d23fc..79242cf9bb79 100644
--- a/tools/perf/util/pmu.c
+++ b/tools/perf/util/pmu.c
@@ -501,10 +501,16 @@ static void pmu_add_cpu_aliases(struct list_head *head)
501 struct pmu_event *pe; 501 struct pmu_event *pe;
502 char *cpuid; 502 char *cpuid;
503 503
504 cpuid = get_cpuid_str(); 504 cpuid = getenv("PERF_CPUID");
505 if (cpuid)
506 cpuid = strdup(cpuid);
507 if (!cpuid)
508 cpuid = get_cpuid_str();
505 if (!cpuid) 509 if (!cpuid)
506 return; 510 return;
507 511
512 pr_debug("Using CPUID %s\n", cpuid);
513
508 i = 0; 514 i = 0;
509 while (1) { 515 while (1) {
510 map = &pmu_events_map[i++]; 516 map = &pmu_events_map[i++];