Interpreting Sampling results

Interpreting Sampling results

Hi,

I have spent quite a lot of time on this, but am obviously
missing from elementary! I did a sampling run with the following
parameters :-

1) Sampling interval = 1 ms (this is the default)
2) Events to sample = Clockticks after 300000 and Instructions Retired after 300000 (modified the default values 3000000)

Now the run shows me for the top 2 functions :-

1)
function1()
Clocktick samples = 1061
Instruction retired samples = 871
Clockticks per instruction retired = 1.218
Clockticks events = 1061*300000
Instructions retired events = 871*300000

2)
function2()
Clocktick samples = 715
Instruction retired samples = 411
Clockticks per instruction retired = 1.740

This is what I understand :-

- After 300000 clockticks, a sample is taken. 1061 such samples found
the Instruction Pointer(IP) to be in function1() and 715 such samples
found the IP in function2()
- After 300000 instructions, a sample is taken. 871 such samples found
the IP to be in function1() and 411 suc samples found the IP in
function2()

Now what I don't understand is how and why should the
Clocktick samples and Instruction retired samples be divided? Aren't
they totally unrelated?

If samples are taken after number of events,
then what is the sampling interval (1ms) in time parameter for?

Thanks in advance!

1 post / 0 new
For more complete information about compiler optimizations, see our Optimization Notice.