RFR: 8315149: Add hsperf counters for CPU time of internal GC threads [v2]

Jonathan Joo jjoo at openjdk.org
Fri Sep 8 03:27:13 UTC 2023


On Wed, 6 Sep 2023 21:40:15 GMT, Man Cao <manc at openjdk.org> wrote:

>> Jonathan Joo has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   address dholmes@ comments
>
> src/hotspot/share/gc/g1/g1ConcurrentRefineThread.cpp line 85:
> 
>> 83:     if (UsePerfData && os::is_thread_cpu_time_supported() && is_primary()) {
>> 84:       _cr->update_concurrent_refine_threads_cpu_time();
>> 85:     }
> 
> There are two classes for primary thread and secondary refinement thread: `G1PrimaryConcurrentRefineThread` and `G1SecondaryConcurrentRefineThread`. It is probably cleaner to move this part inside `G1PrimaryConcurrentRefineThread` and add a virtual method in `G1ConcurrentRefineThread`. We can get rid of the `is_primary()` check as well.
> 
> 
> class G1ConcurrentRefineThread {
>    virtual void possibly_update_threads_cpu_time() {};
> }
> 
> void G1PrimaryConcurrentRefineThread::possibly_update_threads_cpu_time() {
>   if (UsePerfData && os::is_thread_cpu_time_supported()) {
>     _cr->update_concurrent_refine_threads_cpu_time();
>   }
> }

Sounds good, let me know if this change is how you envisioned it!

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

PR Review Comment: https://git.openjdk.org/jdk/pull/15082#discussion_r1319310921


More information about the hotspot-dev mailing list