lkml.org 
[lkml]   [2013]   [Dec]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: [PATCH v0 27/71] perf evlist: Add 'system_wide' option
    On 11/12/13 21:37, David Ahern wrote:
    > On 12/11/13, 5:36 AM, Alexander Shishkin wrote:
    >> From: Adrian Hunter <adrian.hunter@intel.com>
    >>
    >> Add an option to cause a selected event
    >> to be opened always without a pid when
    >> configured by perf_evsel__config().
    >>
    >> This is needed when using the sched_switch
    >> tracepoint to follow object code execution.
    >> sched_switch occurs before the task
    >> switch and so it cannot record it in a
    >> context limited to that task. Note
    >> that also means that sched_switch is
    >> useless when capturing data per-thread,
    >> as is the 'context-switches' software
    >> event for the same reason.
    >
    > This seems like a tailored solution for what is really a generic problem:
    > you need events to have different attributes -- a mix of system wide, task
    > based, with or without callchains and other sample options.

    Actually in this case it is not the attribute but another parameter of the
    perf_event_open syscall, namely the pid. The effect of that is that there
    are potentially fewer file descriptors needed for that event i.e. just 1 per
    cpu compared with 1 per cpu per thread.

    This is a generic solution for the case where you want to mix an event that
    is not tied to a process, with other events that are.

    If it were the attribute it would be easy because 'attr' is a member of
    'struct evsel' so it can simply be changed directly.



    \
     
     \ /
      Last update: 2013-12-12 13:41    [W:3.769 / U:0.048 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site