linux-doc.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Samuel Wu <wusamuel@google.com>
To: 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>,
	"Rafael J. Wysocki" <rafael@kernel.org>,
	 Viresh Kumar <viresh.kumar@linaro.org>,
	Steven Rostedt <rostedt@goodmis.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>
Cc: christian.loehle@arm.com, Samuel Wu <wusamuel@google.com>,
	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: [PATCH v3 0/2] Replace trace_cpu_frequency with trace_policy_frequency
Date: Mon,  1 Dec 2025 12:24:33 -0800	[thread overview]
Message-ID: <20251201202437.3750901-1-wusamuel@google.com> (raw)

This series replaces the cpu_frequency trace event with a new trace event,
policy_frequency. Since by definition all CPUs in a policy are of the same
frequency, we can emit a frequency change per policy instead of per CPU.
This saves some compute and memory from the kernel side, while simplifying
analysis from the post-processing of the trace log side.

Any process that relied on cpu_frequency trace event needs to switch to the
new policy_frequency trace event in order to maintain functionality. The
decision of replacing instead of adding the trace event is intentional. Since
emitting once per policy instead of once per CPU is anyways a semantics change
that would require a tooling update, the trace event was also appropriately
renamed. The presence of the policy_frequency event in a trace log is a clear
and obvious signal for tooling to determine kernel version and which trace
event to parse.

1/2: Replaces trace_cpu_frequency with trace_policy_frequency
2/2: Corresponding documentation patch that updates references to
     cpu_frequency with policy_frequency

Changes in v3:
- Resending v2 properly (accidentally ommited cover letter in v2)

Changes in v2:
- Replaced trace_cpu_frequency with trace_policy_frequency (per Christian
  and Viresh)
- Updated references to cpu_frequency in documentation with
  policy_frequency
- v1 link: https://lore.kernel.org/all/20251112235154.2974902-1-wusamuel@google.com

Samuel Wu (2):
  cpufreq: Replace trace_cpu_frequency with trace_policy_frequency
  cpufreq: Documentation update for trace_policy_frequency

 Documentation/admin-guide/pm/amd-pstate.rst   | 10 ++++----
 Documentation/admin-guide/pm/intel_pstate.rst | 14 +++++------
 Documentation/trace/events-power.rst          |  2 +-
 drivers/cpufreq/cpufreq.c                     | 14 ++---------
 drivers/cpufreq/intel_pstate.c                |  6 +++--
 include/trace/events/power.h                  | 24 ++++++++++++++++---
 kernel/trace/power-traces.c                   |  2 +-
 samples/bpf/cpustat_kern.c                    |  8 +++----
 samples/bpf/cpustat_user.c                    |  6 ++---
 tools/perf/builtin-timechart.c                | 12 +++++-----
 10 files changed, 54 insertions(+), 44 deletions(-)

-- 
2.52.0.107.ga0afd4fd5b-goog


             reply	other threads:[~2025-12-01 20:24 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-12-01 20:24 Samuel Wu [this message]
2025-12-01 20:24 ` [PATCH v3 1/2] cpufreq: Replace trace_cpu_frequency with trace_policy_frequency 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
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=20251201202437.3750901-1-wusamuel@google.com \
    --to=wusamuel@google.com \
    --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=rafael@kernel.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=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).