Linux Power Management development
 help / color / mirror / Atom feed
* [PATCH 1/3] cpufreq: amd-pstate: Use trace_call__##name() at guarded tracepoint call site
@ 2026-05-15 14:01 Vineeth Pillai (Google)
  2026-05-15 18:29 ` Mario Limonciello
  0 siblings, 1 reply; 3+ messages in thread
From: Vineeth Pillai (Google) @ 2026-05-15 14:01 UTC (permalink / raw)
  To: Huang Rui, Mario Limonciello, Rafael J. Wysocki, Viresh Kumar
  Cc: linux-pm, Steven Rostedt, linux-trace-kernel, Vineeth Pillai,
	Peter Zijlstra

From: Vineeth Pillai <vineeth@bitbyteword.org>

Replace trace_foo() with the new trace_call__foo() at sites already
guarded by trace_foo_enabled(), avoiding a redundant
static_branch_unlikely() re-evaluation inside the tracepoint.
trace_call__foo() calls the tracepoint callbacks directly without
utilizing the static branch again.

Original v2 series:
https://lore.kernel.org/linux-trace-kernel/20260323160052.17528-1-vineeth@bitbyteword.org/

Parts of the original v2 series have already been merged in mainline.
This patch is being reposted as a follow-up cleanup for the remaining
unmerged pieces.

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/cpufreq/amd-pstate.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/cpufreq/amd-pstate.c b/drivers/cpufreq/amd-pstate.c
index 453084c67327..4722de25149b 100644
--- a/drivers/cpufreq/amd-pstate.c
+++ b/drivers/cpufreq/amd-pstate.c
@@ -368,7 +368,8 @@ static int amd_pstate_set_floor_perf(struct cpufreq_policy *policy, u8 perf)
 
 out_trace:
 	if (trace_amd_pstate_cppc_req2_enabled())
-		trace_amd_pstate_cppc_req2(cpudata->cpu, perf, changed, ret);
+		trace_call__amd_pstate_cppc_req2(cpudata->cpu, perf, changed,
+						 ret);
 	return ret;
 }
 
-- 
2.54.0


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH 1/3] cpufreq: amd-pstate: Use trace_call__##name() at guarded tracepoint call site
  2026-05-15 14:01 [PATCH 1/3] cpufreq: amd-pstate: Use trace_call__##name() at guarded tracepoint call site Vineeth Pillai (Google)
@ 2026-05-15 18:29 ` Mario Limonciello
  2026-05-15 18:40   ` Steven Rostedt
  0 siblings, 1 reply; 3+ messages in thread
From: Mario Limonciello @ 2026-05-15 18:29 UTC (permalink / raw)
  To: Vineeth Pillai (Google), Huang Rui, Rafael J. Wysocki,
	Viresh Kumar
  Cc: linux-pm, Steven Rostedt, linux-trace-kernel, Peter Zijlstra



On 5/15/26 09:01, Vineeth Pillai (Google) wrote:
> From: Vineeth Pillai <vineeth@bitbyteword.org>
> 
> Replace trace_foo() with the new trace_call__foo() at sites already
> guarded by trace_foo_enabled(), avoiding a redundant
> static_branch_unlikely() re-evaluation inside the tracepoint.
> trace_call__foo() calls the tracepoint callbacks directly without
> utilizing the static branch again.
> 
> Original v2 series:
> https://lore.kernel.org/linux-trace-kernel/20260323160052.17528-1-vineeth@bitbyteword.org/
> 
> Parts of the original v2 series have already been merged in mainline.
> This patch is being reposted as a follow-up cleanup for the remaining
> unmerged pieces.
> 
> 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

No concerns this going through another tree together.

Reviewed-by: Mario Limonciello <mario.limonciello@amd.com>
> ---
>   drivers/cpufreq/amd-pstate.c | 3 ++-
>   1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/cpufreq/amd-pstate.c b/drivers/cpufreq/amd-pstate.c
> index 453084c67327..4722de25149b 100644
> --- a/drivers/cpufreq/amd-pstate.c
> +++ b/drivers/cpufreq/amd-pstate.c
> @@ -368,7 +368,8 @@ static int amd_pstate_set_floor_perf(struct cpufreq_policy *policy, u8 perf)
>   
>   out_trace:
>   	if (trace_amd_pstate_cppc_req2_enabled())
> -		trace_amd_pstate_cppc_req2(cpudata->cpu, perf, changed, ret);
> +		trace_call__amd_pstate_cppc_req2(cpudata->cpu, perf, changed,
> +						 ret);
>   	return ret;
>   }
>   


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH 1/3] cpufreq: amd-pstate: Use trace_call__##name() at guarded tracepoint call site
  2026-05-15 18:29 ` Mario Limonciello
@ 2026-05-15 18:40   ` Steven Rostedt
  0 siblings, 0 replies; 3+ messages in thread
From: Steven Rostedt @ 2026-05-15 18:40 UTC (permalink / raw)
  To: Mario Limonciello
  Cc: Vineeth Pillai (Google), Huang Rui, Rafael J. Wysocki,
	Viresh Kumar, linux-pm, linux-trace-kernel, Peter Zijlstra

On Fri, 15 May 2026 13:29:33 -0500
Mario Limonciello <mario.limonciello@amd.com> wrote:

> No concerns this going through another tree together.
> 
> Reviewed-by: Mario Limonciello <mario.limonciello@amd.com>

I'll apply it to my tree.

Thanks,

-- Steve

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-05-15 18:40 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-05-15 14:01 [PATCH 1/3] cpufreq: amd-pstate: Use trace_call__##name() at guarded tracepoint call site Vineeth Pillai (Google)
2026-05-15 18:29 ` Mario Limonciello
2026-05-15 18:40   ` Steven Rostedt

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox