lkml.org 
[lkml]   [2013]   [Jul]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH V2 12/15] perf tools: allow non-matching sample types
On 27/06/13 19:39, David Ahern wrote:
> On 6/27/13 1:55 AM, Adrian Hunter wrote:
>> Sample types need not be identical to determine
>> the sample id from the event. Only the position
>> of the sample id needs to be the same.
>>
>> Compatible sample types are ones in which the bits
>> defined by PERF_COMPAT_MASK are the same.
>> 'perf_evlist__config()' forces sample types to be
>> compatible on that basis.
>>
>> Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
>> ---
>> tools/perf/builtin-report.c | 2 +-
>> tools/perf/util/event.h | 14 +++++
>> tools/perf/util/evlist.c | 135
>> ++++++++++++++++++++++++++++++++++++++++++--
>> tools/perf/util/evlist.h | 8 ++-
>> tools/perf/util/evsel.c | 64 ++++++++++++++++++++-
>> tools/perf/util/evsel.h | 10 ++++
>> tools/perf/util/session.c | 8 ++-
>> 7 files changed, 230 insertions(+), 11 deletions(-)
>>

Snip

>
> While this works for a combined S/W and tracepoint events session, I do not
> like promoting sample types to the minimum compatible level for all events
> in the session. perf needs to allow each event to have its own sample_type
> and not force a minimal compatibility.

Why? The impact is small. The kernel API is completely unchanged.

Consider the affected sample members:

PERF_SAMPLE_IP
PERF_SAMPLE_TID
PERF_SAMPLE_TIME
PERF_SAMPLE_ADDR
PERF_SAMPLE_ID
PERF_SAMPLE_CPU
PERF_SAMPLE_STREAM_ID

Of those, perf_evlist__config() always selects PERF_SAMPLE_IP,
PERF_SAMPLE_TID and PERF_SAMPLE_ID, and never selects PERF_SAMPLE_STREAM_ID.
That leaves just:

PERF_SAMPLE_TIME
PERF_SAMPLE_ADDR
PERF_SAMPLE_CPU

PERF_SAMPLE_TIME is always selected when inheriting.

PERF_SAMPLE_TIME and PERF_SAMPLE_CPU are always selected for per-cpu recording.

Under what circumstances would you want 'time' and/or 'cpu' on some events
but not all of them?

Under what circumstances would you want 'addr' but those events are not the
vast majority of the events you record?



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