* recording rapl/power events
@ 2014-04-21 8:01 Adrien BAK
2014-04-21 14:07 ` Vince Weaver
0 siblings, 1 reply; 6+ messages in thread
From: Adrien BAK @ 2014-04-21 8:01 UTC (permalink / raw)
To: linux-perf-users
Hi everyone,
I am looking into the power (rapl) events introduced in the kernel in
version 3.14.
Right now, I can access those events through perf stat :
perf stat -a -e power/energy-pkg/ sleep 1
Performance counter stats for 'system wide':
17.16 Joules power/energy-pkg/
1.002808169 seconds time elapsed
However, it seems that I can't record a sequence of power events :
perf record -a -e power/energy-pkg/ sleep 1
Error:
The sys_perf_event_open() syscall returned with 22 (Invalid argument)
for event (power/energy-pkg/).
/bin/dmesg may provide additional information.
No CONFIG_PERF_EVENTS=y kernel support configured?
dmesg does not give any information, and, as far as I know, perf_events
are fully supported by my kernel (
Is there some limitation of the power events (or kernel support) I am
unaware of that could explain this behaviour, or is there something
wrong with my setup/configuration ?
How would one procede to record a sequence of power events ?
Thanks in advance
A.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: recording rapl/power events
2014-04-21 8:01 recording rapl/power events Adrien BAK
@ 2014-04-21 14:07 ` Vince Weaver
2014-04-22 2:31 ` Adrien BAK
0 siblings, 1 reply; 6+ messages in thread
From: Vince Weaver @ 2014-04-21 14:07 UTC (permalink / raw)
To: Adrien BAK; +Cc: linux-perf-users
On Mon, 21 Apr 2014, Adrien BAK wrote:
> However, it seems that I can't record a sequence of power events :
>
> perf record -a -e power/energy-pkg/ sleep 1
> Error:
> The sys_perf_event_open() syscall returned with 22 (Invalid argument) for
> event (power/energy-pkg/).
> /bin/dmesg may provide additional information.
> No CONFIG_PERF_EVENTS=y kernel support configured?
RAPL events cannot generate interrupts, so I don't think you can sample
like this.
You can possibly sample using some other event (like one of the software
clock events) and include the RAPL event in the list of events to record,
not sure if that will accomplish what you're trying to do.
Vince
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: recording rapl/power events
2014-04-21 14:07 ` Vince Weaver
@ 2014-04-22 2:31 ` Adrien BAK
2014-04-22 10:17 ` Andi Kleen
0 siblings, 1 reply; 6+ messages in thread
From: Adrien BAK @ 2014-04-22 2:31 UTC (permalink / raw)
To: Vince Weaver; +Cc: linux-perf-users
On 21/04/2014 23:07, Vince Weaver wrote:
> On Mon, 21 Apr 2014, Adrien BAK wrote:
>
>> However, it seems that I can't record a sequence of power events :
>>
>> perf record -a -e power/energy-pkg/ sleep 1
>> Error:
>> The sys_perf_event_open() syscall returned with 22 (Invalid argument) for
>> event (power/energy-pkg/).
>> /bin/dmesg may provide additional information.
>> No CONFIG_PERF_EVENTS=y kernel support configured?
> RAPL events cannot generate interrupts, so I don't think you can sample
> like this.
>
> You can possibly sample using some other event (like one of the software
> clock events) and include the RAPL event in the list of events to record,
> not sure if that will accomplish what you're trying to do.
>
> Vince
This looks promising, although I couldn't find any useful documentation
on this. Do you know if the perf userland tool allows for this kind of
slave-sampling or if I have to build my own tool around the perf_event API ?
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: recording rapl/power events
2014-04-22 2:31 ` Adrien BAK
@ 2014-04-22 10:17 ` Andi Kleen
2014-04-25 8:29 ` Namhyung Kim
0 siblings, 1 reply; 6+ messages in thread
From: Andi Kleen @ 2014-04-22 10:17 UTC (permalink / raw)
To: Adrien BAK; +Cc: Vince Weaver, linux-perf-users
Adrien BAK <adrien.bak@metascale.org> writes:
>
> This looks promising, although I couldn't find any useful
> documentation on this. Do you know if the perf userland tool allows
> for this kind of slave-sampling or if I have to build my own tool
> around the perf_event API ?
perf record supports it (with :S), but none of the reporting tools
unfortunately.
However keep in mind that very rapid sampling of RAPL is not
likely to give useful results. The data only really makes
sense over longer intervals.
-Andi
--
ak@linux.intel.com -- Speaking for myself only
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: recording rapl/power events
2014-04-22 10:17 ` Andi Kleen
@ 2014-04-25 8:29 ` Namhyung Kim
2014-04-30 2:08 ` Adrien BAK
0 siblings, 1 reply; 6+ messages in thread
From: Namhyung Kim @ 2014-04-25 8:29 UTC (permalink / raw)
To: Andi Kleen; +Cc: Adrien BAK, Vince Weaver, linux-perf-users
Hi Andi,
On Tue, 22 Apr 2014 03:17:56 -0700, Andi Kleen wrote:
> Adrien BAK <adrien.bak@metascale.org> writes:
>>
>> This looks promising, although I couldn't find any useful
>> documentation on this. Do you know if the perf userland tool allows
>> for this kind of slave-sampling or if I have to build my own tool
>> around the perf_event API ?
>
> perf record supports it (with :S), but none of the reporting tools
> unfortunately.
It seems it's what --group option of perf report is for?
$ perf record -e '{cycles,power/energy-pkg/}:S' -a sleep 1
$ perf report --group --stdio
Thanks,
Namhyung
>
> However keep in mind that very rapid sampling of RAPL is not
> likely to give useful results. The data only really makes
> sense over longer intervals.
>
> -Andi
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: recording rapl/power events
2014-04-25 8:29 ` Namhyung Kim
@ 2014-04-30 2:08 ` Adrien BAK
0 siblings, 0 replies; 6+ messages in thread
From: Adrien BAK @ 2014-04-30 2:08 UTC (permalink / raw)
To: Namhyung Kim, Andi Kleen; +Cc: Vince Weaver, linux-perf-users
hi Namhyung,
yes it seems. However, when I run what you suggest, I get the following :
perf record -a -e '{cycles,power/energy-pkg/}:S' sleep 1
Error:
The sys_perf_event_open() syscall returned with 22 (Invalid argument)
for event (power/energy-pkg/).
/bin/dmesg may provide additional information.
No CONFIG_PERF_EVENTS=y kernel support configured?
Once again, I'm pretty sure my kernel is correctly configured, as I can
get power measurement using perf stat. Is this a bug somewhere ? Can you
confirm that this works for you and that I should investigate what can
go wrong with my system ?
A.
On 25/04/2014 17:29, Namhyung Kim wrote:
> Hi Andi,
>
> On Tue, 22 Apr 2014 03:17:56 -0700, Andi Kleen wrote:
>> Adrien BAK <adrien.bak@metascale.org> writes:
>>> This looks promising, although I couldn't find any useful
>>> documentation on this. Do you know if the perf userland tool allows
>>> for this kind of slave-sampling or if I have to build my own tool
>>> around the perf_event API ?
>> perf record supports it (with :S), but none of the reporting tools
>> unfortunately.
> It seems it's what --group option of perf report is for?
>
> $ perf record -e '{cycles,power/energy-pkg/}:S' -a sleep 1
>
> $ perf report --group --stdio
>
>
> Thanks,
> Namhyung
>
>> However keep in mind that very rapid sampling of RAPL is not
>> likely to give useful results. The data only really makes
>> sense over longer intervals.
>>
>> -Andi
> --
> To unsubscribe from this list: send the line "unsubscribe linux-perf-users" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2014-04-30 8:07 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-04-21 8:01 recording rapl/power events Adrien BAK
2014-04-21 14:07 ` Vince Weaver
2014-04-22 2:31 ` Adrien BAK
2014-04-22 10:17 ` Andi Kleen
2014-04-25 8:29 ` Namhyung Kim
2014-04-30 2:08 ` Adrien BAK
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).