linux-perf-users.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Rafael J. Wysocki" <rafael@kernel.org>
To: Steven Rostedt <rostedt@goodmis.org>
Cc: "Rafael J. Wysocki" <rafael@kernel.org>,
	Christian Loehle <christian.loehle@arm.com>,
	 Samuel Wu <wusamuel@google.com>, Huang Rui <ray.huang@amd.com>,
	 "Gautham R. Shenoy" <gautham.shenoy@amd.com>,
	Mario Limonciello <mario.limonciello@amd.com>,
	 Perry Yuan <perry.yuan@amd.com>,
	Jonathan Corbet <corbet@lwn.net>,
	 Viresh Kumar <viresh.kumar@linaro.org>,
	Masami Hiramatsu <mhiramat@kernel.org>,
	 Mathieu Desnoyers <mathieu.desnoyers@efficios.com>,
	 Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>,
	Len Brown <lenb@kernel.org>,  Alexei Starovoitov <ast@kernel.org>,
	Daniel Borkmann <daniel@iogearbox.net>,
	 Andrii Nakryiko <andrii@kernel.org>,
	Martin KaFai Lau <martin.lau@linux.dev>,
	 Eduard Zingerman <eddyz87@gmail.com>, Song Liu <song@kernel.org>,
	 Yonghong Song <yonghong.song@linux.dev>,
	John Fastabend <john.fastabend@gmail.com>,
	 KP Singh <kpsingh@kernel.org>,
	Stanislav Fomichev <sdf@fomichev.me>, Hao Luo <haoluo@google.com>,
	 Jiri Olsa <jolsa@kernel.org>,
	Peter Zijlstra <peterz@infradead.org>,
	Ingo Molnar <mingo@redhat.com>,
	 Arnaldo Carvalho de Melo <acme@kernel.org>,
	Namhyung Kim <namhyung@kernel.org>,
	 Mark Rutland <mark.rutland@arm.com>,
	 Alexander Shishkin <alexander.shishkin@linux.intel.com>,
	Ian Rogers <irogers@google.com>,
	 Adrian Hunter <adrian.hunter@intel.com>,
	James Clark <james.clark@linaro.org>,
	 kernel-team@android.com, linux-pm@vger.kernel.org,
	linux-doc@vger.kernel.org,  linux-kernel@vger.kernel.org,
	linux-trace-kernel@vger.kernel.org,  bpf@vger.kernel.org,
	linux-perf-users@vger.kernel.org
Subject: Re: [PATCH v3 1/2] cpufreq: Replace trace_cpu_frequency with trace_policy_frequency
Date: Thu, 4 Dec 2025 18:24:57 +0100	[thread overview]
Message-ID: <CAJZ5v0irO1zmh=un+8vDQ8h2k-sHFTpCPCwr=iVRPcozHMRKHA@mail.gmail.com> (raw)
In-Reply-To: <20251204114844.54953b01@gandalf.local.home>

On Thu, Dec 4, 2025 at 5:48 PM Steven Rostedt <rostedt@goodmis.org> wrote:
>
> On Thu, 4 Dec 2025 15:57:41 +0100
> "Rafael J. Wysocki" <rafael@kernel.org> wrote:
>
> > > perf timechart seem to do per-CPU reporting though?
> > > So this is broken by not emitting an event per-CPU? At least with a simple s/cpu_frequency/policy_frequency/
> > > like here.
> > > Similar for the bpf samples technically...
> >
> > This kind of boils down to whether or not tracepoints can be regarded
> > as ABI and to what extent.
>
> They are an ABI and they are not an ABI. It really boils down to "if you
> break the ABI but no user space notices, did you really break the ABI?" the
> answer is "no". But if user space notices, then yes you did. But it is
> possible to still fix user space (I did this with powertop).

My concern is that the patch effectively removes one trace point
(cpu_frequency) and adds another one with a different format
(policy_frequency), updates one utility in the kernel tree and expects
everyone else to somehow know that they should switch over.

I know about at least several people who have their own scripts using
this tracepoint though.

> >
> > In this particular case, I'm not sure I agree with the stated motivation.
> >
> > First of all, on systems with one CPU per cpufreq policy (the vast
> > majority of x86, including AMD, and the ARM systems using the CPPC
> > driver AFAICS), the "issue" at hand is actually a non-issue and
> > changing the name of the tracepoint alone would confuse things in user
> > space IIUC.  Those need to work the way they do today.
>
> If the way the tracepoint changes, it's best to change the name too.
> Tooling can check to see which name is available to determine how to
> process the traces.

If it is updated to do so, yes, but in the meantime?

> >
> > On systems with multiple CPUs per cpufreq policy there is some extra
> > overhead related to the cpu_frequency tracepoint, but the if someone
> > is only interested in the "policy" frequency, they can filter out all
> > CPUs belonging to the same policy except for one from the traces,
> > don't they?
>
> I'm not exactly sure what you mean here. There is an "onchange" trigger you
> can use to trigger a synthetic event whenever a change happens. But I think
> the data here wants to know which CPU had its policy change. Hence the CPU
> mask.

IIUC he wants to trace frequency changes per policy, not per CPU
(because there are cases in which multiple CPUs belong to one policy
and arguably the frequency doesn't need to be traced for all of them),
but tooling should know which CPUs belong to the same policy, so it
should be straightforward to use that knowledge when processing the
traces.

  reply	other threads:[~2025-12-04 17:25 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-12-01 20:24 [PATCH v3 0/2] Replace trace_cpu_frequency with trace_policy_frequency Samuel Wu
2025-12-01 20:24 ` [PATCH v3 1/2] cpufreq: " Samuel Wu
2025-12-02 12:03   ` Douglas Raillard
2025-12-04  0:33     ` Samuel Wu
2025-12-04 12:48   ` Christian Loehle
2025-12-04 14:57     ` Rafael J. Wysocki
2025-12-04 16:48       ` Steven Rostedt
2025-12-04 17:24         ` Rafael J. Wysocki [this message]
2025-12-04 18:46           ` Steven Rostedt
2025-12-04 17:21       ` srinivas pandruvada
2025-12-04 18:47         ` Steven Rostedt
2025-12-01 20:24 ` [PATCH v3 2/2] cpufreq: Documentation update for trace_policy_frequency Samuel Wu
2025-12-01 23:11   ` Tiffany Yang
2025-12-02  6:43 ` [PATCH v3 0/2] Replace trace_cpu_frequency with trace_policy_frequency Viresh Kumar

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='CAJZ5v0irO1zmh=un+8vDQ8h2k-sHFTpCPCwr=iVRPcozHMRKHA@mail.gmail.com' \
    --to=rafael@kernel.org \
    --cc=acme@kernel.org \
    --cc=adrian.hunter@intel.com \
    --cc=alexander.shishkin@linux.intel.com \
    --cc=andrii@kernel.org \
    --cc=ast@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=christian.loehle@arm.com \
    --cc=corbet@lwn.net \
    --cc=daniel@iogearbox.net \
    --cc=eddyz87@gmail.com \
    --cc=gautham.shenoy@amd.com \
    --cc=haoluo@google.com \
    --cc=irogers@google.com \
    --cc=james.clark@linaro.org \
    --cc=john.fastabend@gmail.com \
    --cc=jolsa@kernel.org \
    --cc=kernel-team@android.com \
    --cc=kpsingh@kernel.org \
    --cc=lenb@kernel.org \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-perf-users@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=linux-trace-kernel@vger.kernel.org \
    --cc=mario.limonciello@amd.com \
    --cc=mark.rutland@arm.com \
    --cc=martin.lau@linux.dev \
    --cc=mathieu.desnoyers@efficios.com \
    --cc=mhiramat@kernel.org \
    --cc=mingo@redhat.com \
    --cc=namhyung@kernel.org \
    --cc=perry.yuan@amd.com \
    --cc=peterz@infradead.org \
    --cc=ray.huang@amd.com \
    --cc=rostedt@goodmis.org \
    --cc=sdf@fomichev.me \
    --cc=song@kernel.org \
    --cc=srinivas.pandruvada@linux.intel.com \
    --cc=viresh.kumar@linaro.org \
    --cc=wusamuel@google.com \
    --cc=yonghong.song@linux.dev \
    /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;
as well as URLs for NNTP newsgroup(s).