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:   Thu, 5 May 2022 16:27:50 -0700
From:   Ian Rogers <irogers@...gle.com>
To:     Adrian Hunter <adrian.hunter@...el.com>
Cc:     Arnaldo Carvalho de Melo <acme@...nel.org>,
        Jiri Olsa <jolsa@...hat.com>,
        Alexey Bayduraev <alexey.v.bayduraev@...ux.intel.com>,
        Namhyung Kim <namhyung@...nel.org>,
        Leo Yan <leo.yan@...aro.org>, linux-kernel@...r.kernel.org
Subject: Re: [PATCH V1 08/23] libperf evlist: Add evsel as a parameter to ->idx()

On Thu, May 5, 2022 at 9:57 AM Adrian Hunter <adrian.hunter@...el.com> wrote:
>
> Add evsel as a parameter to ->idx() in preparation for correctly
> determining whether an auxtrace mmap is needed.
>
> Signed-off-by: Adrian Hunter <adrian.hunter@...el.com>

Just to note that in the non-lib version of evsel there is a back link
to the evlist. If we ever had that in the lib version then there'd be
no need to pass the evsel and evlist.

Acked-by: Ian Rogers <irogers@...gle.com>

Thanks,
Ian

> ---
>  tools/lib/perf/evlist.c                  | 2 +-
>  tools/lib/perf/include/internal/evlist.h | 3 ++-
>  tools/perf/util/evlist.c                 | 1 +
>  3 files changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/tools/lib/perf/evlist.c b/tools/lib/perf/evlist.c
> index 673c267f900e..ad04da81c367 100644
> --- a/tools/lib/perf/evlist.c
> +++ b/tools/lib/perf/evlist.c
> @@ -475,7 +475,7 @@ mmap_per_evsel(struct perf_evlist *evlist, struct perf_evlist_mmap_ops *ops,
>                         refcount_set(&map->refcnt, 2);
>
>                         if (ops->idx)
> -                               ops->idx(evlist, mp, idx);
> +                               ops->idx(evlist, evsel, mp, idx);
>
>                         if (ops->mmap(map, mp, *output, evlist_cpu) < 0)
>                                 return -1;
> diff --git a/tools/lib/perf/include/internal/evlist.h b/tools/lib/perf/include/internal/evlist.h
> index 0d5c830431a7..6f89aec3e608 100644
> --- a/tools/lib/perf/include/internal/evlist.h
> +++ b/tools/lib/perf/include/internal/evlist.h
> @@ -38,7 +38,8 @@ struct perf_evlist {
>  };
>
>  typedef void
> -(*perf_evlist_mmap__cb_idx_t)(struct perf_evlist*, struct perf_mmap_param*, int);
> +(*perf_evlist_mmap__cb_idx_t)(struct perf_evlist*, struct perf_evsel*,
> +                             struct perf_mmap_param*, int);
>  typedef struct perf_mmap*
>  (*perf_evlist_mmap__cb_get_t)(struct perf_evlist*, bool, int);
>  typedef int
> diff --git a/tools/perf/util/evlist.c b/tools/perf/util/evlist.c
> index 09a1d3400fd9..7ae56b062f44 100644
> --- a/tools/perf/util/evlist.c
> +++ b/tools/perf/util/evlist.c
> @@ -747,6 +747,7 @@ static struct mmap *evlist__alloc_mmap(struct evlist *evlist,
>
>  static void
>  perf_evlist__mmap_cb_idx(struct perf_evlist *_evlist,
> +                        struct perf_evsel *_evsel __maybe_unused,
>                          struct perf_mmap_param *_mp,
>                          int idx)
>  {
> --
> 2.25.1
>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ