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

From: Greg KH
Date: Tue May 11 2010 - 11:51:39 EST


On Tue, May 11, 2010 at 11:48:42AM +0200, Peter Zijlstra wrote:
> On Tue, 2010-05-11 at 17:40 +0800, Lin Ming wrote:
> > /sys/devices/system/cpu/cpu0/cpu_hw_events/*
> > /sys/devices/system/cpu/cpu0/cpu_hw_cache_events/*
> > /sys/devices/system/cpu/cpu0/cpu_raw_events/*
> > ....
> > ....
> > /sys/devices/system/cpu/cpuN/cpu_hw_events/*
> > /sys/devices/system/cpu/cpuN/cpu_hw_cache_events/*
> > /sys/devices/system/cpu/cpuN/cpu_raw_events/*
> >
> > Is /sys/class/event_sources/* looks like,
> >
> > /sys/class/event_sources/cpu_hw_events0
> > -> /sys/devices/system/cpu/cpu0/cpu_hw_events
> > ...
> > /sys/class/event_sources/cpu_hw_eventsN
> > -> /sys/devices/system/cpu/cpuN/cpu_hw_events
> >
> > /sys/class/event_sources/cpu_hw_cache_events0
> > -> /sys/devices/system/cpu/cpu0/cpu_hw_events
> > ...
> > /sys/class/event_sources/cpu_hw_cache_eventsN
> > -> /sys/devices/system/cpu/cpuN/cpu_hw_events
>
> Hmm, good question.
>
> No all the cpus would have the same event sources. I'm not sure if we
> can make sysfs understand that though (added GregKH and Kay to CC).
>
> Possibly we'd have to place them at the cpu level, like:
>
> /sys/devices/system/cpu/cpu_*_events/

The problem with this is /sys/devices/system/ are the horrid sysdev
structures, which don't play nice (or at all) with the rest of the
driver/device model.

If we fix them up to finally work properly like real devices then we
could do this:

> and have links like:
>
> /sys/devices/system/cpu/cpuN/cpu_*_events ->
> /sys/devices/system/cpu/cpu_*_events/
>
> as well as
>
> /sys/class/event_sources/cpu_*_events ->
> /sys/devices/system/cpu/cpu_*_events/

Like you want to have done.

{sigh}

I guess I'll finally have to start working on this. I had some
conversations at the last Collab Summit with someone on how to properly
fix this all up, I'll go dig for that note and start in on it.

thanks,

greg k-h
--
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/