[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <37D7C6CF3E00A74B8858931C1DB2F0770188E169@SHSMSX103.ccr.corp.intel.com>
Date: Fri, 17 Jul 2015 20:57:36 +0000
From: "Liang, Kan" <kan.liang@...el.com>
To: Andi Kleen <ak@...ux.intel.com>
CC: "a.p.zijlstra@...llo.nl" <a.p.zijlstra@...llo.nl>,
"mingo@...hat.com" <mingo@...hat.com>,
"acme@...nel.org" <acme@...nel.org>,
"eranian@...gle.com" <eranian@...gle.com>,
"mark.rutland@....com" <mark.rutland@....com>,
"Hunter, Adrian" <adrian.hunter@...el.com>,
"dsahern@...il.com" <dsahern@...il.com>,
"jolsa@...nel.org" <jolsa@...nel.org>,
"namhyung@...nel.org" <namhyung@...nel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: RE: [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 concept of tsc, avg and bzy are from turbostat.
Here is the definition from turbostat readme.
- AVG_MHz = APERF_delta/measurement_interval. This is the actual
number of elapsed cycles divided by the entire sample interval
- TSC_MHz = TSC_delta/measurement_interval.
On a system with an invariant TSC, this value will be constant
and will closely match the base frequency value
- Bzy_MHz = TSC_delta/APERF_delta/MPERF_delta/measurement_interval
Only the Bzy_MHz is wrong and has a typo error.
Other formula should be correct.
If it's confusion, I will change the name and make it consistent as turbostat.
> The right way to compute frequency is cycles / ref-cycles TSC can be used
> to accurately compute CPU utilization tsc / ref-cycles
I think I can add the support for frequency and CPU% calculation,
and show them in --stdio.
Thanks,
Kan
>
> It would be useful to report all three metrics.
>
> -Andi
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists