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: <CALCETrWR8hGQehwnnjq8=n9hk6S5uSe9UaRu-iKHXpz+emMWbw@mail.gmail.com>
Date:	Mon, 20 Jul 2015 23:01:38 -0700
From:	Andy Lutomirski <luto@...capital.net>
To:	Stephane Eranian <eranian@...gle.com>
Cc:	Kan Liang <kan.liang@...el.com>,
	Peter Zijlstra <a.p.zijlstra@...llo.nl>,
	"mingo@...hat.com" <mingo@...hat.com>,
	Arnaldo Carvalho de Melo <acme@...nel.org>,
	"ak@...ux.intel.com" <ak@...ux.intel.com>,
	Mark Rutland <mark.rutland@....com>,
	Adrian Hunter <adrian.hunter@...el.com>,
	David Ahern <dsahern@...il.com>, Jiri Olsa <jolsa@...nel.org>,
	Namhyung Kim <namhyung@...nel.org>,
	LKML <linux-kernel@...r.kernel.org>,
	Andy Lutomirski <luto@...nel.org>
Subject: Re: [PATCH RFC V2 1/1] x86, perf: Add a freq pmu driver

On Mon, Jul 20, 2015 at 8:10 PM, Stephane Eranian <eranian@...gle.com> wrote:
> On Mon, Jul 20, 2015 at 8:49 AM, Kan Liang <kan.liang@...el.com> wrote:
>> From: Andy Lutomirski <luto@...nel.org>
>>
>> This patch adds freq PMU to support time and freq related counters
>> includes TSC, IA32_APERF, IA32_MPERF and IA32_PPERF.
>>
>> The events are exposed in sysfs for use by perf stat and other tools.
>> The files are under /sys/devices/freq/events/
>>
>> These events only support system-wide mode counting.
>>
>> The PMU type (attr->type) is PERF_TYPE_FREQ.
>>
>> Example:
>>
>> To caculate the CPU%
>> CPU_Utilization = CPU_CLK_UNHALTED.REF_TSC / TSC
>>
>> $ perf stat -e '{ref-cycles,freq/tsc/}' -C0 -- taskset -c 0 sleep 1
>> 3164023,,ref-cycles,1048387386,100.00
>> 2410812089,,freq/tsc/,1050022373,100.00
>> The CPU% for sleep is 0.13%.
>>
> This event is system-wide only. Thus, the kernel should return
> an error when you try to use it in per-thread mode. That would
> be more consistent with RAPL and uncore events.

I don't know enough about perf's inner workings to be sure, but can't
perf context switch free-running counters like this?

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