public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Ingo Molnar <mingo@kernel.org>
To: Borislav Petkov <bp@alien8.de>
Cc: Stephane Eranian <eranian@google.com>,
	linux-kernel@vger.kernel.org, peterz@infradead.org,
	mingo@elte.hu, ak@linux.intel.com, acme@redhat.com,
	jolsa@redhat.com, zheng.z.yan@intel.com
Subject: Re: [PATCH v2 0/3] perf,x86: add Intel RAPL PMU support
Date: Wed, 16 Oct 2013 14:46:27 +0200	[thread overview]
Message-ID: <20131016124627.GA2611@gmail.com> (raw)
In-Reply-To: <20131010180049.GD9929@pd.tnic>


So, the RAPL patch-set clearly needs more work.

* Borislav Petkov <bp@alien8.de> wrote:

> On Thu, Oct 10, 2013 at 04:50:05PM +0200, Stephane Eranian wrote:
> > $ 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/

Why is there the rapl/rapl duplication in the event name? It should be 
rapl/energy-cores, rapl/energy-pkg, etc.

I'm also not sure about the Intel-specific naming. Joules per core and 
Joules per socket ought to be pretty generic, even if the initial 
implementation is Intel-only. I.e.:

	power/energy-core
	power/energy-pkg

> Hmm, so I'm looking at builtin-stat.c::print_interval() and since it 
> gets the perf_evsel counters and you can deduce the counter name from 
> it, you probably could match the rapl counters and do the Watts 
> conversion above as a special case.
> 
> I dunno, it is much better than having some naked numbers for which 
> people have to go stare at the sources + CPU vendor docs as to what they 
> actually mean.

So what should happen here is to extend the sysfs attributes that tell us 
that it's in 32.32 fixed-point format.

We should also tell user-space that the unit of this counter is 'Joule'.

Then things like:

	perf stat -a -e power/* sleep 1

would output, without knowing any RAPL details:

            0.20619 Joule    power/energy-core
            2.42151 Joule    power/energy-pkg

or so.

Other platforms offering energy measurement facilities will then name 
their counters in the same power/* (or energy/*) namespace, with new names 
if they do something fundamentally differently.

Tooling can then generalize along these abstractions, as much as the 
hardware allows it.

Thanks,

	Ingo

  reply	other threads:[~2013-10-16 12:46 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-10-10 14:50 [PATCH v2 0/3] perf,x86: add Intel RAPL PMU support Stephane Eranian
2013-10-10 14:50 ` [PATCH v2 1/3] perf: add active_entry list head to struct perf_event Stephane Eranian
2013-10-10 14:50 ` [PATCH v2 2/3] perf,x86: add Intel RAPL PMU support Stephane Eranian
2013-10-10 14:50 ` [PATCH v2 3/3] perf,x86: add RAPL hrtimer support Stephane Eranian
2013-10-10 17:43 ` [PATCH v2 0/3] perf,x86: add Intel RAPL PMU support Andi Kleen
2013-10-10 18:00 ` Borislav Petkov
2013-10-16 12:46   ` Ingo Molnar [this message]
2013-10-16 13:13     ` Stephane Eranian
2013-10-16 17:53       ` Arnaldo Carvalho de Melo
2013-10-16 18:14         ` Stephane Eranian
2013-10-17  8:14           ` Ingo Molnar
2013-10-17  9:07             ` Peter Zijlstra
2013-10-17  9:12               ` Borislav Petkov
2013-10-17 20:09               ` Stephane Eranian
2013-10-22 16:47             ` Stephane Eranian
2013-10-22 22:18               ` Arnaldo Carvalho de Melo
2013-10-23  9:34                 ` Stephane Eranian
2013-10-23 14:22                   ` Arnaldo Carvalho de Melo
2013-10-23 14:33                     ` Stephane Eranian
2013-10-23  7:07               ` Andi Kleen
2013-10-23  9:24                 ` Stephane Eranian

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=20131016124627.GA2611@gmail.com \
    --to=mingo@kernel.org \
    --cc=acme@redhat.com \
    --cc=ak@linux.intel.com \
    --cc=bp@alien8.de \
    --cc=eranian@google.com \
    --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