Re: [PATCH 8/9] perf,tools: caculate and save tsc/avg/bzy freq in he_stat

2015-07-17 Thread Andi Kleen
> The concept of tsc, avg and bzy are from turbostat. > Here is the definition from turbostat readme. turbostat can do this because it is model specific, but perf user code is not. It has to be architectural definitions only. And the architectural definition of ASTATE MSTATE in the SDM is that

RE: [PATCH 8/9] perf,tools: caculate and save tsc/avg/bzy freq in he_stat

2015-07-17 Thread Liang, Kan
> > > + 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

Re: [PATCH 8/9] perf,tools: caculate and save tsc/avg/bzy freq in he_stat

2015-07-17 Thread Andi Kleen
> + 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 =

RE: [PATCH 8/9] perf,tools: caculate and save tsc/avg/bzy freq in he_stat

2015-07-17 Thread Liang, Kan
+ 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 *

Re: [PATCH 8/9] perf,tools: caculate and save tsc/avg/bzy freq in he_stat

2015-07-17 Thread Andi Kleen
The concept of tsc, avg and bzy are from turbostat. Here is the definition from turbostat readme. turbostat can do this because it is model specific, but perf user code is not. It has to be architectural definitions only. And the architectural definition of ASTATE MSTATE in the SDM is that it

Re: [PATCH 8/9] perf,tools: caculate and save tsc/avg/bzy freq in he_stat

2015-07-17 Thread Andi Kleen
+ 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 *

[PATCH 8/9] perf,tools: caculate and save tsc/avg/bzy freq in he_stat

2015-07-16 Thread kan . liang
From: Kan Liang Introduce a new hist_iter ops (hist_iter_freq) to caculate the tsc/avg/bzy freq when processing samples, and save them in hist_entry. Signed-off-by: Kan Liang --- tools/perf/builtin-annotate.c | 2 +- tools/perf/builtin-diff.c | 2 +- tools/perf/tests/hists_link.c | 4

[PATCH 8/9] perf,tools: caculate and save tsc/avg/bzy freq in he_stat

2015-07-16 Thread kan . liang
From: Kan Liang kan.li...@intel.com Introduce a new hist_iter ops (hist_iter_freq) to caculate the tsc/avg/bzy freq when processing samples, and save them in hist_entry. Signed-off-by: Kan Liang kan.li...@intel.com --- tools/perf/builtin-annotate.c | 2 +- tools/perf/builtin-diff.c | 2 +-