From: Stephane Eranian <eranian@google.com>
To: Borislav Petkov <bp@alien8.de>
Cc: LKML <linux-kernel@vger.kernel.org>,
Peter Zijlstra <peterz@infradead.org>,
"mingo@elte.hu" <mingo@elte.hu>,
"ak@linux.intel.com" <ak@linux.intel.com>,
Arnaldo Carvalho de Melo <acme@redhat.com>,
Jiri Olsa <jolsa@redhat.com>,
"Yan, Zheng" <zheng.z.yan@intel.com>
Subject: Re: [PATCH v1 0/2] perf,x86: add Intel RAPL PMU support
Date: Mon, 7 Oct 2013 18:24:18 +0200 [thread overview]
Message-ID: <CABPqkBShrCr0ycApxLFFhUCeu5=mFMw=w9HNPKd1FV7DNTN6Hw@mail.gmail.com> (raw)
In-Reply-To: <20131007161928.GC5517@pd.tnic>
On Mon, Oct 7, 2013 at 6:19 PM, Borislav Petkov <bp@alien8.de> wrote:
> On Mon, Oct 07, 2013 at 06:09:15PM +0200, Stephane Eranian wrote:
>> The counters all count in the same unit. The perf_events API
>> exposes all RAPL counters as 64-bit integers counting in unit
>> of 1/2^32 Joules (or 0.23 nJ). User level tools must convert
>> the counts by multiplying them by 0.23 and divide 10^9 to
>> obtain Joules. The reason for this is that the kernel avoids
>> doing floating point math whenever possible because it is
>> expensive (user floating-point state must be saved). The method
>> used avoids kernel floating-point and minimizes the loss of
>> precision (bits). Thanks to PeterZ for suggesting this approach.
>>
>> To convert the raw count in Watt: W = C * 0.23 / (1e9 * time)
>
> ...
>
>> $ perf stat -a -e rapl/rapl-energy-cores/,rapl/rapl-energy-pkg/ -I 1000 sleep 10
>> time counts events
>> 1.000345931 772 278 493 rapl/rapl-energy-cores/
>> 1.000345931 55 539 138 560 rapl/rapl-energy-pkg/
>> 2.000836387 771 751 936 rapl/rapl-energy-cores/
>> 2.000836387 55 326 015 488 rapl/rapl-energy-pkg/
>
> So can we do the Watt conversion in perf tool and make that "counts"
> output more human-friendly like what those numbers are, to which
> core/LLC they belong, etc, etc?
>
We could but that means we would need to special case the events in perf.
I was trying to avoid that.
> Thanks.
>
> --
> Regards/Gruss,
> Boris.
>
> Sent from a fat crate under my desk. Formatting is fine.
> --
next prev parent reply other threads:[~2013-10-07 16:24 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-10-07 16:09 [PATCH v1 0/2] perf,x86: add Intel RAPL PMU support Stephane Eranian
2013-10-07 16:09 ` [PATCH v1 1/2] " Stephane Eranian
2013-10-07 17:55 ` Andi Kleen
2013-10-07 18:08 ` Peter Zijlstra
2013-10-07 19:22 ` Andi Kleen
2013-10-07 20:33 ` Peter Zijlstra
2013-10-08 7:36 ` Ingo Molnar
2013-10-07 20:58 ` Stephane Eranian
2013-10-07 21:45 ` Andi Kleen
2013-10-07 22:38 ` Stephane Eranian
2013-10-08 15:10 ` Stephane Eranian
2013-10-07 16:09 ` [PATCH v1 2/2] perf,x86: add RAPL hrtimer support Stephane Eranian
2013-10-07 16:19 ` [PATCH v1 0/2] perf,x86: add Intel RAPL PMU support Borislav Petkov
2013-10-07 16:24 ` Stephane Eranian [this message]
2013-10-07 16:42 ` Borislav Petkov
2013-10-07 16:29 ` Peter Zijlstra
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='CABPqkBShrCr0ycApxLFFhUCeu5=mFMw=w9HNPKd1FV7DNTN6Hw@mail.gmail.com' \
--to=eranian@google.com \
--cc=acme@redhat.com \
--cc=ak@linux.intel.com \
--cc=bp@alien8.de \
--cc=jolsa@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=peterz@infradead.org \
--cc=zheng.z.yan@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).