Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1193539

RE: [PATCH V2 5/6] perf,tools: caculate and save freq/CPU%/CORE_BUSY% in he_stat

From "Liang, Kan" <kan.liang@intel.com>
Newsgroups linux.kernel
Subject RE: [PATCH V2 5/6] perf,tools: caculate and save freq/CPU%/CORE_BUSY% in he_stat
Date 2015-07-28 00:40 +0200
Message-ID <pQZdT-7ag-9@gated-at.bofh.it> (permalink)
References <pPSoa-DT-11@gated-at.bofh.it> <pPSoa-DT-9@gated-at.bofh.it> <pQx7Y-8vk-11@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


> 
> On Fri, Jul 24, 2015 at 09:48:31AM -0400, kan.liang@intel.com wrote:
> 
> SNIP
> 
> >  		},
> >  		.parent = sym_parent,
> >  		.filtered = symbol__parent_filter(sym_parent) | al-
> >filtered, @@
> > -481,6 +486,32 @@ iter_add_next_nop_entry(struct hist_entry_iter
> *iter
> > __maybe_unused,  }
> >
> >  static int
> > +iter_add_single_freq_perf_entry(struct hist_entry_iter *iter, struct
> > +addr_location *al) {
> > +	struct perf_evsel *evsel = iter->evsel;
> > +	struct perf_sample *sample = iter->sample;
> > +	struct hist_entry *he;
> > +	struct freq_perf_info info = {0};
> > +	u64 *data = sample->freq_perf_data;
> > +
> > +	if (data[FREQ_PERF_REF_CYCLES] > 0)
> > +		info.freq = (data[FREQ_PERF_CYCLES] * cpu_max_freq) /
> data[FREQ_PERF_REF_CYCLES];
> > +	if (data[FREQ_PERF_TSC] > 0)
> > +		info.cpu_u = (100 * data[FREQ_PERF_REF_CYCLES]) /
> data[FREQ_PERF_TSC];
> > +	if (data[FREQ_PERF_MPERF] > 0)
> > +		info.core_busy = (100 * data[FREQ_PERF_APERF]) /
> > +data[FREQ_PERF_MPERF];
> 
> seems to me the new iterator is too big gun for this, why not initialize
> 'struct freq_perf_info' in iter_prepare_normal_entry ?
> 
How about initializing in iter_add_single_normal_entry?

We only use freq_perf_info in iter_add_single_normal_entry.
If initializing in iter_prepare_normal_entry, we have to save the
freq_perf_info in hist_entry_iter.

Thanks,
Kan
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Back to linux.kernel | Previous | Next | Find similar | Unroll thread


Thread

RE: [PATCH V2 5/6] perf,tools: caculate and save  freq/CPU%/CORE_BUSY% in he_stat "Liang, Kan" <kan.liang@intel.com> - 2015-07-28 00:40 +0200

csiph-web