Re: [RFC][PATCH 3/9] perf: export registerred pmus via sysfs

From: Lin Ming
Date: Mon May 10 2010 - 06:12:38 EST


On Mon, 2010-05-10 at 17:40 +0800, Peter Zijlstra wrote:
> On Mon, 2010-05-10 at 17:27 +0800, Lin Ming wrote:
> > Export pmus via sysfs /sys/devices/system/cpu/pmus/0...N
> > The file name is the pmu id, ie, /sys/devices/system/cpu/pmus/N
> > represents pmu id N.
> > So perf tool can use it to initialize perf_event_attr.
>
> Why create a whole new directory, why not:
>
> /sys/devices/system/cpu/cpuN/pmu_id ?


Do you mean /sys/devices/system/cpu/cpuN/pmu_id contain all ids?

For example, each cpu has 4 pmus and the file pmu_id shows something
like,

#cat /sys/devices/system/cpu/cpu0/pmu_id
0 1 2 3

....

#cat /sys/devices/system/cpu/cpuN/pmu_id
0 1 2 3

>
> That way we can simply extend it to things like:
>
> /sys/devices/system/cpu/cpuN/nodeN/pmu_id
> /sys/devices/system/node/nodeN/pmi_id
>
> Instead of having to add something like:
>
> /sys/devices/system/node/pmus/0..N
>
>

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/