[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <YWBX+p1vtLXXbpkF@krava>
Date: Fri, 8 Oct 2021 16:38:50 +0200
From: Jiri Olsa <jolsa@...hat.com>
To: "Bayduraev, Alexey V" <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 Fri, Oct 08, 2021 at 11:42:18AM +0300, Bayduraev, Alexey V wrote:
>
>
> On 08.10.2021 10:33, Jiri Olsa wrote:
> > 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?
>
> No, it should be set before perf_session__process_event/process_decomp_events
> and unset after these calls. So active_decomp setting/unsetting is moved in
> this patch to the reader__read_event function. This is necessary for multiple
> trace reader because it could call reader__read_event in round-robin manner.
hum, is that code already in? I can't see this happening in current code
jirka
>
> Regards,
> Alexey
>
> >
> > jirka
> >
> >> return err;
> >> }
> >>
> >> --
> >> 2.19.0
> >>
> >
>
Powered by blists - more mailing lists