recording rapl/power events
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 elapsedHowever, 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.
Quoted 8 lines · Adrien BAK
However, it seems that I can't record a sequence of power events :
perf record -a -e power/energy-pkg/ sleep 1
Error:
Thesys_perf_event_open()syscall returned with 22 (Invalid argument) for event (power/energy-pkg/)./bin/dmesgmay provide additional information.
NoCONFIG_PERF_EVENTS=ykernel 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
Quoted 10 lines · Vince Weaver
Quoted 8 lines · Adrien BAK
However, it seems that I can't record a sequence of power events :
perf record -a -e power/energy-pkg/ sleep 1
Error:
Thesys_perf_event_open()syscall returned with 22 (Invalid argument) for event (power/energy-pkg/)./bin/dmesgmay provide additional information.
NoCONFIG_PERF_EVENTS=ykernel support configured?
Quoted 8 lines
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 ?
Quoted 5 lines · Adrien BAK
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_eventAPI ?
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
Signature · 1 line
[email protected] -- Speaking for myself only
Hi Andi,
Quoted 9 lines · Andi Kleen
Quoted 5 lines · Adrien BAK
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_eventAPI ?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
Quoted 6 lines
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
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.
Quoted 29 lines · Namhyung Kim
Hi Andi,
Quoted 7 lines · Andi Kleen
Quoted 4 lines · Adrien BAK
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_eventAPI ?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 --stdioThanks,
NamhyungQuoted 5 lines
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 [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html