public inbox for linux-trace-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "Gautham R. Shenoy" <gautham.shenoy@amd.com>
To: "Vineeth Pillai (Google)" <vineeth@bitbyteword.org>
Cc: Steven Rostedt <rostedt@goodmis.org>,
	Peter Zijlstra <peterz@infradead.org>,
	Huang Rui <ray.huang@amd.com>,
	Mario Limonciello <mario.limonciello@amd.com>,
	Perry Yuan <perry.yuan@amd.com>,
	"Rafael J. Wysocki" <rafael@kernel.org>,
	Viresh Kumar <viresh.kumar@linaro.org>,
	Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>,
	Len Brown <lenb@kernel.org>,
	linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-trace-kernel@vger.kernel.org
Subject: Re: [PATCH v2 06/19] cpufreq: Use trace_call__##name() at guarded tracepoint call sites
Date: Fri, 27 Mar 2026 14:40:47 +0530	[thread overview]
Message-ID: <acZJl8QUYEq8voqQ@BLRRASHENOY1.amd.com> (raw)
In-Reply-To: <20260323160052.17528-7-vineeth@bitbyteword.org>

Hello Vineeth,

On Mon, Mar 23, 2026 at 12:00:25PM -0400, Vineeth Pillai (Google) wrote:
> 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.
> 
> 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


For drivers/cpufreq/amd-pstate.c and drivers/cpufreq/cpufreq.c

Reviewed-by: Gautham R. Shenoy <gautham.shenoy@amd.com>

-- 
Thanks and Regards
gautham.

> ---
>  drivers/cpufreq/amd-pstate.c   | 10 +++++-----
>  drivers/cpufreq/cpufreq.c      |  2 +-
>  drivers/cpufreq/intel_pstate.c |  2 +-
>  3 files changed, 7 insertions(+), 7 deletions(-)
> 
> diff --git a/drivers/cpufreq/amd-pstate.c b/drivers/cpufreq/amd-pstate.c
> index 5aa9fcd80cf51..4c47324aa2f73 100644
> --- a/drivers/cpufreq/amd-pstate.c
> +++ b/drivers/cpufreq/amd-pstate.c
> @@ -247,7 +247,7 @@ static int msr_update_perf(struct cpufreq_policy *policy, u8 min_perf,
>  	if (trace_amd_pstate_epp_perf_enabled()) {
>  		union perf_cached perf = READ_ONCE(cpudata->perf);
>  
> -		trace_amd_pstate_epp_perf(cpudata->cpu,
> +		trace_call__amd_pstate_epp_perf(cpudata->cpu,
>  					  perf.highest_perf,
>  					  epp,
>  					  min_perf,
> @@ -298,7 +298,7 @@ static int msr_set_epp(struct cpufreq_policy *policy, u8 epp)
>  	if (trace_amd_pstate_epp_perf_enabled()) {
>  		union perf_cached perf = cpudata->perf;
>  
> -		trace_amd_pstate_epp_perf(cpudata->cpu, perf.highest_perf,
> +		trace_call__amd_pstate_epp_perf(cpudata->cpu, perf.highest_perf,
>  					  epp,
>  					  FIELD_GET(AMD_CPPC_MIN_PERF_MASK,
>  						    cpudata->cppc_req_cached),
> @@ -343,7 +343,7 @@ static int shmem_set_epp(struct cpufreq_policy *policy, u8 epp)
>  	if (trace_amd_pstate_epp_perf_enabled()) {
>  		union perf_cached perf = cpudata->perf;
>  
> -		trace_amd_pstate_epp_perf(cpudata->cpu, perf.highest_perf,
> +		trace_call__amd_pstate_epp_perf(cpudata->cpu, perf.highest_perf,
>  					  epp,
>  					  FIELD_GET(AMD_CPPC_MIN_PERF_MASK,
>  						    cpudata->cppc_req_cached),
> @@ -507,7 +507,7 @@ static int shmem_update_perf(struct cpufreq_policy *policy, u8 min_perf,
>  	if (trace_amd_pstate_epp_perf_enabled()) {
>  		union perf_cached perf = READ_ONCE(cpudata->perf);
>  
> -		trace_amd_pstate_epp_perf(cpudata->cpu,
> +		trace_call__amd_pstate_epp_perf(cpudata->cpu,
>  					  perf.highest_perf,
>  					  epp,
>  					  min_perf,
> @@ -588,7 +588,7 @@ static void amd_pstate_update(struct amd_cpudata *cpudata, u8 min_perf,
>  	}
>  
>  	if (trace_amd_pstate_perf_enabled() && amd_pstate_sample(cpudata)) {
> -		trace_amd_pstate_perf(min_perf, des_perf, max_perf, cpudata->freq,
> +		trace_call__amd_pstate_perf(min_perf, des_perf, max_perf, cpudata->freq,
>  			cpudata->cur.mperf, cpudata->cur.aperf, cpudata->cur.tsc,
>  				cpudata->cpu, fast_switch);
>  	}
> diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c
> index 277884d91913c..58901047eae5a 100644
> --- a/drivers/cpufreq/cpufreq.c
> +++ b/drivers/cpufreq/cpufreq.c
> @@ -2222,7 +2222,7 @@ unsigned int cpufreq_driver_fast_switch(struct cpufreq_policy *policy,
>  
>  	if (trace_cpu_frequency_enabled()) {
>  		for_each_cpu(cpu, policy->cpus)
> -			trace_cpu_frequency(freq, cpu);
> +			trace_call__cpu_frequency(freq, cpu);
>  	}
>  
>  	return freq;
> diff --git a/drivers/cpufreq/intel_pstate.c b/drivers/cpufreq/intel_pstate.c
> index 11c58af419006..70be952209144 100644
> --- a/drivers/cpufreq/intel_pstate.c
> +++ b/drivers/cpufreq/intel_pstate.c
> @@ -3132,7 +3132,7 @@ static void intel_cpufreq_trace(struct cpudata *cpu, unsigned int trace_type, in
>  		return;
>  
>  	sample = &cpu->sample;
> -	trace_pstate_sample(trace_type,
> +	trace_call__pstate_sample(trace_type,
>  		0,
>  		old_pstate,
>  		cpu->pstate.current_pstate,
> -- 
> 2.53.0
> 

  parent reply	other threads:[~2026-03-27  9:10 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-23 16:00 [PATCH v2 00/19] tracepoint: Avoid double static_branch evaluation at guarded call sites Vineeth Pillai (Google)
2026-03-23 16:00 ` [PATCH v2 01/19] tracepoint: Add trace_call__##name() API Vineeth Pillai (Google)
2026-03-26  1:28   ` Masami Hiramatsu
2026-03-23 16:00 ` [PATCH v2 02/19] kernel: Use trace_call__##name() at guarded tracepoint call sites Vineeth Pillai (Google)
2026-03-23 17:42   ` Tejun Heo
2026-03-25 17:16   ` Thomas Gleixner
2026-03-26  1:29   ` Masami Hiramatsu
2026-03-23 16:00 ` [PATCH v2 03/19] io_uring: " Vineeth Pillai (Google)
2026-03-23 16:00 ` [PATCH v2 04/19] net: " Vineeth Pillai (Google)
2026-03-24 15:33   ` Aaron Conole
2026-03-24 15:37     ` Steven Rostedt
2026-03-23 16:00 ` [PATCH v2 05/19] accel/habanalabs: " Vineeth Pillai (Google)
2026-03-23 16:00 ` [PATCH v2 06/19] cpufreq: " Vineeth Pillai (Google)
2026-03-26 10:24   ` Rafael J. Wysocki
2026-03-27  9:10   ` Gautham R. Shenoy [this message]
2026-03-23 16:00 ` [PATCH v2 07/19] devfreq: " Vineeth Pillai (Google)
2026-03-23 16:00 ` [PATCH v2 08/19] dma-buf: " Vineeth Pillai (Google)
2026-03-23 16:00 ` [PATCH v2 09/19] fsi: " Vineeth Pillai (Google)
2026-03-23 16:00 ` [PATCH v2 10/19] drm: " Vineeth Pillai (Google)
2026-03-23 16:00 ` [PATCH v2 11/19] HID: " Vineeth Pillai (Google)
2026-03-23 16:00 ` [PATCH v2 12/19] i2c: " Vineeth Pillai (Google)
2026-03-23 16:43   ` Wolfram Sang
2026-03-23 16:00 ` [PATCH v2 13/19] spi: " Vineeth Pillai (Google)
2026-03-23 16:03   ` Mark Brown
2026-03-23 16:00 ` [PATCH v2 14/19] scsi: ufs: " Vineeth Pillai (Google)
2026-03-23 16:00 ` [PATCH v2 15/19] btrfs: " Vineeth Pillai (Google)
2026-03-23 17:53   ` David Sterba
2026-03-23 16:00 ` [PATCH v2 16/19] net: devlink: " Vineeth Pillai (Google)
2026-03-23 16:00 ` [PATCH v2 17/19] kernel: time, trace: " Vineeth Pillai (Google)
2026-03-23 16:00 ` [PATCH v2 18/19] mm: damon: " Vineeth Pillai (Google)
2026-03-24  0:25   ` SeongJae Park
2026-03-23 16:00 ` [PATCH v2 19/19] x86: msr: " Vineeth Pillai (Google)
2026-03-24 14:28 ` [PATCH v2 00/19] tracepoint: Avoid double static_branch evaluation at guarded " Steven Rostedt

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=acZJl8QUYEq8voqQ@BLRRASHENOY1.amd.com \
    --to=gautham.shenoy@amd.com \
    --cc=lenb@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=linux-trace-kernel@vger.kernel.org \
    --cc=mario.limonciello@amd.com \
    --cc=perry.yuan@amd.com \
    --cc=peterz@infradead.org \
    --cc=rafael@kernel.org \
    --cc=ray.huang@amd.com \
    --cc=rostedt@goodmis.org \
    --cc=srinivas.pandruvada@linux.intel.com \
    --cc=vineeth@bitbyteword.org \
    --cc=viresh.kumar@linaro.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox