Re: [PATCH] percpu: improve percpu_alloc_percpu_fail event trace

From: George Guo
Date: Mon Jan 22 2024 - 21:19:35 EST


On Mon, 22 Jan 2024 10:57:00 -0500
Steven Rostedt <rostedt@xxxxxxxxxxx> wrote:

> On Mon, 22 Jan 2024 15:36:29 +0800
> George Guo <dongtai.guo@xxxxxxxxx> wrote:
>
> > From: George Guo <guodongtai@xxxxxxxxxx>
> >
> > Add do_warn, warn_limit fields to the output of the
> > percpu_alloc_percpu_fail ftrace event.
> >
> > This is required to percpu_alloc failed with no warning showing.
>
> You mean to state;
>
> In order to know why percpu_alloc failed but produces no warnings,
> the do_warn and warn_limit should be traced to let the user know it
> was rate-limited.
>
> Or something like that?
>
> Honestly, I don't think that the trace event is the proper place to do
> that. The trace event just shows that it did fail. If you are
> confused to why it doesn't print to dmesg, then you can simply add a
> kprobe to see those values as well.
>
> -- Steve
>
> >
> > Signed-off-by: George Guo <guodongtai@xxxxxxxxxx>
> > ---

There are two reasons of percpu_alloc failed without warnings:

1. do_warn is false
2. do_warn is true and warn_limit is reached the limit.

Showing do_warn and warn_limit makes things simple, maybe dont need
kprobe again.