lkml.org 
[lkml]   [2013]   [Aug]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH v1 1/2] perf: add attr->mmap2 attribute to an event
From
On Thu, Aug 15, 2013 at 12:26 PM, Peter Zijlstra <peterz@infradead.org> wrote:
>
> On Tue, Aug 13, 2013 at 01:55:56PM +0200, Stephane Eranian wrote:
>
> > @@ -638,6 +639,25 @@ enum perf_event_type {
> > */
> > PERF_RECORD_SAMPLE = 9,
> >
> > + /*
> > + * The MMAP2 records are an augmented version of MMAP, they add
> > + * maj, min, ino numbers to be used to uniquely identify each mapping
> > + *
> > + * struct {
> > + * struct perf_event_header header;
> > + *
> > + * u32 pid, tid;
> > + * u64 addr;
> > + * u64 len;
> > + * u64 pgoff;
> > + * u32 maj;
> > + * u32 min;
> > + * u64 ino;
> > + * char filename[];
>
> Did you forget the sample_id stuff?
>
> struct sample_id sample_id;
>
This is added automatically by the kernel if attr->sample_id_all is
set. I checked the perf tool. It enables this when you're sampling
on more than one event. So everything works as expected.
I assume you comment was about adding the sample_id in the
description of the struct. I will add that.


>
> > + * };
> > + */
> > + PERF_RECORD_MMAP2 = 10,
> > +
> > PERF_RECORD_MAX, /* non-ABI */
> > };


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