On Wed, 22 Nov 2023 23:08:36 GMT, Jonathan Joo <j...@openjdk.org> wrote:

>> 8315149: Add hsperf counters for CPU time of internal GC threads
>
> Jonathan Joo has updated the pull request incrementally with one additional 
> commit since the last revision:
> 
>   Cleanup and address comments

My additional testing found a failure when running: 
`sun/tools/jstat/jstatSnap1.sh`

When running `jstat -snap 0` (which is what the test does) with this change the 
new counters are displayed even though they belong to the unsupported namespace 
"sun.". From what I can tell, the reason for this is that when creating a new 
subsystem namespace we need to create three of them, one for each top-level 
namespace. Otherwise the code trying to figure out if this is supported or not 
is tripped over. 

I've suggested two changes to do this and with those the test in question no 
longer fails. 

It would be good if someone better familiar with jstat/perf-counter code 
verifies that this is how it should be solved.

src/hotspot/share/runtime/perfData.cpp line 76:

> 74:   "com.sun.threads",
> 75:   "sun.threads",
> 76:   "sun.threads.cpu_time",  // Subsystem for Sun Threads CPU times

Suggestion:

  "java.threads.cpu_time", //Thread CPU time name spaces
  "com.sun.threads.cpu_time",
  "sun.threads.cpu_time",

src/hotspot/share/runtime/perfData.hpp line 64:

> 62:   COM_THREADS,
> 63:   SUN_THREADS,
> 64:   SUN_THREADS_CPUTIME,  // Subsystem for Sun Threads CPU times

Suggestion:

  JAVA_THREADS_CPUTIME, // Thread CPU time name spaces
  COM_THREADS_CPUTIME,
  SUN_THREADS_CPUTIME,

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

Changes requested by sjohanss (Reviewer).

PR Review: https://git.openjdk.org/jdk/pull/15082#pullrequestreview-1750253595
PR Review Comment: https://git.openjdk.org/jdk/pull/15082#discussion_r1406050140
PR Review Comment: https://git.openjdk.org/jdk/pull/15082#discussion_r1406047123

Reply via email to