[PATCH 12/15] i2c: Use trace_invoke_##name() at guarded tracepoint call sites

Vineeth Pillai (Google) posted 15 patches 3 weeks, 4 days ago
There is a newer version of this series
[PATCH 12/15] i2c: Use trace_invoke_##name() at guarded tracepoint call sites
Posted by Vineeth Pillai (Google) 3 weeks, 4 days ago
Replace trace_foo() with the new trace_invoke_foo() at sites already
guarded by trace_foo_enabled(), avoiding a redundant
static_branch_unlikely() re-evaluation inside the tracepoint.
trace_invoke_foo() calls the tracepoint callbacks directly without
utilizing the static branch again.

Suggested-by: Steven Rostedt <rostedt@goodmis.org>
Suggested-by: Peter Zijlstra <peterz@infradead.org>
Signed-off-by: Vineeth Pillai (Google) <vineeth@bitbyteword.org>
Assisted-by: Claude:claude-sonnet-4-6
---
 drivers/i2c/i2c-core-slave.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/i2c/i2c-core-slave.c b/drivers/i2c/i2c-core-slave.c
index 02ca55c2246bc..04de8908de5fc 100644
--- a/drivers/i2c/i2c-core-slave.c
+++ b/drivers/i2c/i2c-core-slave.c
@@ -89,7 +89,7 @@ int i2c_slave_event(struct i2c_client *client,
 	int ret = client->slave_cb(client, event, val);
 
 	if (trace_i2c_slave_enabled())
-		trace_i2c_slave(client, event, val, ret);
+		trace_invoke_i2c_slave(client, event, val, ret);
 
 	return ret;
 }
-- 
2.53.0
Re: [PATCH 12/15] i2c: Use trace_invoke_##name() at guarded tracepoint call sites
Posted by Wolfram Sang 3 weeks, 4 days ago
On Thu, Mar 12, 2026 at 11:05:07AM -0400, Vineeth Pillai (Google) wrote:
> Replace trace_foo() with the new trace_invoke_foo() at sites already
> guarded by trace_foo_enabled(), avoiding a redundant
> static_branch_unlikely() re-evaluation inside the tracepoint.
> trace_invoke_foo() calls the tracepoint callbacks directly without
> utilizing the static branch again.
> 
> Suggested-by: Steven Rostedt <rostedt@goodmis.org>
> Suggested-by: Peter Zijlstra <peterz@infradead.org>
> Signed-off-by: Vineeth Pillai (Google) <vineeth@bitbyteword.org>
> Assisted-by: Claude:claude-sonnet-4-6

From my side, this can go upstream with the rest of this series (when it
is ready). So:

Acked-by: Wolfram Sang <wsa+renesas@sang-engineering.com>