[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <tip-fc06e2a5aad9fcf7efaabd7550ac31f648d2f2bc@git.kernel.org>
Date: Tue, 4 Oct 2016 01:15:42 -0700
From: tip-bot for Andi Kleen <tipbot@...or.com>
To: linux-tip-commits@...r.kernel.org
Cc: ak@...ux.intel.com, linux-kernel@...r.kernel.org, jolsa@...hat.com,
peterz@...radead.org, mingo@...nel.org, acme@...hat.com,
maddy@...ux.vnet.ibm.com, sukadev@...ux.vnet.ibm.com,
tglx@...utronix.de, hpa@...or.com
Subject: [tip:perf/urgent] perf pmu: Add override support for event list
CPUID
Commit-ID: fc06e2a5aad9fcf7efaabd7550ac31f648d2f2bc
Gitweb: http://git.kernel.org/tip/fc06e2a5aad9fcf7efaabd7550ac31f648d2f2bc
Author: Andi Kleen <ak@...ux.intel.com>
AuthorDate: Thu, 15 Sep 2016 15:24:46 -0700
Committer: Arnaldo Carvalho de Melo <acme@...hat.com>
CommitDate: Mon, 3 Oct 2016 21:35:46 -0300
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@...ux.intel.com>
Signed-off-by: Sukadev Bhattiprolu <sukadev@...ux.vnet.ibm.com>
Acked-by: Ingo Molnar <mingo@...nel.org>
Acked-by: Jiri Olsa <jolsa@...hat.com>
Cc: Madhavan Srinivasan <maddy@...ux.vnet.ibm.com>
Cc: Peter Zijlstra <peterz@...radead.org>
Cc: linuxppc-dev@...ts.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@...hat.com>
---
tools/perf/util/pmu.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/tools/perf/util/pmu.c b/tools/perf/util/pmu.c
index 9dc3506..79242cf 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)
struct pmu_event *pe;
char *cpuid;
- cpuid = get_cpuid_str();
+ cpuid = getenv("PERF_CPUID");
+ if (cpuid)
+ cpuid = strdup(cpuid);
+ if (!cpuid)
+ cpuid = get_cpuid_str();
if (!cpuid)
return;
+ pr_debug("Using CPUID %s\n", cpuid);
+
i = 0;
while (1) {
map = &pmu_events_map[i++];
Powered by blists - more mailing lists