RFR: 8229517: Support for optional asynchronous/buffered logging [v2]

Xin Liu xliu at openjdk.java.net
Sun Mar 28 02:05:28 UTC 2021


On Sat, 27 Mar 2021 06:41:35 GMT, Thomas Stuefe <stuefe at openjdk.org> wrote:

>> Xin Liu has updated the pull request incrementally with two additional commits since the last revision:
>> 
>>  - 8229517: Support for optional asynchronous/buffered logging
>>    
>>    add a constraint for the option LogAsyncInterval.
>>  - 8229517: Support for optional asynchronous/buffered logging
>>    
>>    LogMessage supports async_mode.
>>    remove the option AsyncLogging
>>    renanme  the option GCLogBufferSize to AsyncLogBufferSize
>>    move drop_log() to LogAsyncFlusher.
>
> src/hotspot/share/logging/logAsyncFlusher.cpp line 33:
> 
>> 31:     // should cache this object somehow
>> 32:     LogDecorations decorations(_level, _tagset, _decorators);
>> 33:     _output.write_blocking(decorations, _message);
> 
> Would this mean that time dependent decorators get resolved at print time, not when the log happen?

yes, it is.  I just realize that this does distort the timestamps of relevant decorators. 

I explain to Volker why I choose to compress `LogDecorations` to `LogDecorators`.  https://github.com/openjdk/jdk/pull/3135#discussion_r602538305 

This issue is similar to "safepoint-bias" in Java profiler. Those timestamps "bias" to the flusher, but the error is limited to `AsyncLogInterval`.   We could spend extra efforts to keep the original timestamps. Is it worth it?

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

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


More information about the hotspot-dev mailing list