On Thu, Mar 12, 2026 at 9:15 AM Vineeth Remanan Pillai vineeth@bitbyteword.org wrote:
On Thu, Mar 12, 2026 at 11:49 AM Mathieu Desnoyers mathieu.desnoyers@efficios.com wrote:
On 2026-03-12 11:40, Steven Rostedt wrote:
On Thu, 12 Mar 2026 11:28:07 -0400 Mathieu Desnoyers mathieu.desnoyers@efficios.com wrote:
Note, Vineeth came up with the naming. I would have done "do" but when I saw "invoke" I thought it sounded better.
It works as long as you don't have a tracing subsystem called "invoke", then you get into identifier clash territory.
True. Perhaps we should do the double underscore trick.
Instead of: trace_invoke_foo()
use: trace_invoke__foo()
Which will make it more visible to what the trace event is.
Hmm, we probably should have used: trace__foo() for all tracepoints, as there's still functions that are called trace_foo() that are not tracepoints :-p
One certain way to eliminate identifier clash would be to go for a prefix to "trace_", e.g.
do_trace_foo() call_trace_foo()
This was the initial idea, but it had conflict in the existing source: call_trace_sched_update_nr_running. do_trace_##name also had collisions when I checked. So, went with trace_invoke_##name. Did not check rest of the suggestions here though.
Thanks, Vineeth
emit_trace_foo() __trace_foo()
this seems like the best approach, IMO. double-underscored variants are usually used for some specialized/internal version of a function when we know that some conditions are correct (e.g., lock is already taken, or something like that). Which fits here: trace_xxx() will check if tracepoint is enabled, while __trace_xxx() will not check and just invoke the tracepoint? It's short, it's distinct, and it says "I know what I am doing".
invoke_trace_foo() dispatch_trace_foo()
Thanks,
Mathieu
-- Mathieu Desnoyers EfficiOS Inc. https://www.efficios.com