Re: [PATCH] perf trace: propagate evsel__set_filter() error in trace__expand_filter()
From: Namhyung Kim
Date: Thu Nov 19 2026 - 03:09:48 EST
On Thu, Nov 12, 2026 at 04:09:21PM +0800, Gu Bin wrote:
> At the end of trace__expand_filter(), the return value of
> evsel__set_filter() is ignored. When the strdup() inside fails with
> -ENOMEM, the function returns 0 anyway, leaving evsel->filter holding
> the unexpanded filter, which still contains the symbolic constants the
> loop meant to resolve. The failure then surfaces later and indirectly:
> evlist__apply_filters() passes the unexpanded string to the tracepoint
> filter parser, which rejects the symbolic name, so perf trace fails to
> start with a filter syntax error whose real cause is the missed
> allocation.
>
> Propagate the error so the -ENOMEM is reported at the source and the
> caller fails immediately.
>
> Fixes: 90df0249c2ea ("perf trace: Expand strings in filters to integers")
> Signed-off-by: Gu Bin <gubin@xxxxxxxxxxxxxxxxxxxx>
Oh, you already sent out the fix. :)
Thanks,
Namhyung