mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Hemanth Selam <hemanth.selam@gmail.com>
To: Thomas Renninger <trenn@suse.com>, Shuah Khan <shuah@kernel.org>,
	"John B . Wyatt IV" <jwyatt@redhat.com>,
	John Kacur <jkacur@redhat.com>
Cc: linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org,
	Hemanth Selam <hemanth.selam@gmail.com>
Subject: [PATCH 0/1] cpupower: monitor: Show how a counter value is exported
Date: Tue, 18 Aug 2026 15:25:37 +0530	[thread overview]
Message-ID: <20260818095538.1196953-1-hemanth.selam@gmail.com> (raw)

Hi,

this picks up the ToDo in list_monitors() which asks to show more of the
capabilities of a counter.

"cpupower monitor -l" tells the name of a counter, the processor
hierarchy level it covers and its description, but it does not tell how
the value of the counter is exported. That is not obvious from the
description either: most counters are a percentage of the time spent in
a state, while for example the Mperf "Freq" counter reports MHz and the
RAPL zones report micro Joule. Without that information the numbers of
a measurement run are hard to interpret.

The value type is now printed behind the hierarchy level, using the
square bracket notation the hierarchy level already uses:

  [%]   The counter is a percentage of the time spent in the state.
  [abs] The counter is an absolute value, its unit depends on the
        counter, MHz for "Freq" or micro Joule for a RAPL zone.

The man page is updated in the same patch, right below the description
of the [T], [C], [P] and [M] hierarchy levels.

Note that "%" and "abs" are deliberately not single letters: [C] and
[P] are already taken by the Core and Package hierarchy levels, so
reusing them would render counters as "[P] [C]" or "[C] [P]", which
cannot be read unambiguously.

The second half of the ToDo, showing the time granularity of a counter,
is not implemented. There is no per state granularity information
today, only the per monitor overflow time which is already printed. It
would need a new cstate_t member every monitor has to fill in, so the
ToDo is kept, narrowed down to what is left to do.

Tested with the Mperf and Idle_Stats monitors:

  $ cpupower monitor -l
  Monitor "Mperf" (3 states) - Might overflow after 922000000 s
  C0	[T] [%] -> Processor Core not idle
  Cx	[T] [%] -> Processor Core in an idle state
  Freq	[T] [abs] -> Average Frequency (including boost) in MHz
  Monitor "Idle_Stats" (3 states) - Might overflow after 4294967295 s
  POLL	[T] [%] -> CPUIDLE CORE POLL IDLE
  C1	[T] [%] -> ACPI FFH MWAIT 0x0
  C2	[T] [%] -> ACPI IOPORT 0x814

Measurement runs, "cpupower monitor -i 1" and "cpupower monitor -m
Mperf -i 1", print the same output as before, only the listing changed.

Thanks,
Hemanth

Hemanth Selam (1):
  cpupower: monitor: Show how a counter value is exported

 tools/power/cpupower/man/cpupower-monitor.1   |  8 +++++++
 .../utils/idle_monitor/cpupower-monitor.c     | 22 ++++++++++++++++---
 2 files changed, 27 insertions(+), 3 deletions(-)

-- 
2.43.7


             reply	other threads:[~2026-08-18  9:55 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-18  9:55 Hemanth Selam [this message]
2026-08-18  9:55 ` [PATCH 1/1] " Hemanth Selam
2026-09-04 17:54   ` Shuah Khan

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=20260818095538.1196953-1-hemanth.selam@gmail.com \
    --to=hemanth.selam@gmail.com \
    --cc=jkacur@redhat.com \
    --cc=jwyatt@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=shuah@kernel.org \
    --cc=trenn@suse.com \
    /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

all inboxes | Powered by JetHome®