0
votes

When executing perf record command on the same program with the same sampling frequency but with different events.

Should not the sample size be almost equal regardless of what event is counted for?

I'm executing a workload (execution time = 65ms) with same sampling frequency. When counting for cycles event, sample size is almost 1000 samples but when counting for cache misses event sample size is almost 150 samples! Why is this? Should not sample size be equal if the workload and sampling frequency is the same?

1

1 Answers

2
votes

If you request a specific frequency (# of samples per second), the kernel will try to find a sampling period (# of events between samples) to achieve the requested frequency. This doesn't always work, especially for short workloads and events with dynamic rates.