RFR: 8146948: Add help information to log tags

Kim Barrett kim.barrett at oracle.com
Wed May 4 18:30:53 UTC 2016

> 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

  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.


More information about the hotspot-dev mailing list