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]
Date:	Fri, 17 Jul 2015 13:25:53 -0700
From:	Andi Kleen <ak@...ux.intel.com>
To:	kan.liang@...el.com
Cc:	a.p.zijlstra@...llo.nl, mingo@...hat.com, acme@...nel.org,
	eranian@...gle.com, mark.rutland@....com, adrian.hunter@...el.com,
	dsahern@...il.com, jolsa@...nel.org, namhyung@...nel.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 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
--
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