RFR: 8146948: Add help information to log tags

Marcus Larsson marcus.larsson at oracle.com
Mon May 9 07:36:11 UTC 2016

Hi Kim,

On 05/04/2016 08:30 PM, Kim Barrett wrote:
>> On Apr 14, 2016, at 9:48 AM, Marcus Larsson <marcus.larsson at oracle.com> wrote:
>> Hi,
>> Please review the following patch to add descriptions to logging tagsets.
>> Summary:
>> Tagsets may now be given a description in logTagSetDescriptions.inline.hpp. All described tagsets are listed in the -Xlog:help output as well as in the LogConfiguration::describe output. The patch also adds trace level logging that lists *all* tagsets in the VM (-Xlog:logging=trace). The previous 'logging=trace logging' has been moved to 'logging=debug'.
>> Example log output:
>> ...
>> [0.544s][debug][logging] Described tag combinations:
>> [0.544s][debug][logging]  logging: Logging for the log framework itself
>> ...
>> [0.544s][trace][logging] All available tag sets: arguments, biasedlocking, classinit, classload, classload+constraints, classload+preorder, classloaderdata, classpath, classresolve, classunload, constraints, defaultmethods, ergo, exceptions, gc, gc+age, gc+alloc, gc+alloc+region, gc+barrier, gc+bot, gc+classhisto, gc+classhisto+start, gc+compaction, gc+cpu, gc+ergo, gc+ergo+cset, gc+ergo+heap, gc+ergo+ihop, gc+ergo+refine, gc+freelist, gc+freelist+census, gc+freelist+stats, gc+heap, gc+heap+coops, gc+heap+exit, gc+heap+region, gc+humongous, gc+ihop, gc+jni, gc+liveness, gc+marking, gc+marking+start, gc+metaspace, gc+metaspace+alloc, gc+metaspace+freelist, gc+phases, gc+phases+start, gc+phases+task, gc+phases+verify, gc+phases+verify+start, gc+plab, gc+promotion, gc+ref, gc+ref+start, gc+refine, gc+region, gc+remset, gc+remset+exit, gc+remset+scrub, gc+scavenge, gc+start, gc+state, gc+stats, gc+stringdedup, gc+stringtable, gc+survivor, gc+sweep, gc+task, gc+task+stats, gc+task+thread, gc+task+time, gc+tlab, gc+verify, gc+verify+start, gc+workgang, heap+ergo, itables, jfr, jfr+instrumentation, jfr+types, logging, logging+test, modules, monitorinflation, monitormismatch, os, os+cpu, os+thread, pagesize, protectiondomain, ref, safepoint, safepointcleanup, stacktrace, startuptime, verification, vmoperation, vtables
>> Webrev:
>> http://cr.openjdk.java.net/~mlarsson/8146948/webrev.00/
>> Issue:
>> https://bugs.openjdk.java.net/browse/JDK-8146948
>> Testing:
>> Internal VM tests through RBT
>> Thanks,
>> Marcus
> ------------------------------------------------------------------------------
> src/share/vm/logging/logTagSetDescriptions.inline.hpp
>    39 static struct LogTagSetDescription {
>    40   const LogTagSet* tagset;
>    41   const char* descr;
>    42 } tagset_descriptions[] = {
>    44   { NULL, NULL }
>    45 };
> Won't this place a copy of the descriptions in each translation unit
> that includes this file, each in it's own file-scoped
> tagset_descriptions variable?  I think better would be a class
> definition with a static const array member in the header, with the
> member definition (including the associated macrology) in a .cpp file.

The intention is that this file should only be included from 
logTagSet.cpp and therefore not cause any copying of the descriptions. 
The first approach was just to have them in logTagSet.cpp but I wanted 
an easy to find place for where to add/edit descriptions so I opted for 
a separate file. I didn't want to make a whole hpp/cpp pair for it, but 
if you still think that would be better I can do it; let me know.


More information about the hotspot-dev mailing list