# HG changeset patch # User coleenp # Date 1461121921 0 # Node ID daf6ed16c5db7d38d9a058e8ecf1e6cb0848d7d2 # Parent db6541410dfbff17b5dfea7c2dbe89c9ee20e585# Parent 1a816b464178fc23a9f52268a810f33241dc0ea3 Merge diff -r db6541410dfb -r daf6ed16c5db hotspot/src/share/vm/logging/logConfiguration.cpp --- a/hotspot/src/share/vm/logging/logConfiguration.cpp Thu Apr 21 02:58:04 2016 -0400 +++ b/hotspot/src/share/vm/logging/logConfiguration.cpp Wed Apr 20 03:12:01 2016 +0000 @@ -382,7 +382,7 @@ return true; } -void LogConfiguration::describe(outputStream* out) { +void LogConfiguration::describe_available(outputStream* out){ out->print("Available log levels:"); for (size_t i = 0; i < LogLevel::Count; i++) { out->print("%s %s", (i == 0 ? "" : ","), LogLevel::name(static_cast(i))); @@ -402,7 +402,9 @@ } out->cr(); - ConfigurationLock cl; +} + +void LogConfiguration::describe_current_configuration(outputStream* out){ out->print_cr("Log output configuration:"); for (size_t i = 0; i < _n_outputs; i++) { out->print("#" SIZE_FORMAT ": %s %s ", i, _outputs[i]->name(), _outputs[i]->config_string()); @@ -416,6 +418,12 @@ } } +void LogConfiguration::describe(outputStream* out) { + describe_available(out); + ConfigurationLock cl; + describe_current_configuration(out); +} + void LogConfiguration::print_command_line_help(FILE* out) { jio_fprintf(out, "-Xlog Usage: -Xlog[:[what][:[output][:[decorators][:output-options]]]]\n" "\t where 'what' is a combination of tags and levels on the form tag1[+tag2...][*][=level][,...]\n" diff -r db6541410dfb -r daf6ed16c5db hotspot/src/share/vm/logging/logConfiguration.hpp --- a/hotspot/src/share/vm/logging/logConfiguration.hpp Thu Apr 21 02:58:04 2016 -0400 +++ b/hotspot/src/share/vm/logging/logConfiguration.hpp Wed Apr 20 03:12:01 2016 +0000 @@ -37,6 +37,7 @@ // kept implicitly in the LogTagSets and their LogOutputLists. During configuration the tagsets // are iterated over and updated accordingly. class LogConfiguration : public AllStatic { + friend class VMError; public: // Function for listeners typedef void (*UpdateListenerFunction)(void); @@ -79,6 +80,11 @@ // This should be called after any configuration change while still holding ConfigurationLock static void notify_update_listeners(); + // Respectively describe the built-in and runtime dependent portions of the configuration. + static void describe_available(outputStream* out); + static void describe_current_configuration(outputStream* out); + + public: // Initialization and finalization of log configuration, to be run at vm startup and shutdown respectively. static void initialize(jlong vm_start_time); diff -r db6541410dfb -r daf6ed16c5db hotspot/src/share/vm/utilities/vmError.cpp --- a/hotspot/src/share/vm/utilities/vmError.cpp Thu Apr 21 02:58:04 2016 -0400 +++ b/hotspot/src/share/vm/utilities/vmError.cpp Wed Apr 20 03:12:01 2016 +0000 @@ -28,6 +28,7 @@ #include "compiler/compileBroker.hpp" #include "compiler/disassembler.hpp" #include "gc/shared/collectedHeap.hpp" +#include "logging/logConfiguration.hpp" #include "prims/whitebox.hpp" #include "runtime/arguments.hpp" #include "runtime/atomic.inline.hpp" @@ -774,6 +775,13 @@ st->cr(); } + STEP(395, "(printing log configuration)") + if (_verbose){ + st->print_cr("Logging:"); + LogConfiguration::describe_current_configuration(st); + st->cr(); + } + STEP(400, "(printing all environment variables)" ) if (_verbose) { @@ -937,6 +945,11 @@ st->cr(); } + // STEP("(printing log configuration)") + st->print_cr("Logging:"); + LogConfiguration::describe(st); + st->cr(); + // STEP("(printing all environment variables)") os::print_environment_variables(st, env_list);