linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Arnaldo Carvalho de Melo <acme@ghostprotocols.net>
To: Stephane Eranian <eranian@google.com>
Cc: LKML <linux-kernel@vger.kernel.org>,
	Peter Zijlstra <peterz@infradead.org>,
	"mingo@elte.hu" <mingo@elte.hu>,
	"ak@linux.intel.com" <ak@linux.intel.com>,
	Jiri Olsa <jolsa@redhat.com>, Namhyung Kim <namhyung.kim@lge.com>,
	David Ahern <dsahern@gmail.com>
Subject: Re: [PATCH v2 2/2] perf tools: add attr->mmap2 support
Date: Tue, 10 Sep 2013 10:17:28 -0300	[thread overview]
Message-ID: <20130910131728.GE28428@ghostprotocols.net> (raw)
In-Reply-To: <CABPqkBRgj71D8FkWtR-4K8g5ErWMt8YsV7FcmxQ3Uouj640Z0A@mail.gmail.com>

Em Tue, Sep 10, 2013 at 03:05:03PM +0200, Stephane Eranian escreveu:
> On Tue, Sep 10, 2013 at 3:00 PM, Arnaldo Carvalho de Melo <acme@ghostprotocols.net> wrote:
> > Em Mon, Sep 09, 2013 at 04:48:44PM -0300, Arnaldo Carvalho de Melo escreveu:
> > > Em Mon, Sep 09, 2013 at 04:47:45PM -0300, Arnaldo Carvalho de Melo escreveu:
> > > > I noticed the kernel part is in, and I'm going to use MMAP2 on that new
> > > > tool, so tried merging it, but:
> > > >
> > > > I fixed it up wrt another patch that makes machine__find_thread receive pid/tid
> > > > but then 'perf test' complains about it, see below, trying to fix...
> > >
> > > Following patch makes it progress a bit, still checking why it is not
> > > enough...
> >
> > Without your patch:
> >
> > [root@sandy ~]# perf test -v 7
> >  7: Validate PERF_RECORD_* events & perf_sample fields     :
> > --- start ---
> > 61118374953766 0 PERF_RECORD_SAMPLE
> > 61118374958840 0 PERF_RECORD_SAMPLE
> > 61118374961420 0 PERF_RECORD_SAMPLE
> > 61118374964293 0 PERF_RECORD_SAMPLE
> > 61118376117716 0 PERF_RECORD_COMM: sleep:5096
> > 61118376153724 0 PERF_RECORD_MMAP 5096/5096: [0x400000(0x7000) @ 0]: /usr/bin/sleep
> > 61118376190304 0 PERF_RECORD_MMAP 5096/5096: [0x3b7e000000(0x223000) @ 0]: /usr/lib64/ld-2.16.so
> > 61118376229562 0 PERF_RECORD_MMAP 5096/5096: [0x7fff2f9ff000(0x1000) @ 0x7fff2f9ff000]: [vdso]
> > 61118376526654 0 PERF_RECORD_MMAP 5096/5096: [0x3b7e400000(0x3b8000) @ 0]: /usr/lib64/libc-2.16.so
> > 61119377689687 0 PERF_RECORD_EXIT(5096:5096):(5096:5096)
> > ---- end ----
> > Validate PERF_RECORD_* events & perf_sample fields: Ok
> > [root@sandy ~]#
> >
> > So the tstamp grows monotonically, then, after your patch + the patch at the
> > end of this message:
> >
> > [root@sandy ~]# perf test -v 7
> >  7: Validate PERF_RECORD_* events & perf_sample fields     :
> > --- start ---
> > 61315294449606 0 PERF_RECORD_SAMPLE
> > 61315294453161 0 PERF_RECORD_SAMPLE
> > 61315294454441 0 PERF_RECORD_SAMPLE
> > 61315294455709 0 PERF_RECORD_SAMPLE
> > 61315295600899 0 PERF_RECORD_COMM: sleep:6500
> > 27917287430500 342521613 PERF_RECORD_MMAP2 6500/6500: [0x400000(0x7000) @ 0 00:1d 311442 9016]: /usr/bin/sleep
> > MMAP2 going backwards in time, prev=61315295600899, curr=27917287430500
> > MMAP2 with unexpected cpu, expected 0, got 342521613
> > MMAP2 with unexpected pid, expected 6500, got 1701606191
> > MMAP2 with unexpected tid, expected 6500, got 28773
> > 27917287430500 342561333 PERF_RECORD_MMAP2 6500/6500: [0x3b7e000000(0x223000) @ 0 00:1d 309186 9016]: /usr/lib64/ld-2.16.so
> > MMAP2 with unexpected cpu, expected 0, got 342561333
> > MMAP2 with unexpected pid, expected 6500, got 1932408369
> > MMAP2 with unexpected tid, expected 6500, got 111
> > 27917287430500 342600095 PERF_RECORD_MMAP2 6500/6500: [0x7fffbd7dc000(0x1000) @ 0x7fffbd7dc000 00:00 0 0]: [vdso]
> > MMAP2 with unexpected cpu, expected 0, got 342600095
> > MMAP2 with unexpected pid, expected 6500, got 1935963739
> > MMAP2 with unexpected tid, expected 6500, got 23919
> > 27917287430500 342882834 PERF_RECORD_MMAP2 6500/6500: [0x3b7e400000(0x3b8000) @ 0 00:1d 309187 9016]: /usr/lib64/libc-2.16.so
> > MMAP2 with unexpected cpu, expected 0, got 342882834
> > MMAP2 with unexpected pid, expected 6500, got 909192754
> > MMAP2 with unexpected tid, expected 6500, got 7303982
> > 61316297195411 0 PERF_RECORD_EXIT(6500:6500):(6500:6500)
> > ---- end ----
> > Validate PERF_RECORD_* events & perf_sample fields: FAILED!
> > [root@sandy ~]#
> >
> > So everything that is in perf_sample, i.e. in the variable area, selected via
> > sample_type, is invalid for PERF_RECORD_MMAP2.
> >
> > This is on:
> >
> > [root@sandy ~]# uname -a
> > Linux sandy.ghostprotocols.net.home 3.11.0+ #1 SMP Wed Sep 4 16:47:14 BRT 2013 x86_64 x86_64 x86_64 GNU/Linux
> > [root@sandy ~]#
> >
> > Humm, looking at perf_event_mmap_output it seems this was missed, will rebuild
> > a kernel and retest...
> >
> > diff --git a/kernel/events/core.c b/kernel/events/core.c
> > index 2207efc..dd236b6 100644
> > --- a/kernel/events/core.c
> > +++ b/kernel/events/core.c
> > @@ -5039,6 +5039,7 @@ static void perf_event_mmap_output(struct perf_event *event,
> >                 mmap_event->event_id.header.size += sizeof(mmap_event->maj);
> >                 mmap_event->event_id.header.size += sizeof(mmap_event->min);
> >                 mmap_event->event_id.header.size += sizeof(mmap_event->ino);
> > +               mmap_event->event_id.header.size += sizeof(mmap_event->ino_generation);
> >         }
> >
> >         perf_event_header__init_id(&mmap_event->event_id.header, &sample, event);
> >
> Arg, yes, this is missing.
> Do you want to submit the patch?

I will, in some jiffies, just rebooting with the patched kernel to
re-run tperf test.

> Thanks for tracking it down.

np :-)

- Arnaldo

  reply	other threads:[~2013-09-10 13:17 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-08-21 10:10 [PATCH v2 0/2] perf: add new PERF_RECORD_MMAP2 record type Stephane Eranian
2013-08-21 10:10 ` [PATCH v2 1/2] perf: add attr->mmap2 attribute to an event Stephane Eranian
2013-08-22 15:57   ` Arnaldo Carvalho de Melo
2013-09-02  7:41   ` [tip:perf/core] perf: Add " tip-bot for Stephane Eranian
2013-08-21 10:10 ` [PATCH v2 2/2] perf tools: add attr->mmap2 support Stephane Eranian
2013-08-22 10:51   ` Peter Zijlstra
2013-08-30 14:03     ` Stephane Eranian
2013-08-30 14:08       ` Peter Zijlstra
2013-08-30 14:15         ` Stephane Eranian
2013-08-30 17:32           ` Stephane Eranian
2013-08-31  6:00             ` Ingo Molnar
2013-09-09 19:47   ` Arnaldo Carvalho de Melo
2013-09-09 19:48     ` Arnaldo Carvalho de Melo
2013-09-10 13:00       ` Arnaldo Carvalho de Melo
2013-09-10 13:05         ` Stephane Eranian
2013-09-10 13:17           ` Arnaldo Carvalho de Melo [this message]
2013-09-10 19:58             ` Arnaldo Carvalho de Melo
2013-09-10 20:16               ` Arnaldo Carvalho de Melo
2013-09-11 14:42                 ` Stephane Eranian
2013-09-11 14:53                   ` Arnaldo Carvalho de Melo
2013-09-11 15:28                     ` Arnaldo Carvalho de Melo
2013-09-12  6:35                       ` Ingo Molnar
2013-09-10  9:17     ` Peter Zijlstra
2013-09-12 11:10   ` [tip:perf/urgent] perf tools: Add " tip-bot for Stephane Eranian

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20130910131728.GE28428@ghostprotocols.net \
    --to=acme@ghostprotocols.net \
    --cc=ak@linux.intel.com \
    --cc=dsahern@gmail.com \
    --cc=eranian@google.com \
    --cc=jolsa@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=namhyung.kim@lge.com \
    --cc=peterz@infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).