From: Arnaldo Carvalho de Melo <acme@redhat.com>
To: Stephane Eranian <eranian@google.com>
Cc: Ingo Molnar <mingo@kernel.org>, Borislav Petkov <bp@alien8.de>,
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>,
Jiri Olsa <jolsa@redhat.com>,
"Yan, Zheng" <zheng.z.yan@intel.com>
Subject: Re: [PATCH v2 0/3] perf,x86: add Intel RAPL PMU support
Date: Tue, 22 Oct 2013 20:18:03 -0200 [thread overview]
Message-ID: <20131022221803.GA3824@infradead.org> (raw)
In-Reply-To: <CABPqkBTBqEUU9p3SwNTXwwJ9j7VQXdofA5DzyoDmw+xJBE-uUw@mail.gmail.com>
Em Tue, Oct 22, 2013 at 06:47:38PM +0200, Stephane Eranian escreveu:
> I have updated my RAPL patches to implement the suggested changes.
> I will post the patch very soon. The new look and feel is as folllows:
> # perf stat -a -e power/energy-cores/,power/energy-pkg/,ref-cycles -I
> 1000 sleep 1000
> # time unit counts events
> 1.000264953 Joules 2.09 power/energy-cores/
> [100.00%]
> 1.000264953 Joules 5.94 power/energy-pkg/
> 1.000264953 160,530,320 ref-cycles
> 2.000640422 Joules 2.07 power/energy-cores/
> 2.000640422 Joules 5.94 power/energy-pkg/
> 2.000640422 152,673,056 ref-cycles
> 3.000964416 Joules 2.08 power/energy-cores/
> 3.000964416 Joules 5.93 power/energy-pkg/
> 3.000964416 158,779,184 ref-cycles
What about:
# perf stat -a -e power/energy-cores/,power/energy-pkg/,ref-cycles -I 1000 sleep 1000
# time events
1.000264953 2.09 Joules power/energy-cores/
1.000264953 5.94 Joules power/energy-pkg/
1.000264953 160,530,320 ref-cycles
2.000640422 2.07 Joules power/energy-cores/
2.000640422 5.94 Joules power/energy-pkg/
2.000640422 152,673,056 ref-cycles
3.000964416 2.08 Joules power/energy-cores/
3.000964416 5.93 Joules power/energy-pkg/
3.000964416 158,779,184 ref-cycles
?
Or even 2.09J power/energy-cores/?
I.e. a perf_evsel__fprintf_value(evsel) would append a unit string, if
available.
- Arnaldo
>
> # ls -1 /sys/devices/power/events/
> energy-cores
> energy-cores.scale
> energy-cores.unit
> energy-pkg
> energy-pkg.scale
> energy-pkg.unit
>
> # cat /sys/devices/power/events/energy-cores.scale
> 2.3e-10
> # cat /sys/devices/power/events/energy-cores.unit
> Joules
>
> Of course, this unit and scaling support is generic and not limited
> to the RAPL events. For now, this only works with events exported
> by the kernel via sysfs.
>
>
>
> On Thu, Oct 17, 2013 at 10:14 AM, Ingo Molnar <mingo@kernel.org> wrote:
> >
> > * Stephane Eranian <eranian@google.com> wrote:
> >
> >> On Wed, Oct 16, 2013 at 7:53 PM, Arnaldo Carvalho de Melo
> >> <acme@redhat.com> wrote:
> >> > Em Wed, Oct 16, 2013 at 03:13:54PM +0200, Stephane Eranian escreveu:
> >> >> On Wed, Oct 16, 2013 at 2:46 PM, Ingo Molnar <mingo@kernel.org> wrote:
> >> >> > 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
> >> >> >
> >> >> Not sure there is already some support for this in perf stat. Arnaldo?
> >> >
> >> > Nope, there is not, we would have to have some table somewhere with
> >> > "event-regexp: unit-string"
> >> >
> >> >> If not that we need another sysfs file to export the unit. Another
> >> >> possibility is for perf stat to recognize the power/* and extract the
> >> >> unit from the event name. In my example power/joules-cores -> joules.
> >> >
> >> > I.e. you would be encoding the counter unit as the suffix, might as well
> >> > call it "power/cores.joules" and use the dot as the separator for the
> >> > unit, but would be just a compact form to encode the counter->unit
> >> > table.
> >>
> >> May be easier to add a sysfs entry with the unit to display.
> >
> > Yes - with no entry meaning a raw 'count' or such.
> >
> > Thanks,
> >
> > Ingo
next prev parent reply other threads:[~2013-10-22 22:18 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
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 [this message]
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=20131022221803.GA3824@infradead.org \
--to=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=mingo@kernel.org \
--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