changeset 39707:4974c8df2532

8153074: UL: Show output option in VM.log jcmd Reviewed-by: dholmes, mlarsson
author ysuenaga
date Wed, 06 Jul 2016 20:58:08 +0900
parents 8b8fd966478b
children b4a9b90e217c ec06b2cf8575 154599f8782a
files hotspot/src/share/vm/logging/logConfiguration.cpp hotspot/src/share/vm/logging/logFileOutput.cpp hotspot/src/share/vm/logging/logFileOutput.hpp hotspot/src/share/vm/logging/logOutput.cpp hotspot/src/share/vm/logging/logOutput.hpp
diffstat 5 files changed, 30 insertions(+), 11 deletions(-) [+]
line wrap: on
line diff
--- a/hotspot/src/share/vm/logging/logConfiguration.cpp	Sat Jul 09 19:20:38 2016 -0700
+++ b/hotspot/src/share/vm/logging/logConfiguration.cpp	Wed Jul 06 20:58:08 2016 +0900
@@ -415,17 +415,8 @@
 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 ", i, _outputs[i]->name());
-    out->print_raw(_outputs[i]->config_string());
-    out->print(" ");
-    char delimiter[2] = {0};
-    for (size_t d = 0; d < LogDecorators::Count; d++) {
-      LogDecorators::Decorator decorator = static_cast<LogDecorators::Decorator>(d);
-      if (_outputs[i]->decorators().is_decorator(decorator)) {
-        out->print("%s%s", delimiter, LogDecorators::name(decorator));
-        *delimiter = ',';
-      }
-    }
+    out->print("#" SIZE_FORMAT ": ", i);
+    _outputs[i]->describe(out);
     out->cr();
   }
 }
--- a/hotspot/src/share/vm/logging/logFileOutput.cpp	Sat Jul 09 19:20:38 2016 -0700
+++ b/hotspot/src/share/vm/logging/logFileOutput.cpp	Wed Jul 06 20:58:08 2016 +0900
@@ -428,3 +428,13 @@
   result[result_len] = '\0';
   return result;
 }
+
+void LogFileOutput::describe(outputStream *out) {
+  LogOutput::describe(out);
+  out->print(" ");
+
+  out->print("filecount=%u,filesize=" SIZE_FORMAT "%s", _file_count,
+             byte_size_in_proper_unit(_rotate_size),
+             proper_unit_for_byte_size(_rotate_size));
+}
+
--- a/hotspot/src/share/vm/logging/logFileOutput.hpp	Sat Jul 09 19:20:38 2016 -0700
+++ b/hotspot/src/share/vm/logging/logFileOutput.hpp	Wed Jul 06 20:58:08 2016 +0900
@@ -85,6 +85,7 @@
   virtual int write(const LogDecorations& decorations, const char* msg);
   virtual int write(LogMessageBuffer::Iterator msg_iterator);
   virtual void force_rotate();
+  virtual void describe(outputStream *out);
 
   virtual const char* name() const {
     return _name;
--- a/hotspot/src/share/vm/logging/logOutput.cpp	Sat Jul 09 19:20:38 2016 -0700
+++ b/hotspot/src/share/vm/logging/logOutput.cpp	Wed Jul 06 20:58:08 2016 +0900
@@ -83,3 +83,18 @@
     break;
   }
 }
+
+void LogOutput::describe(outputStream *out) {
+  out->print("%s ", name());
+  out->print_raw(config_string());
+  out->print(" ");
+  char delimiter[2] = {0};
+  for (size_t d = 0; d < LogDecorators::Count; d++) {
+    LogDecorators::Decorator decorator = static_cast<LogDecorators::Decorator>(d);
+    if (decorators().is_decorator(decorator)) {
+      out->print("%s%s", delimiter, LogDecorators::name(decorator));
+      *delimiter = ',';
+    }
+  }
+}
+
--- a/hotspot/src/share/vm/logging/logOutput.hpp	Sat Jul 09 19:20:38 2016 -0700
+++ b/hotspot/src/share/vm/logging/logOutput.hpp	Wed Jul 06 20:58:08 2016 +0900
@@ -83,6 +83,8 @@
     // Do nothing by default.
   }
 
+  virtual void describe(outputStream *out);
+
   virtual const char* name() const = 0;
   virtual bool initialize(const char* options, outputStream* errstream) = 0;
   virtual int write(const LogDecorations& decorations, const char* msg) = 0;