Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1721190

Re: [PATCH v2 14/19] perf, tools, stat: Support JSON metrics in perf stat

From Jiri Olsa <jolsa@redhat.com>
Newsgroups linux.kernel
Subject Re: [PATCH v2 14/19] perf, tools, stat: Support JSON metrics in perf stat
Date 2017-08-28 10:20 +0200
Message-ID <ujnr6-3du-47@gated-at.bofh.it> (permalink)
References <udrxo-1lO-5@gated-at.bofh.it> <udrxp-1lO-39@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Fri, Aug 11, 2017 at 04:26:29PM -0700, Andi Kleen wrote:

SNIP

> diff --git a/tools/perf/util/pmu.c b/tools/perf/util/pmu.c
> index ac16a9db1fb5..4f049285e3ac 100644
> --- a/tools/perf/util/pmu.c
> +++ b/tools/perf/util/pmu.c
> @@ -516,16 +516,8 @@ char * __weak get_cpuid_str(void)
>  	return NULL;
>  }
>  
> -/*
> - * From the pmu_events_map, find the table of PMU events that corresponds
> - * to the current running CPU. Then, add all PMU events from that table
> - * as aliases.
> - */
> -static void pmu_add_cpu_aliases(struct list_head *head, const char *name)
> +char *perf_pmu__getcpuid(void)

please add this function in separate patch

>  {
> -	int i;
> -	struct pmu_events_map *map;
> -	struct pmu_event *pe;
>  	char *cpuid;

also you could make cpuid static and not rerun the check
every time it's called

jirka

>  	static bool printed;
>  
> @@ -535,12 +527,26 @@ static void pmu_add_cpu_aliases(struct list_head *head, const char *name)
>  	if (!cpuid)
>  		cpuid = get_cpuid_str();
>  	if (!cpuid)
> -		return;
> +		return NULL;
>  
>  	if (!printed) {
>  		pr_debug("Using CPUID %s\n", cpuid);
>  		printed = true;
>  	}
> +	return cpuid;
> +}

Back to linux.kernel | Previous | NextNext in thread | Find similar | Unroll thread


Thread

Re: [PATCH v2 14/19] perf, tools, stat: Support JSON metrics in perf  stat Jiri Olsa <jolsa@redhat.com> - 2017-08-28 10:20 +0200
  Re: [PATCH v2 14/19] perf, tools, stat: Support JSON metrics in perf  stat Jiri Olsa <jolsa@redhat.com> - 2017-08-28 11:20 +0200

csiph-web