public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Andi Kleen <andi@firstfloor.org>
To: sukadev@linux.vnet.ibm.com
Cc: jolsa@redhat.com, mingo@kernel.org, acme@kernel.org,
	linux-kernel@vger.kernel.org, Andi Kleen <ak@linux.intel.com>
Subject: [PATCH 1/3] perf, tools: Add override support for event list CPUID
Date: Thu, 28 May 2015 13:20:00 -0700	[thread overview]
Message-ID: <1432844402-11649-2-git-send-email-andi@firstfloor.org> (raw)
In-Reply-To: <1432844402-11649-1-git-send-email-andi@firstfloor.org>

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.

v2: Fix double free in earlier version.
Signed-off-by: Andi Kleen <ak@linux.intel.com>
---
 tools/perf/util/pmu.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/tools/perf/util/pmu.c b/tools/perf/util/pmu.c
index ba50300..59e0f4e 100644
--- a/tools/perf/util/pmu.c
+++ b/tools/perf/util/pmu.c
@@ -474,7 +474,11 @@ 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 = strdup(cpuid);
+	if (!cpuid)
+		cpuid = get_cpuid_str();
 	if (!cpuid)
 		return 0;
 
-- 
2.1.0


  reply	other threads:[~2015-05-28 20:20 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-28 20:19 perf: Additional improvements for json event lists Andi Kleen
2015-05-28 20:20 ` Andi Kleen [this message]
2015-05-28 20:20 ` [PATCH 2/3] perf, tools: Support long descriptions with perf list -v Andi Kleen
2015-05-28 20:20 ` [PATCH 3/3] perf, tools: Fix jevents dependencies Andi Kleen
2015-05-28 20:57   ` Sukadev Bhattiprolu
2015-05-28 21:15     ` Andi Kleen
  -- strict thread matches above, loose matches on Subject: below --
2015-05-31 16:11 More updates for event lists in perf list Andi Kleen
2015-05-31 16:11 ` [PATCH 1/3] perf, tools: Add override support for event list CPUID Andi Kleen
2015-06-01 10:29   ` Jiri Olsa

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1432844402-11649-2-git-send-email-andi@firstfloor.org \
    --to=andi@firstfloor.org \
    --cc=acme@kernel.org \
    --cc=ak@linux.intel.com \
    --cc=jolsa@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=sukadev@linux.vnet.ibm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox