lkml.org 
[lkml]   [2010]   [Nov]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [RFC][PATCH] perf: sysfs type id
From
Date
On Wed, 2010-11-10 at 15:10 +0100, Peter Zijlstra wrote:
> On Wed, 2010-11-10 at 14:01 +0100, Stephane Eranian wrote:
> > Peter,
>
> > > 6
> >
> > And then, what do you do with 6?
> > I assume you have to pass it in the attr struct.
>
> perf_event_attr::type, as said in the initial changelog.
>
> > How do you plan on doing this while keeping what is already there?
>
> + if (type < 0) {
> + err = idr_get_new_above(&pmu_idr, pmu, PERF_TYPE_MAX, &type);
>
> and
>
> + rcu_read_lock();
> + pmu = idr_find(&pmu_idr, event->attr.type);
> + rcu_read_unlock();
> + if (pmu)
> + goto unlock;
>
>
> So we start dynamic IDs at the top of the static range, and only do
> dynamic IDs for those that don't already have a static number.

Also note that I picked:

+ perf_pmu_register(&pmu, "cpu", PERF_TYPE_RAW);

as the CPU type, since we can easily provide the raw values in any
listed events, eg.

# cat /sys/.../cpu/events/cycles
0x003c




\
 
 \ /
  Last update: 2010-11-10 15:21    [W:0.097 / U:1.612 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site