RFR: 8152905: hs_err file is missing gc threads

Daniel D. Daugherty daniel.daugherty at oracle.com
Wed Mar 30 15:44:08 UTC 2016


On 3/29/16 9:32 PM, Derek White wrote:
> Summary: List the GC threads in the hs_err file in the "Other Threads" 
> section
>
> There are 4 small parts to this:
> 1) Fix G1CollectedHeap::gc_threads_do() to also iterate over 
> concurrent mark worker threads.
> 2) Have Thread::print_on_error() print the thread name of NamedThreads.
> 3) Factor out code that prints out each "Other Thread" to 
> Threads::print_on_error().
> 4) Call Threads::print_on_error() on every GC thread.
>
> BUG: 8152905: hs_err file is missing gc threads 
> <https://bugs.openjdk.java.net/browse/JDK-8152905>
> WEBREV: http://cr.openjdk.java.net/~drwhite/8152905/webrev.01/

src/share/vm/runtime/thread.hpp
     No comments.

src/share/vm/runtime/thread.cpp
     L831:   else st->print("Thread");
     L832:
     L833:   if (is_Named_thread()) {
     L834:     st->print(" \"%s\"", name());
     L835:   }

         The new is_Named_thread() check is currently made for
         every thread type, but only applies to the else-statement
         on L831. That else-statement should change into an
         else-block. Perhaps:

         else {
           st->print("Thread");
           if (is_Named_thread()) {
             st->print(" \"%s\"", name());
           }
         }

     L4496:   if (this_thread) {
         Should not use an implied boolean. This should be:

         if (this_thread != NULL) {

     L4533:     bool is_current = (current == thread);
     L4534:     found_current = found_current || is_current;
     L4535:
     L4536:     st->print("%s", is_current ? "=>" : "  ");
     L4537:
     L4538:     st->print(PTR_FORMAT, p2i(thread));
     L4539:     st->print(" ");
     L4540:     thread->print_on_error(st, buf, buflen);
     L4541:     st->cr();

         I think this block can refactor into:

           print_on_error(thread, st, current, buf, buflen, &found_current);

src/share/vm/gc/g1/g1CollectedHeap.cpp
     No comments.

src/share/vm/gc/g1/g1ConcurrentMark.cpp
     No comments.

src/share/vm/gc/g1/g1ConcurrentMark.hpp
     No comments.

Dan


> TESTING:
>  - Tested "java -XX:ErrorHandlerTest=1 -version" on all collectors.
>  - jprt
>
> Thanks,
>
>  - Derek
>



More information about the hotspot-gc-dev mailing list