lkml.org 
[lkml]   [2015]   [Jul]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 8/9] perf,tools: caculate and save tsc/avg/bzy freq in he_stat
> +	if (sample->read.time_running > 0) {
> + freq.tsc_freq = (1000 * sample->tsc) / sample->read.time_running;
> + freq.avg_freq = (1000 * sample->aperf) / sample->read.time_running;
> + if (sample->aperf > 0)
> + freq.bzy_freq = freq.tsc_freq * sample->mperf / sample->aperf;

Sorry didn't notice that earlier. The formula is not correct.
aperf/mperf is not necessarily the frequency, it is essentially a load average
of the CPU. It should be reported as such. Also only the ratio is
architecturally defined.

The right way to compute frequency is cycles / ref-cycles
TSC can be used to accurately compute CPU utilization tsc / ref-cycles

It would be useful to report all three metrics.

-Andi


\
 
 \ /
  Last update: 2015-07-17 22:41    [W:0.192 / U:0.376 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site