# Re: \[PATCH\] percpu: improve percpu\_alloc\_percpu\_fail event trace

- From: George Guo \<hidden\>
- Date: 2024-01-23 01:45:07 
- List: linux-trace-kernel
- Page: https://ratatoskr.run/linux-trace-kernel/2024/01/2467902
- Thread: https://ratatoskr.run/linux-trace-kernel/2024/01/2465821/t.md

```text
On Mon, 22 Jan 2024 10:57:00 -0500
Steven Rostedt [ref] wrote:

> On Mon, 22 Jan 2024 15:36:29 +0800
> George Guo [ref] wrote:
> 
> > From: George Guo <redacted>
> > 
> > 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 <redacted>
> > --- 

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.
```
