RFR: 8079408: Reimplement TraceClassLoading, TraceClassUnloading, and TraceClassLoaderData with Unified Logging.

Ioi Lam ioi.lam at oracle.com
Fri Jan 8 19:40:08 UTC 2016

Hi Max,

Just an overall comment first -- What we should do with -verbose:class?

Of all the logging options, I think -verbose:class is probably the most 
frequently used. I think many existing user scripts would  pass 
-verbose:class as a JVM argument would parse the output. So if we 
completely remove the old output of TraceClassLoading and replace them 
with -Xlog:classload, many existing user scripts would break.

We have 2 choices:

[1] Keep the old behavior of -verbose:class, and add -Xlog:classload as 
an independent/separate output. That was the approach I took with my 
original patch. This is more backwards compatible but also more messy to 

[2] Replace TraceClassLoading completely with  -Xlog:classload. This is 
the approach of your new patch.

I am actually leaning towards #2. I think there will be a LOT of logging 
changes in JDK9 anyway (e.g., the GC logs). So the benefit of just 
keeping -verbose:class working the old way is a bit dubious.

Anyway, I just want to raise this point so we can have a discussion 
about it.


I must have sent you an earlier version of the classload logging. I've 
made a few small changes. Please see 

Please use the changes in these files

Feedback on other files:

"[Opened %s]"  -> "opened: %s"
"[Path %s]"  -> "path: %s"

In general, adding a ":" will make it easier to read (by a human)

Also, keep the old code for TraceClassPaths. This should be fixed later 
when we UL-ize this flag.
  580     if (TraceClassPaths) {
  581       tty->print_cr("[Opened %s]", path);
  582     }

Remove "[]" and "Class unloading: Making nmethod" -> "making nmethod"

Instead of adding "if (log_is_enabled(Debug, classload))", just remove 
this condition from the code.

      || (TraceClassLoading && Verbose)

These logs are really a part of TraceClassPaths, and we can UL-ize it in 
a separate patch.

Remove the [] brackets, and change "Unlinking" -> "unlinking", " %s" -> 
": %s"

"[Opened %s]" -> "opened: %s"

*Remove [] brackets

- Ioi

On 1/7/16 11:10 PM, Max Ockner wrote:
> Hello,
> Please review this unified logging conversion for several related 
> flags in the class loading system.
> Bugs:
> https://bugs.openjdk.java.net/browse/JDK-8079408 (classload, 
> classloaderdata)
> https://bugs.openjdk.java.net/browse/JDK-8142506 (classunload)
> Webrev: http://cr.openjdk.java.net/~mockner/classload.01/
> Summary:
> There are two separate issues here. Originally Ioi and I began working 
> on these fixes in parallel, but eventually it became obvious that the 
> classload and classunload tags needed to be implemented together. This 
> change is a combination of Ioi's change for 8079408 and my change for 
> 8142506.
> (1) "-XX:+TraceClassLoading" ==> "-Xlog:classload=info"
> This flag is added to the alias table. More verbose logging exists at 
> level debug (one level of verbosity up from info)
> (2) "-XX:+TraceClassUnLoading" ==> "-Xlog:classunload=info"
> This flag is added to the alias table. More verbose logging exists at 
> level trace (converted from uses of WizardMode)
> (3) "-XX:+TraceClassLoaderData" ==> "-Xlog:classloaderdata=debug"
> The changes to TraceClassLoading and TraceClassUnloading also effected 
> the implementation of "-verbose:class"
> Tested with: jtreg runtime, runThese with "-Xlog:classload=trace 
> -Xlog:classunload=trace -Xlog:classloaderdata=trace".
> If you have questions about the updates to the classloading log, Ioi 
> can give a better answer than I can.
> Thanks,
> Max

More information about the hotspot-runtime-dev mailing list