Re: [PATCH v3 2/8] tracing/ftrace: guard syscall probe with preempt_notrace

From: Steven Rostedt
Date: Tue Oct 08 2024 - 19:20:55 EST


On Fri, 4 Oct 2024 10:58:12 -0400
Mathieu Desnoyers <mathieu.desnoyers@xxxxxxxxxxxx> wrote:

> + PARAMS(assign), PARAMS(print)) \
> +static notrace void \
> +trace_event_raw_event_##call(void *__data, proto) \
> +{ \
> + guard(preempt_notrace)(); \
> + do_trace_event_raw_event_##call(__data, args); \
> +}
> +

Do we really need to use "guard()" for a single line function? Why make the
compiler do more work?

static notrace void \
trace_event_raw_event_##call(void *__data, proto) \
{ \
preempt_disable_notrace(); \
do_trace_event_raw_event_##call(__data, args); \
preempt_enable_notrace(); \
}

Is more readable.

-- Steve