RFR: 8149383: Convert TraceBiasedLocking to Unified Logging
David Holmes
david.holmes at oracle.com
Wed Feb 17 01:25:39 UTC 2016
Folks,
Rachel already covered this in her original email:
> A comment on the code: in order to maintain the existing functionality
> of the "(TraceBiasedLocking && (Verbose || !is_bulk))" portions of code,
> it was necessary to create two separate cases in the conversion, one
> each for the info (regular) and trace (verbose) levels. It has been
> asked that the functionality be maintained. The logging statements in
> these chunks do not necessarily have to stay equal to each other in the
> future, which this would facilitate.
As she says the logging statements for the two cases need not stay the
same, so jumping through hoops to try and print the same message under
two different conditions seems like a waste of cycles to me.
Cheers,
David
On 17/02/2016 8:12 AM, John Rose wrote:
> On Feb 16, 2016, at 1:16 PM, Daniel D. Daugherty
> <daniel.daugherty at oracle.com <mailto:daniel.daugherty at oracle.com>> wrote:
>>
>> I really don't like the duplication, but if I remember correctly
>> these are macros so we really can't do something like function
>> pointers or some other trick here. Ouch! This duplication pattern
>> is repeated in several places where the old logging was conditional
>> on two different option variables and a biased locking operational
>> state variable (is_bulk).
>>
>> I suppose the logging framework doesn't have an API that says
>> to log at different levels based on a parameter. Something like:
>
> I agree with Dan. There's got to be a way to factor this code.
>
> Perhaps this is a job for LogMessage: You compose the message,
> and then conditionally commit it to two places.
>
> — John
More information about the hotspot-runtime-dev
mailing list