%ld instead of %d for LogCompilation counts?

Chris Newland cnewland at chrisnewland.com
Fri Dec 5 21:09:01 UTC 2014


Hi,

I've encountered some LogCompilation counters in 8u25 that are getting
printed in exponential form in hotspot.log :

<branch target_bci='20' taken='23867' not_taken='2386581'
cnt='2.38658e+06' prob='0.00990148'/>

This is harder to parse and loses accuracy because %d is used as a
formatter in hotspot/src/share/vm/opto/parse2.cpp:

if (C->log() != NULL) {
      C->log()->elem("branch target_bci='%d' taken='%d' not_taken='%d'",
iter().get_dest(), taken, not_taken);
}

Would it be possible to modify some or all of the LogCompilation format
strings to use %ld so that large integers can be printed without
exponents?

I don't mind going through the OpenJDK motions to submit this as a patch
if it's a sensible idea.

Thanks,

Chris



More information about the hotspot-compiler-dev mailing list