Re: [PATCH v1 00/15] Tool and hwmon PMUs

From: Guenter Roeck
Date: Mon Sep 09 2024 - 23:36:24 EST


On 9/9/24 19:21, Ian Rogers wrote:
On Fri, Sep 6, 2024 at 10:08 PM Ian Rogers <irogers@xxxxxxxxxx> wrote:

Rather than have fake and tool PMUs being special flags in an evsel,
create special PMUs. This allows, for example, duration_time to also
be tool/duration_time/. Once adding events to the tools PMU is just
adding to an array, add events for nearly all the expr literals like
num_cpus_online. Rather than create custom logic for finding and
describing the tool events use json and add a notion of common json
for the tool events.

Following the convention of the tool PMU, create a hwmon PMU that
exposes hwmon data for reading. For example, the following shows
reading the CPU temperature and 2 fan speeds alongside the uncore
frequency:
```
$ perf stat -e temp_cpu,fan1,hwmon_thinkpad/fan2/,tool/num_cpus_online/ -M UNCORE_FREQ -I 1000
1.001153138 52.00 'C temp_cpu
1.001153138 2,588 rpm fan1
1.001153138 2,482 rpm hwmon_thinkpad/fan2/
1.001153138 8 tool/num_cpus_online/
1.001153138 1,077,101,397 UNC_CLOCK.SOCKET # 1.08 UNCORE_FREQ
1.001153138 1,012,773,595 duration_time
...
```

+linux-hwmon@xxxxxxxxxxxxxxx as a heads up.


No idea what you are doing, or why. I am not sure if I care, unless you
introduce dependencies on hwmon internals (or, in other words, define
undocumented APIs into hwmon). Which I'd argue would be a no-go.

Guenter