[Intel-gfx] [RFC 04/10] drm/i915: Expose a PMU interface for perf queries

Peter Zijlstra peterz at infradead.org
Wed Aug 23 18:01:34 UTC 2017


On Wed, Aug 23, 2017 at 05:51:38PM +0000, Rogozhkin, Dmitry V wrote:

> https://patchwork.freedesktop.org/patch/171953/. This patch makes 'perf
> stat -e i915/rcs0-busy/' to error out and supports 'perf stat -e
> i915/rcs0-busy/ -a -C0'. I still think I miss something since 'perf stat
> -e i915/rcs0-busy/ -a' will give metrics multiplied by number of active
> CPUs, but that's look closer to what is needed.

IIRC an uncore PMU should expose a cpumask through sysfs, and then perf
tools will read that mask and auto-magically limit the number of CPUs it
instantiates the counter on.

See for instance arch/x86/events/intel/cstate.c, that is a fairly
trivial uncore PMU, look for "DEVICE_ATTR(cpumask".

For example, on my 2 socket 10 core ivb-ep:

root at ivb-ep:~# cat /sys/bus/event_source/devices/cstate_pkg/cpumask
0,10



More information about the Intel-gfx mailing list