RFR: 8349476: G1: Regularly print CPU usage by thread type

Thomas Schatzl tschatzl at openjdk.org
Wed Feb 12 11:57:29 UTC 2025


Hi all,

  please review this change to print total cpu usage per worker thread group every gc (with `gc+cpu=debug`) to have a better overview about which threads are taking how much CPU.

I considered merging with the gc worker perfcounter update close by, but the opportunity to share code is very little, and the resulting code would be riddled with checking whether the perf counters should be updated or not.

I.e. the only shared code would be the closure with a one-liner calling `os::thread_cpu_time()`; most other code would be different, e.g. determining whether to update the perf counters or not, the actual log messages etc.

Tell me if you think I should try harder to do so.

Testing: gha

Thanks,
  Thomas

-------------

Commit messages:
 - 8349476

Changes: https://git.openjdk.org/jdk/pull/23585/files
  Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=23585&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8349476
  Stats: 43 lines in 2 files changed: 43 ins; 0 del; 0 mod
  Patch: https://git.openjdk.org/jdk/pull/23585.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/23585/head:pull/23585

PR: https://git.openjdk.org/jdk/pull/23585


More information about the hotspot-gc-dev mailing list