All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jiri Olsa <jolsa@redhat.com>
To: Andi Kleen <andi@firstfloor.org>
Cc: acme@kernel.org, namhyung@kernel.org, eranian@google.com,
	linux-kernel@vger.kernel.org, mingo@kernel.org,
	sukadev@linux.vnet.ibm.com, Andi Kleen <ak@linux.intel.com>
Subject: Re: [PATCH 1/3] perf, tools: Add override support for event list CPUID
Date: Mon, 1 Jun 2015 12:29:44 +0200	[thread overview]
Message-ID: <20150601102944.GC19893@krava.redhat.com> (raw)
In-Reply-To: <1433088696-15491-2-git-send-email-andi@firstfloor.org>

On Sun, May 31, 2015 at 09:11:34AM -0700, Andi Kleen wrote:
> 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 

.. within a current architecture (x86, powerpc) ..

> 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 578a537..5c30f89 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;

I tried and it's hard to actually say you're looking on another
CPU events. Could we advertise the CPUID in perf list? Or at least
some pr_debug print.

thanks,
jirka

  reply	other threads:[~2015-06-01 10:30 UTC|newest]

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

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=20150601102944.GC19893@krava.redhat.com \
    --to=jolsa@redhat.com \
    --cc=acme@kernel.org \
    --cc=ak@linux.intel.com \
    --cc=andi@firstfloor.org \
    --cc=eranian@google.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=namhyung@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.