lkml.org 
[lkml]   [2015]   [May]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 2/2] perf, tools: Add override support for event list CPUID
Date
From: Andi Kleen <ak@linux.intel.com>

Add a PERF_CPUID variable to override the CPUID of the current CPU.
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>
---
tools/perf/util/pmu.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/tools/perf/util/pmu.c b/tools/perf/util/pmu.c
index ba50300..5500126 100644
--- a/tools/perf/util/pmu.c
+++ b/tools/perf/util/pmu.c
@@ -474,7 +474,9 @@ static int pmu_add_cpu_aliases(void *data)
struct pmu_event *pe;
char *cpuid;

- cpuid = get_cpuid_str();
+ cpuid = getenv("PERF_CPUID");
+ if (!cpuid)
+ cpuid = get_cpuid_str();
if (!cpuid)
return 0;

--
2.1.0


\
 
 \ /
  Last update: 2015-05-28 20:01    [W:0.028 / U:1.900 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site