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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Thu, 22 Oct 2020 13:31:35 +0900
From:   Namhyung Kim <namhyung@...nel.org>
To:     Alexey Budankov <alexey.budankov@...ux.intel.com>
Cc:     Arnaldo Carvalho de Melo <acme@...nel.org>,
        Jiri Olsa <jolsa@...hat.com>,
        Alexander Shishkin <alexander.shishkin@...ux.intel.com>,
        Adrian Hunter <adrian.hunter@...el.com>,
        Andi Kleen <ak@...ux.intel.com>,
        Peter Zijlstra <peterz@...radead.org>,
        Ingo Molnar <mingo@...hat.com>,
        linux-kernel <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v2 04/15] perf session: move reader object definition to
 header file

On Thu, Oct 22, 2020 at 12:59 AM Alexey Budankov
<alexey.budankov@...ux.intel.com> wrote:
>
>
> Move definition of reader to session header file to be shared
> among different source files. Introduce reference to active
> reader object from session object.
>
> Signed-off-by: Alexey Budankov <alexey.budankov@...ux.intel.com>

Acked-by: Namhyung Kim <namhyung@...nel.org>

Thanks
Namhyung

> ---
>  tools/perf/util/session.c | 27 ---------------------------
>  tools/perf/util/session.h | 25 +++++++++++++++++++++++++
>  2 files changed, 25 insertions(+), 27 deletions(-)
>
> diff --git a/tools/perf/util/session.c b/tools/perf/util/session.c
> index 6f09d506b2f6..911b2dbcd0ac 100644
> --- a/tools/perf/util/session.c
> +++ b/tools/perf/util/session.c
> @@ -2110,33 +2110,6 @@ static int __perf_session__process_decomp_events(struct perf_session *session)
>         return 0;
>  }
>
> -/*
> - * On 64bit we can mmap the data file in one go. No need for tiny mmap
> - * slices. On 32bit we use 32MB.
> - */
> -#if BITS_PER_LONG == 64
> -#define MMAP_SIZE ULLONG_MAX
> -#define NUM_MMAPS 1
> -#else
> -#define MMAP_SIZE (32 * 1024 * 1024ULL)
> -#define NUM_MMAPS 128
> -#endif
> -
> -struct reader;
> -
> -typedef s64 (*reader_cb_t)(struct perf_session *session,
> -                          union perf_event *event,
> -                          u64 file_offset,
> -                          const char *file_path);
> -
> -struct reader {
> -       int              fd;
> -       const char       *path;
> -       u64              data_size;
> -       u64              data_offset;
> -       reader_cb_t      process;
> -};
> -
>  static int
>  reader__process_events(struct reader *rd, struct perf_session *session,
>                        struct ui_progress *prog)
> diff --git a/tools/perf/util/session.h b/tools/perf/util/session.h
> index 378ffc3e2809..abdb8518a81f 100644
> --- a/tools/perf/util/session.h
> +++ b/tools/perf/util/session.h
> @@ -20,6 +20,30 @@ struct thread;
>  struct auxtrace;
>  struct itrace_synth_opts;
>
> +/*
> + * On 64bit we can mmap the data file in one go. No need for tiny mmap
> + * slices. On 32bit we use 32MB.
> + */
> +#if BITS_PER_LONG == 64
> +#define MMAP_SIZE ULLONG_MAX
> +#define NUM_MMAPS 1
> +#else
> +#define MMAP_SIZE (32 * 1024 * 1024ULL)
> +#define NUM_MMAPS 128
> +#endif
> +
> +typedef s64 (*reader_cb_t)(struct perf_session *session,
> +                          union perf_event *event,
> +                          u64 file_offset, const char *file_path);
> +
> +struct reader {
> +       int              fd;
> +       const char       *path;
> +       u64              data_size;
> +       u64              data_offset;
> +       reader_cb_t      process;
> +};
> +
>  struct perf_session {
>         struct perf_header      header;
>         struct machines         machines;
> @@ -41,6 +65,7 @@ struct perf_session {
>         struct zstd_data        zstd_data;
>         struct decomp           *decomp;
>         struct decomp           *decomp_last;
> +       struct reader           *reader;
>  };
>
>  struct decomp {
> --
> 2.24.1
>

Powered by blists - more mailing lists