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]
Message-ID: <CAM9d7cgdDOhRb9bXar5KgCS52FLfRwyj+CXBtx3J5zSa95vXfA@mail.gmail.com>
Date:   Tue, 28 Dec 2021 16:36:57 -0800
From:   Namhyung Kim <namhyung@...nel.org>
To:     Ian Rogers <irogers@...gle.com>
Cc:     Andi Kleen <ak@...ux.intel.com>, Jiri Olsa <jolsa@...hat.com>,
        John Garry <john.garry@...wei.com>,
        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 <linux-perf-users@...r.kernel.org>,
        linux-kernel <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,
        Stephane Eranian <eranian@...gle.com>
Subject: Re: [PATCH v2 30/48] perf stat: Rename aggr_data cpu to imply it's an index

On Wed, Dec 22, 2021 at 11:47 PM Ian Rogers <irogers@...gle.com> wrote:
>
> Trying to make cpu maps less error prone.
>
> Signed-off-by: Ian Rogers <irogers@...gle.com>
> ---
>  tools/perf/util/python.c       |  2 +-
>  tools/perf/util/stat-display.c | 10 +++++-----
>  2 files changed, 6 insertions(+), 6 deletions(-)
>
> diff --git a/tools/perf/util/python.c b/tools/perf/util/python.c
> index 563a9ba8954f..4b510a1f27d4 100644
> --- a/tools/perf/util/python.c
> +++ b/tools/perf/util/python.c
> @@ -1057,7 +1057,7 @@ static struct mmap *get_md(struct evlist *evlist, int cpu)
>         for (i = 0; i < evlist->core.nr_mmaps; i++) {
>                 struct mmap *md = &evlist->mmap[i];
>
> -               if (md->core.cpu == cpu)
> +               if (md->core.cpu_map_idx == cpu)

It doesn't seem to belong to this change..

Thanks,
Namhyung


>                         return md;
>         }
>
> diff --git a/tools/perf/util/stat-display.c b/tools/perf/util/stat-display.c
> index 821511ba22cc..4f93591aaa76 100644
> --- a/tools/perf/util/stat-display.c
> +++ b/tools/perf/util/stat-display.c
> @@ -626,7 +626,7 @@ struct aggr_data {
>         u64 ena, run, val;
>         struct aggr_cpu_id id;
>         int nr;
> -       int cpu;
> +       int cpu_map_idx;
>  };
>
>  static void aggr_cb(struct perf_stat_config *config,
> @@ -878,9 +878,9 @@ static void counter_cb(struct perf_stat_config *config __maybe_unused,
>  {
>         struct aggr_data *ad = data;
>
> -       ad->val += perf_counts(counter->counts, ad->cpu, 0)->val;
> -       ad->ena += perf_counts(counter->counts, ad->cpu, 0)->ena;
> -       ad->run += perf_counts(counter->counts, ad->cpu, 0)->run;
> +       ad->val += perf_counts(counter->counts, ad->cpu_map_idx, 0)->val;
> +       ad->ena += perf_counts(counter->counts, ad->cpu_map_idx, 0)->ena;
> +       ad->run += perf_counts(counter->counts, ad->cpu_map_idx, 0)->run;
>  }
>
>  /*
> @@ -897,7 +897,7 @@ static void print_counter(struct perf_stat_config *config,
>         struct aggr_cpu_id id;
>
>         for (cpu = 0; cpu < evsel__nr_cpus(counter); cpu++) {
> -               struct aggr_data ad = { .cpu = cpu };
> +               struct aggr_data ad = { .cpu_map_idx = cpu };
>
>                 if (!collect_data(config, counter, counter_cb, &ad))
>                         return;
> --
> 2.34.1.307.g9b7440fafd-goog
>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ