[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <YV/0ZZBu01V87A8e@krava>
Date: Fri, 8 Oct 2021 09:33:57 +0200
From: Jiri Olsa <jolsa@...hat.com>
To: Alexey Bayduraev <alexey.v.bayduraev@...ux.intel.com>
Cc: Arnaldo Carvalho de Melo <acme@...nel.org>,
Namhyung Kim <namhyung@...nel.org>,
Alexander Shishkin <alexander.shishkin@...ux.intel.com>,
Peter Zijlstra <peterz@...radead.org>,
Ingo Molnar <mingo@...hat.com>,
linux-kernel <linux-kernel@...r.kernel.org>,
Andi Kleen <ak@...ux.intel.com>,
Adrian Hunter <adrian.hunter@...el.com>,
Alexander Antonov <alexander.antonov@...ux.intel.com>,
Alexei Budankov <abudankov@...wei.com>,
Riccardo Mancini <rickyman7@...il.com>
Subject: Re: [PATCH v3 6/8] perf session: Move event read code to separate
function
On Thu, Oct 07, 2021 at 01:25:41PM +0300, Alexey Bayduraev wrote:
SNIP
> static int
> -reader__process_events(struct reader *rd, struct perf_session *session,
> - struct ui_progress *prog)
> +reader__read_event(struct reader *rd, struct perf_session *session,
> + struct ui_progress *prog)
> {
> u64 size;
> int err = 0;
> union perf_event *event;
> s64 skip;
>
> - err = reader__init(rd, &session->one_mmap);
> - if (err)
> - goto out;
> -
> -remap:
> - err = reader__mmap(rd, session);
> - if (err)
> - goto out;
> -
> -more:
> event = fetch_mmaped_event(rd->head, rd->mmap_size, rd->mmap_cur,
> session->header.needs_swap);
> if (IS_ERR(event))
> return PTR_ERR(event);
>
> if (!event)
> - goto remap;
> + return 1;
>
> session->active_decomp = &rd->decomp_data;
> size = event->header.size;
> @@ -2311,6 +2301,33 @@ reader__process_events(struct reader *rd, struct perf_session *session,
>
> ui_progress__update(prog, size);
>
> +out:
> + session->active_decomp = &session->decomp_data;
> + return err;
> +}
> +
> +static int
> +reader__process_events(struct reader *rd, struct perf_session *session,
> + struct ui_progress *prog)
> +{
> + int err;
> +
> + err = reader__init(rd, &session->one_mmap);
> + if (err)
> + goto out;
> +
> +remap:
> + err = reader__mmap(rd, session);
> + if (err)
> + goto out;
> +
> +more:
> + err = reader__read_event(rd, session, prog);
> + if (err < 0)
> + goto out;
> + else if (err == 1)
> + goto remap;
> +
> if (session_done())
> goto out;
>
> @@ -2318,7 +2335,6 @@ reader__process_events(struct reader *rd, struct perf_session *session,
> goto more;
>
> out:
> - session->active_decomp = &session->decomp_data;
active_decomp should be set/unset within reader__process_events,
not just for single event read, right?
jirka
> return err;
> }
>
> --
> 2.19.0
>
Powered by blists - more mailing lists