lkml.org 
[lkml]   [2014]   [Aug]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 34/41] perf evlist: Add 'system_wide' option
On 08/11/2014 04:12 PM, Jiri Olsa wrote:
> On Mon, Jul 14, 2014 at 01:02:58PM +0300, Adrian Hunter wrote:
>> 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.
>>
>> Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
>> ---
>> tools/perf/util/evlist.c | 45 +++++++++++++++++++++++++++++++++++++--------
>> tools/perf/util/evsel.c | 31 ++++++++++++++++++++++++++-----
>> tools/perf/util/evsel.h | 1 +
>> 3 files changed, 64 insertions(+), 13 deletions(-)
>>
>> diff --git a/tools/perf/util/evlist.c b/tools/perf/util/evlist.c
>> index 282e83e..c295b7b 100644
>> --- a/tools/perf/util/evlist.c
>> +++ b/tools/perf/util/evlist.c
>> @@ -265,17 +265,27 @@ int perf_evlist__add_newtp(struct perf_evlist *evlist,
>> return 0;
>> }
>>
>> +static int perf_evlist__nr_threads(struct perf_evlist *evlist,
>> + struct perf_evsel *evsel)
>> +{
>> + if (evsel->system_wide)
>> + return 1;
>> + else
>> + return thread_map__nr(evlist->threads);
>> +}
>
> how is 'evsel->system_wide' set?

Intel PT sets it for the sched_switch event.




\
 
 \ /
  Last update: 2014-08-12 08:21    [W:0.243 / U:0.820 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site