Re: [RFC][PATCH] perf: sysfs type id

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Corey Ashford
Date: Tuesday, November 16, 2010 - 7:35 pm

On 11/10/2010 01:05 PM, Peter Zijlstra wrote:

I don't understand the /sys/devices tree much (I will read up on it), 
but this idea looks good to me.

To clarify my understanding a bit and taking the gfx example, in the 
path /sys/class/pmu/radeon0, is the '0' here denoting the 0'th radeon 
chip in the system, or the radeon model number?  I would assume the 0'th 
chip.

So if I assume that now points to a unique radeon chip in the system, 
underneath /sys/class/pmu/radeon0 will be a structure something like:

radeon0/
	event/
		evt0
		..
		evtn

And if there is a second radeon chip, there would be a nearly identical 
tree:

radeon1/
	event/
		evt0
		..
		evtn

Is that correct?

Some of these events may need modifiers / attributes / umasks... 
whatever you want to call them.  And they may need more than one each, 
and they may vary from event to event.  So to add to the hierarchy,
we'd have:

radeon0/
     type (for attr.type)
     event/
         evt0/
             id (a base number for attr.config)
             description (text file - but could be CONFIG_*'d out)
             modifiers/
                 mod0/
                     formula (some ascii syntax for describing how
                              to set .config and/or .config_extra
                              with this modifer's value)
                     description (text - can configure out)
                     constraints (some ascii syntax for describing
                                  the values mod0 can take on)
                 ..
                 modn/
         ..
	evtn/

And this would be replicated for radeon1..n

Maybe all of the "event" directories could be soft links to a common
radeon<model_number> event directory.

When you fully specify an event, you have something like:

/sys/devices/pci0000:00/0000:00:1e.0/0000:0b:01.0/drm/card0/pmu/<event>[:<modifier>=nnn:...]

So it wouldn't end up being strictly a sysfs path anymore, and perf 
would have a bit of parsing work to do, to evaluate the modifiers, using 
the info from constraints, and construct the .type, .config, and 
.config_extra fields using formula.

Or maybe you have some other structure in mind?

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

Messages in current thread:
[RFC][PATCH] perf: sysfs type id, Peter Zijlstra, (Tue Nov 9, 2:45 pm)
Re: [RFC][PATCH] perf: sysfs type id, Kay Sievers, (Tue Nov 9, 3:11 pm)
Re: [RFC][PATCH] perf: sysfs type id, Greg KH, (Tue Nov 9, 3:13 pm)
Re: [RFC][PATCH] perf: sysfs type id, Peter Zijlstra, (Tue Nov 9, 3:22 pm)
Re: [RFC][PATCH] perf: sysfs type id, Kay Sievers, (Tue Nov 9, 3:40 pm)
Re: [RFC][PATCH] perf: sysfs type id, Michael Ellerman, (Tue Nov 9, 4:36 pm)
Re: [RFC][PATCH] perf: sysfs type id, Michael Ellerman, (Tue Nov 9, 6:10 pm)
Re: [RFC][PATCH] perf: sysfs type id, Kay Sievers, (Tue Nov 9, 6:19 pm)
Re: [RFC][PATCH] perf: sysfs type id, Michael Ellerman, (Tue Nov 9, 6:45 pm)
Re: [RFC][PATCH] perf: sysfs type id, Kay Sievers, (Tue Nov 9, 6:59 pm)
Re: [RFC][PATCH] perf: sysfs type id, Kay Sievers, (Tue Nov 9, 7:11 pm)
Re: [RFC][PATCH] perf: sysfs type id, Michael Ellerman, (Tue Nov 9, 8:37 pm)
Re: [RFC][PATCH] perf: sysfs type id, Peter Zijlstra, (Wed Nov 10, 5:27 am)
Re: [RFC][PATCH] perf: sysfs type id, Stephane Eranian, (Wed Nov 10, 6:01 am)
Re: [RFC][PATCH] perf: sysfs type id, Peter Zijlstra, (Wed Nov 10, 7:10 am)
Re: [RFC][PATCH] perf: sysfs type id, Peter Zijlstra, (Wed Nov 10, 7:19 am)
Re: [RFC][PATCH] perf: sysfs type id, Stephane Eranian, (Wed Nov 10, 7:24 am)
Re: [RFC][PATCH] perf: sysfs type id, Greg KH, (Wed Nov 10, 10:31 am)
Re: [RFC][PATCH] perf: sysfs type id, Stephane Eranian, (Wed Nov 10, 1:08 pm)
Re: [RFC][PATCH] perf: sysfs type id, Peter Zijlstra, (Wed Nov 10, 1:32 pm)
Re: [RFC][PATCH] perf: sysfs type id, Stephane Eranian, (Wed Nov 10, 1:53 pm)
Re: [RFC][PATCH] perf: sysfs type id, Peter Zijlstra, (Wed Nov 10, 2:05 pm)
Re: [RFC][PATCH] perf: sysfs type id, Corey Ashford, (Tue Nov 16, 7:35 pm)
Re: [RFC][PATCH] perf: sysfs type id, Kyle Moffett, (Wed Nov 17, 12:02 am)
Re: [RFC][PATCH] perf: sysfs type id, Peter Zijlstra, (Wed Nov 17, 4:25 am)
Re: [RFC][PATCH] perf: sysfs type id, Peter Zijlstra, (Wed Nov 17, 4:30 am)
Re: [RFC][PATCH] perf: sysfs type id, Corey Ashford, (Wed Nov 17, 12:47 pm)
Re: [RFC][PATCH] perf: sysfs type id, Peter Zijlstra, (Wed Nov 17, 12:57 pm)
Re: [RFC][PATCH] perf: sysfs type id, Peter Zijlstra, (Wed Nov 17, 1:01 pm)
Re: [RFC][PATCH] perf: sysfs type id, Corey Ashford, (Wed Nov 17, 2:39 pm)