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
--
To unsubscribe from this list: send the line "unsubscribe linux-perf-users" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to