Re: [PATCH v2 5/7] perf ordered-events: Event processing consistency with the regular reader

From: Ian Rogers

Date: Wed Apr 01 2026 - 01:30:41 EST


On Wed, Mar 4, 2026 at 10:27 PM Namhyung Kim <namhyung@xxxxxxxxxx> wrote:
>
> On Fri, Feb 27, 2026 at 10:59:51PM -0800, Ian Rogers wrote:
> > Some event processing functions like perf_event__process_tracing_data
> > return a zero or positive value on success. Ordered event processing
> > handles any non-zero value as an error, which is inconsistent with
> > reader__process_events and reader__read_event that only treat negative
> > values as errors. Make the ordered events error handling consistent
> > with that of the events reader.
> >
> > Signed-off-by: Ian Rogers <irogers@xxxxxxxxxx>
> > ---
> > tools/perf/util/ordered-events.c | 2 +-
> > 1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/tools/perf/util/ordered-events.c b/tools/perf/util/ordered-events.c
> > index 8c62611f10aa..a5857f9f5af2 100644
> > --- a/tools/perf/util/ordered-events.c
> > +++ b/tools/perf/util/ordered-events.c
> > @@ -243,7 +243,7 @@ static int do_flush(struct ordered_events *oe, bool show_progress)
> > if (iter->timestamp > limit)
> > break;
> > ret = oe->deliver(oe, iter);
> > - if (ret)
> > + if (ret < 0)
>
> Are you sure all oe->deliver callbacks return negative for errors?

These are the same callbacks used for unordered event processing; this
patch aims to make the two consistent.

Thanks,
Ian

> Thanks,
> Namhyung
>
>
> > return ret;
> >
> > ordered_events__delete(oe, iter);
> > --
> > 2.53.0.473.g4a7958ca14-goog
> >