Re: [PATCH] kernel/trace: Fix cleanup logic of enable_trace_eprobe

From: Steven Rostedt
Date: Fri Jun 30 2023 - 06:46:11 EST


On Fri, 30 Jun 2023 12:57:36 +0300
Tzvetomir Stoyanov <tz.stoyanov@xxxxxxxxx> wrote:

> > Does that make sense?
>
> Yes, it makes sense. But the original loop will break on the first
> failure. If there is an error (ret is not 0) and at least one eprobe
> was enabled successfully (enabled is true),
> the warning should be emitted, only if that error is not ENOMEM:
> WARN_ON_ONCE(ret != -ENOMEM);

Ah, I missed the logic for the "enabled" variable. Yeah, when that is
set it does the same as the cnt variable I mentioned. Thanks for
pointing that out. (I blame still being a bit jetlagged and lack of
sleep for not seeing that ;-)

Yeah, if "enabled" is set, then we can do the WARN_ON_ONCE().

I'll wait for your new patch.

Thanks Tzvetomir!

-- Steve