lkml.org 
[lkml]   [2010]   [May]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: [RFC][PATCH 3/9] perf: export registerred pmus via sysfs

    * Peter Zijlstra <peterz@infradead.org> wrote:

    > On Tue, 2010-05-11 at 11:18 +0200, Ingo Molnar wrote:
    > > * Peter Zijlstra <peterz@infradead.org> wrote:
    > >
    > > > The new PMUs will use a dynamic range that starts at PERF_TYPE_MAX.
    > >
    > > I dont think we should use a dynamic range of event sources - it's a
    > > completely useless indirection that has no meaning to humans.
    > >
    > > As far as machine interfaces go a much cleaner approach would be to allow an
    > > open fd to a sysfs file to be passed to sys_perf_event_open() - this would
    > > identify the event source. This needs a small extension of the ABI but we
    > > could thus get rid of the 'type' enumeration altogether and express _all_
    > > event sources via fds to sysfs files.
    >
    > Whatever, that's almost identical. [...]

    It's not identical: as we dont expose our mapping structure externally and
    dont have to have some dynamic type ID allocation layer/mechanism. Also, using
    fds is an elegant, Linuxish way of expressing some object's identity and
    passing it along.

    ( It also removes the possibility to intentionally or accidentally have type
    IDs that are not reachable via the sysfs and vica verse. )

    > [...] What we can do is reserve perf_event_attr::type with bit 31 set for
    > fd's and use the fd->file lookup instead of the type->pmu lookup.

    Yeah, that sounds good.

    Ingo


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