On Wed, Nov 10, 2010 at 9:32 PM, Peter Zijlstra <peterz@infradead.org> wrote:
Ok, but I think you're proposal is missing one bit. You are addressing
the class (or type) of PMU, but you are not addressing the naming of
an instance.
Let's take an example, suppose you have counters on a graphic card.
Your system has two such graphic cards. In your scheme you would
end up with a sys/class/pmu/gfx/.....
But now, suppose I want to count cycles on the first graphic card.
Seems to me you need to expose the instances as well. The instance
number needs to be passed in the attr struct somehow.
You can either create multiple subdir under gfx, or have this info somewhere
else in the sysfs tree, if people really care about class vs. instance.
I can see users doing:
$ perf stat -e gfx@1::cycles ... -> sys/class/gfx/1/event/cycles
The reason I am using :: here is because libpfm4 is already using
this as a separator for PMU type vs. event.
--