tud-zih-energy / lo2s

Linux OTF2 Sampling - A Lightweight Node-Level Performance Monitoring Tool
https://tu-dresden.de/zih/forschung/projekte/lo2s?set_language=en
GNU General Public License v3.0
45 stars 13 forks source link

cpumask support for PMU events #259

Closed tilsche closed 4 months ago

tilsche commented 1 year ago

Consider uncore_clock/clockticks/ on alderlake. Apparently this event cannot be recorded on a pid, but only on a cpu. So currently, with lo2s it can only be recorded with -a --userspace-metric-event uncore_clock/clockticks/. At least -a should not be necessary, we should automatically chose the right PID/CPU scope.

That should be based on /sys/bus/event_source/devices/*/cpumask (since Linux 3.7)

The cpumask file contains a comma-separated list of integers that indicate a representative CPU number for each socket (package) on the motherboard. This is needed when setting up uncore or northbridge events, as those PMUs present socket-wide events.

See also related perf commit.

cvonelm commented 1 year ago

This is in general a problem in two parts:

I personally dislike any solution for the latter that implicitly does stuff such as detecting the cpumask field and then setting up the metric per-CPU. I think there should be some explicit syntax for that.

cvonelm commented 4 months ago

Fixed in https://github.com/tud-zih-energy/lo2s/commit/4a3fa91130fb4a3d52cd3c7cc514e5fef855f638