lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <37D7C6CF3E00A74B8858931C1DB2F077018CCDE5@SHSMSX103.ccr.corp.intel.com>
Date:	Mon, 27 Jul 2015 17:19:23 +0000
From:	"Liang, Kan" <kan.liang@...el.com>
To:	Jiri Olsa <jolsa@...hat.com>
CC:	"a.p.zijlstra@...llo.nl" <a.p.zijlstra@...llo.nl>,
	"acme@...nel.org" <acme@...nel.org>,
	"luto@...nel.org" <luto@...nel.org>,
	"mingo@...hat.com" <mingo@...hat.com>,
	"eranian@...gle.com" <eranian@...gle.com>,
	"ak@...ux.intel.com" <ak@...ux.intel.com>,
	"mark.rutland@....com" <mark.rutland@....com>,
	"Hunter, Adrian" <adrian.hunter@...el.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 V2 5/6] perf,tools: caculate and save
 freq/CPU%/CORE_BUSY% in he_stat



> > -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 ?
> 

Yes, we can initialize it in normal process.
But we only need the freq_perf_info when "--show-freq-perf" is set.
For most of the cases, it wastes time to calculate the unused information
for each sample. That could impact the performance for processing. 

Thanks,
Kan
--
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

Powered by Openwall GNU/*/Linux Powered by OpenVZ