RFR: 8149383: Convert TraceBiasedLocking to Unified Logging

John Rose john.r.rose at oracle.com
Tue Feb 16 22:12:51 UTC 2016


On Feb 16, 2016, at 1:16 PM, Daniel D. Daugherty <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