RFR: 7903618: JMH: Add power events to perf profilers
Aleksey Shipilev
shade at openjdk.org
Sat Feb 3 10:20:10 UTC 2024
On Thu, 28 Dec 2023 13:06:45 GMT, Marc Schreiber <duke at openjdk.org> wrote:
> The Linux tool perf provides collecting energy consumption via Intel's RAPL API. Today's climate crisis does not need to have tools to be as performant as possible it also requires software to be as energy efficient as possible. Thus measuring the energy consumption of processes is a crucial tool.
Apologies for not looking into this more promptly. This looks interesting, thanks!
Are the new events always printed by `perf stat`, or should we request them specifically? Are you planning to amend `perfnorm`/`perfasm` profilers as well, or just supplying the event name there works already?
Could you also go to https://github.com/schrieveslaach/jmh/actions -- and enable testing workflows for your fork? This would test things. Thanks!
jmh-core/src/main/java/org/openjdk/jmh/profile/LinuxPerfProfiler.java line 278:
> 276:
> 277:
> 278: if(!Double.isNaN(joulesCpu)) {
Suggestion:
if (!Double.isNaN(joulesCpu)) {
jmh-core/src/main/java/org/openjdk/jmh/profile/LinuxPerfProfiler.java line 281:
> 279: str.append(String.format(", %s CPU Joules", ScoreFormatter.format(joulesCpu)));
> 280: }
> 281: if(!Double.isNaN(joulesRam)) {
Suggestion:
if (!Double.isNaN(joulesRam)) {
-------------
PR Review: https://git.openjdk.org/jmh/pull/126#pullrequestreview-1860972144
PR Comment: https://git.openjdk.org/jmh/pull/126#issuecomment-1925256025
PR Review Comment: https://git.openjdk.org/jmh/pull/126#discussion_r1477035666
PR Review Comment: https://git.openjdk.org/jmh/pull/126#discussion_r1477035686
More information about the jmh-dev
mailing list