All of lore.kernel.org
 help / color / mirror / Atom feed
From: David Ahern <dsahern@gmail.com>
To: Maynard Johnson <maynardj@us.ibm.com>
Cc: linux-perf-users@vger.kernel.org
Subject: Re: --mmap-pages option seemingly has no effect to help with LOST samples
Date: Fri, 22 Jun 2012 13:23:16 -0600	[thread overview]
Message-ID: <4FE4C624.20908@gmail.com> (raw)
In-Reply-To: <4FE49663.7000908@us.ibm.com>

On 6/22/12 9:59 AM, Maynard Johnson wrote:
> The 'perf record' tool can easily handle a sampling rate of one sample per 100,000 cycles *or* instructions (i.e., one at a time), so I would have expected it to be handle one sample per 500,000 events when profiling on both events?  Am I missing something?
>
> Another related issue is the number of samples being recorded varies wildly when profiling on multiple events.  For example, profiling on just cycles with --count=500000, 'perf report -n' reports ~87k samples.  And profiling on just instructions with the same rate, I get ~102k.  When profiling with both events, I get cycles/instruction sample counts ranging from a low of 6k/7k to a high of 88k/102k.  Usually, I get counts around 12k/15k.  The higher the count seen with 'perf report' (i.e., the closer to true values), the more likely that perf record fails with the "LOST" samples message.


It might well be a RHEL6 problem.

Host OS is 3.4.0
perf version 3.5.rc1.87.gcb9dd4.dirty

Using Peter Z's 1billion instruction, first up is instructions sampling:
$ perf record -fo /tmp/perf.data -e instructions -c 100000 
./loop_1b_instructions

$ perf report --stdio -i /tmp/perf.data -D | tail -12
Aggregated stats:
            TOTAL events:      10161
             MMAP events:        106
             COMM events:          2
             EXIT events:          2
           SAMPLE events:      10051
instructions stats:
            TOTAL events:      10161
             MMAP events:        106
             COMM events:          2
             EXIT events:          2
           SAMPLE events:      10051

1billion instructions sampled every 100,000 = ~10,000 samples which 
corresponds to the above (ish).

And now looking at cycles:

$ perf record -fo /tmp/perf.data -e cycles -c 100000 ./loop_1b_instructions
$ perf report --stdio -i /tmp/perf.data -D | tail -12
Aggregated stats:
            TOTAL events:       7961
             MMAP events:        106
             COMM events:          2
             EXIT events:          2
           SAMPLE events:       7851
cycles stats:
            TOTAL events:       7961
             MMAP events:        106
             COMM events:          2
             EXIT events:          2
           SAMPLE events:       7851


And both events combined:
$ perf record -fo /tmp/perf.data -e cycles -e instructions -c 100000 
./loop_1b_instructions

$ /tmp/pbuild/perf report --stdio -i /tmp/perf.data -D | tail -15
Aggregated stats:
            TOTAL events:      18078
             MMAP events:        106
             COMM events:          2
             EXIT events:          2
           SAMPLE events:      17968
cycles stats:
            TOTAL events:       7900
             MMAP events:          4
             COMM events:          1
             EXIT events:          2
           SAMPLE events:       7893
instructions stats:
            TOTAL events:      10075
           SAMPLE events:      10075

So we get ~10,000 samples due to the instructions event and ~7800 for 
the cycles event.

David

      parent reply	other threads:[~2012-06-22 19:23 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-06-12 20:55 --mmap-pages option seemingly has no effect to help with LOST samples Maynard Johnson
2012-06-12 21:05 ` David Ahern
2012-06-13 15:35   ` Maynard Johnson
2012-06-13 15:48     ` David Ahern
2012-06-22 15:59       ` Maynard Johnson
2012-06-22 16:16         ` David Ahern
2012-06-22 19:20           ` Maynard Johnson
2012-06-22 19:44             ` David Ahern
2012-06-22 20:23               ` Maynard Johnson
2012-06-22 20:38                 ` David Ahern
2012-06-25 14:10                   ` Maynard Johnson
2012-06-26 20:16                     ` David Ahern
2012-06-26 20:32                       ` Maynard Johnson
2012-06-22 19:23         ` David Ahern [this message]

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=4FE4C624.20908@gmail.com \
    --to=dsahern@gmail.com \
    --cc=linux-perf-users@vger.kernel.org \
    --cc=maynardj@us.ibm.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.