Commit fc06e2a5 authored by Andi Kleen's avatar Andi Kleen Committed by Arnaldo Carvalho de Melo

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: default avatarAndi Kleen <ak@linux.intel.com>
Signed-off-by: default avatarSukadev Bhattiprolu <sukadev@linux.vnet.ibm.com>
Acked-by: default avatarIngo Molnar <mingo@kernel.org>
Acked-by: default avatarJiri 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.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
parent 1c5f01fe
...@@ -501,10 +501,16 @@ static void pmu_add_cpu_aliases(struct list_head *head) ...@@ -501,10 +501,16 @@ static void pmu_add_cpu_aliases(struct list_head *head)
struct pmu_event *pe; struct pmu_event *pe;
char *cpuid; char *cpuid;
cpuid = getenv("PERF_CPUID");
if (cpuid)
cpuid = strdup(cpuid);
if (!cpuid)
cpuid = get_cpuid_str(); cpuid = get_cpuid_str();
if (!cpuid) if (!cpuid)
return; return;
pr_debug("Using CPUID %s\n", cpuid);
i = 0; i = 0;
while (1) { while (1) {
map = &pmu_events_map[i++]; map = &pmu_events_map[i++];
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment