Re: [RFC][PATCH v2 06/11] perf: core, export pmus via sysfs

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Lin Ming
Date: Tuesday, May 18, 2010 - 11:32 pm

On Wed, 2010-05-19 at 13:00 +0800, Greg KH wrote:

Do you mean the target of the symlink is also a symlink? No.

/sys/devices/system/cpu/events/event_source points
to /sys/devices/system/cpu/event_source.

/sys/devices/system/cpu/event_source/ is a sysfs dir, not a symlink.


Ingo's explanation looks much more clear.

<---snip start--->
We _really_ dont want to call it a 'PMU' but 'events coming from an event
source'.

The reason is that a PMU is an existing term that is quite attached to a CPU -
while many hardware events come not from a PMU. Interrupts, error conditions,
hotplug events, etc. etc.

Furthermore, the name 'PMU' is even less correct for software events.

So lets stick with 'events' and with some container that originates them.
(event_source) Ok?
<---snip end--->


For cpu hardware events(cycles, branch-misses, L1-dcache-loads etc...),
yes.


sysfs, "It provides a means to export kernel data structures, their
attributes, and the linkages between them to userspace."

pmus and events have attributes that userspace tool want to know, for
example, pmu id, event config value.

And they also have linkage, for example, cycles event uses cpu pmu to
handle it, so

/sys/devices/system/cpu/events/cycles/event_source
---> /sys/devices/system/cpu/event_source


No. 

In userspace, open a sysfs file, see patch 11.
Then pass the open file's fd to the syscall sys_perf_event_open.

In kernel, use the passed in fd to find the pmu.


Not export it today.


Want to solve the problem of how to address an "event source".
I thought it's clear to export via sysfs, but, I maybe totally wrong...

Thanks,
Lin Ming


--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Re: [RFC][PATCH v2 06/11] perf: core, export pmus via sysfs, Lin Ming, (Tue May 18, 11:32 pm)
Re: [RFC][PATCH v2 06/11] perf: core, export pmus via sysfs, Borislav Petkov, (Wed May 19, 12:06 am)
Re: [RFC][PATCH v2 06/11] perf: core, export pmus via sysfs, Peter Zijlstra, (Wed May 19, 12:14 am)
Re: [RFC][PATCH v2 06/11] perf: core, export pmus via sysfs, Peter Zijlstra, (Wed May 19, 12:17 am)
Re: [RFC][PATCH v2 06/11] perf: core, export pmus via sysfs, Peter Zijlstra, (Thu May 20, 12:52 pm)
[rfc] Describe events in a structured way via sysfs, Ingo Molnar, (Fri May 21, 2:40 am)
Re: [rfc] Describe events in a structured way via sysfs, Johannes Berg, (Tue Jun 22, 12:33 am)
Re: [rfc] Describe events in a structured way via sysfs, Johannes Berg, (Tue Jun 22, 12:39 am)
Re: [rfc] Describe events in a structured way via sysfs, Johannes Berg, (Tue Jun 22, 12:52 am)
Re: [rfc] Describe events in a structured way via sysfs, Johannes Berg, (Tue Jun 22, 1:16 am)
Re: [rfc] Describe events in a structured way via sysfs, Johannes Berg, (Thu Jun 24, 9:14 am)
Re: [rfc] Describe events in a structured way via sysfs, Ingo Molnar, (Thu Jun 24, 10:33 am)
Re: [rfc] Describe events in a structured way via sysfs, Corey Ashford, (Fri Jul 16, 5:20 pm)
Re: [rfc] Describe events in a structured way via sysfs, Robert Richter, (Tue Jul 20, 8:19 am)
Re: [rfc] Describe events in a structured way via sysfs, Corey Ashford, (Tue Jul 20, 10:43 am)
Re: [rfc] Describe events in a structured way via sysfs, Corey Ashford, (Tue Jul 20, 10:50 am)
Re: [rfc] Describe events in a structured way via sysfs, Robert Richter, (Tue Jul 20, 11:30 am)
Re: [rfc] Describe events in a structured way via sysfs, Corey Ashford, (Tue Jul 20, 2:18 pm)