Andi Kleen wrote:
>> [Suravee] CPU_CLK_UNHALTED event is not ideal for calculating wall-clock time. But I believe users tried to correlate the execution time of an application which is cpu-bound using the number of samples and the processor frequency which should be relatively close.
> It makes lots of assumptions which are very unlikely to be all
> true: no p-states, no turbo, no idle, no switches of the thread between
We (OProfile) make no statement or guarantee that users can make such calculations and expect them to be exact. Nevertheless, since we've found a gaping hole here that results in a large discrepancy with expected values, I see no harm in fixing it. I too, on occasion, have used a cycles-based event as a test to ensure the profiler is reporting something close to expected values. As you said, doing this makes a lot of assumptions, so users need to realize "their mileage will vary". Small variations cannot and will not be accounted for by oprofile.
>>> * Patch1: Query maximum cpu frequency from /sys/devices/system/cpu/cpu<n>/cpufreq/cpuinfo_max_freq by default
>>> (NO CHANGE)
>>> * Patch2: Add comments regarding cpufreq scaling.
>> Even if you wanted to support this, this still wouldn't work with Turbo mode.
>> - Not all processors have the Turbo mode
>> - How do we enable the Intel "Turbo mode" in the Linux?
>> - Where in the Linux could we check for the processor frequency for the turbo mode? If the Turbo-mode frequency is not reported as part of the cpufreq/... , shouldn't it be supported here?
> It's the same with p-states (and a lesser degree switches between CPUs)
> Both with Turbo and with p-states an application simply cannot know when the
> frequency changes. It can change any time. And the counters can change
> when it moves between CPUs.
> Any assumption that cycle counters match wall time is bogus on a modern
> IMHO oprofile should just stop reporting the frequency anyways. It's
> usually misleading.
Maybe . . . but we won't go there now. This would be a user-visible change we'd want to people to play with long before we put out a new release.
> EditLive Enterprise is the world's most technically advanced content
> authoring tool. Experience the power of Track Changes, Inline Image
> Editing and ensure content is compliant with Accessibility Checking.
> oprofile-list mailing list