lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Wed, 8 Dec 2021 12:50:24 +0000
From:   John Garry <john.garry@...wei.com>
To:     Ian Rogers <irogers@...gle.com>, Andi Kleen <ak@...ux.intel.com>,
        "Jiri Olsa" <jolsa@...hat.com>, Namhyung Kim <namhyung@...nel.org>,
        Kajol Jain <kjain@...ux.ibm.com>,
        "Paul A . Clarke" <pc@...ibm.com>,
        "Arnaldo Carvalho de Melo" <acme@...nel.org>,
        Riccardo Mancini <rickyman7@...il.com>,
        Kan Liang <kan.liang@...ux.intel.com>,
        Peter Zijlstra <peterz@...radead.org>,
        "Ingo Molnar" <mingo@...hat.com>,
        Mark Rutland <mark.rutland@....com>,
        "Alexander Shishkin" <alexander.shishkin@...ux.intel.com>,
        <linux-perf-users@...r.kernel.org>, <linux-kernel@...r.kernel.org>,
        "Vineet Singh" <vineet.singh@...el.com>,
        James Clark <james.clark@....com>,
        "Mathieu Poirier" <mathieu.poirier@...aro.org>,
        Suzuki K Poulose <suzuki.poulose@....com>,
        Mike Leach <mike.leach@...aro.org>,
        Leo Yan <leo.yan@...aro.org>, <coresight@...ts.linaro.org>,
        <linux-arm-kernel@...ts.infradead.org>
CC:     <eranian@...gle.com>
Subject: Re: [PATCH 02/22] perf stat: Add aggr creators that are passed a cpu.

On 08/12/2021 02:45, Ian Rogers wrote:
> The cpu_map and index can get confused. Add variants of the cpu_map__get
> routines that are passed a cpu. Make the existing cpu_map__get routines
> use the new functions with a view to remove them when no longer used.
> 
> Signed-off-by: Ian Rogers<irogers@...gle.com>
> ---
>   tools/perf/util/cpumap.c | 79 +++++++++++++++++++++++-----------------
>   tools/perf/util/cpumap.h |  6 ++-
>   2 files changed, 51 insertions(+), 34 deletions(-)
> 
> diff --git a/tools/perf/util/cpumap.c b/tools/perf/util/cpumap.c
> index 87d3eca9b872..49fba2c53822 100644
> --- a/tools/perf/util/cpumap.c
> +++ b/tools/perf/util/cpumap.c
> @@ -128,21 +128,23 @@ int cpu_map__get_socket_id(int cpu)
>   	return ret ?: value;
>   }
>   
> -struct aggr_cpu_id cpu_map__get_socket(struct perf_cpu_map *map, int idx,
> -					void *data __maybe_unused)
> +struct aggr_cpu_id cpu_map__get_socket_aggr_by_cpu(int cpu, void *data __maybe_unused)
>   {
> -	int cpu;
>   	struct aggr_cpu_id id = cpu_map__empty_aggr_cpu_id();
>   
> -	if (idx > map->nr)
> -		return id;
> -
> -	cpu = map->map[idx];
> -
>   	id.socket = cpu_map__get_socket_id(cpu);
>   	return id;
>   }
>   
> +struct aggr_cpu_id cpu_map__get_socket(struct perf_cpu_map *map, int idx,

This is code added in this patch - so is "idx" a cpu map index? that's 
what the commit message implies.

regardless of this - you add code here and then remove it later in the 
series. Can you arrange the series such that any code added in the 
series is not removed (later in that series)? That's a general practice 
we adhere to.

Thanks,
John

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ