On Mon, 14 Apr 2025 16:37:19 -0700
Dave Hansen <[email protected]> wrote:

> On 4/14/25 16:22, Junxuan Liao wrote:
> > On 4/14/25 6:14 PM, Junxuan Liao wrote:  
> >> Do people find separate user/kernel tracepoints useful? For me, I can
> >> check regs in eBPF tracing code instead.  
> > I think it might be good to add a field to the tracepoints to indicate
> > whether it's in user space or not.  
> 
> Sounds sane to me.  Doing something like this:
> 
>         TP_STRUCT__entry(
>                 __field(                unsigned long, address  )
>                 __field(                unsigned long, ip       )
> +               __field(                bool       , user_mode)
>                 __field(                unsigned long, error_code )
>         ),
> 
>         TP_fast_assign(
>                  __entry->address = address;
>                  __entry->ip         = regs->ip;
> +                __entry->user_mode  = user_mode(regs);
>                  __entry->error_code = error_code;
>         ),
> 
> seems highly superior to having two sets of tracepoints and static keys.

I agree.

Acked-by: Steven Rostedt (Google) <[email protected]>

-- Steve

Reply via email to