RFR: 8254877: GCLogPrecious::_lock rank constrains what locks you are allowed to have when crashing [v2]

Stefan Karlsson stefank at openjdk.java.net
Thu Oct 29 09:38:58 UTC 2020


On Wed, 28 Oct 2020 15:02:40 GMT, Per Liden <pliden at openjdk.org> wrote:

>> Stefan Karlsson has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   Review 1
>
> src/hotspot/share/gc/shared/gcLogPrecious.cpp line 93:
> 
>> 91:   }
>> 92: 
>> 93:   _lock->signal();
> 
> As we discussed off-line, perhaps we might want to print something even if the log isn't initialized and/or is empty. Something like:
>   st->print_cr("GC Precious Log:");
> 
>   if (_lines == NULL) {
>     st->print_cr("<Not initialized>");
>     return;
>   }
> 
>   if (!_lock->trywait()) {
>     st->print_cr("<Skipped>");
>     return;
>   }
> 
>   if (_lines->size() == 0) {
>     st->print_cr("<Empty>");
>   } else {
>     st->print_cr("%s", _lines->base());
>   }
> 
>   _lock->signal();
> You decide. Looks good otherwise.

Updated with suggestion. I also added extra newlines to make the output look pretty. That was needed because _lines->base() is always terminated with a newline.

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

PR: https://git.openjdk.java.net/jdk/pull/903


More information about the hotspot-dev mailing list