8147464: Use LogConfiguration::configure_stdout() instead of parse_log_arguments
authorbrutisso
Mon, 18 Jan 2016 09:14:58 +0100
changeset 35520 0efb779f41a5
parent 35519 9200162499f7
child 35522 b0d68a5fc22b
child 35523 1c5fd47fcbdb
8147464: Use LogConfiguration::configure_stdout() instead of parse_log_arguments Reviewed-by: mlarsson, sjohanss
hotspot/src/share/vm/prims/jvmtiEnv.cpp
hotspot/src/share/vm/runtime/arguments.cpp
hotspot/src/share/vm/services/memoryService.cpp
--- a/hotspot/src/share/vm/prims/jvmtiEnv.cpp	Thu Jan 14 15:09:11 2016 +0100
+++ b/hotspot/src/share/vm/prims/jvmtiEnv.cpp	Mon Jan 18 09:14:58 2016 +0100
@@ -630,9 +630,9 @@
     break;
   case JVMTI_VERBOSE_GC:
     if (value == 0) {
-      LogConfiguration::parse_log_arguments("stdout", "gc=off", NULL, NULL, NULL);
+      LogConfiguration::configure_stdout(LogLevel::Off, true, LOG_TAGS(gc));
     } else {
-      LogConfiguration::parse_log_arguments("stdout", "gc", NULL, NULL, NULL);
+      LogConfiguration::configure_stdout(LogLevel::Info, true, LOG_TAGS(gc));
     }
     break;
   case JVMTI_VERBOSE_JNI:
--- a/hotspot/src/share/vm/runtime/arguments.cpp	Thu Jan 14 15:09:11 2016 +0100
+++ b/hotspot/src/share/vm/runtime/arguments.cpp	Mon Jan 18 09:14:58 2016 +0100
@@ -2659,11 +2659,7 @@
           return JNI_EINVAL;
         }
       } else if (!strcmp(tail, ":gc")) {
-        // LogConfiguration_lock is not set up yet, but this code is executed by a single thread
-        bool ret = LogConfiguration::parse_log_arguments("stdout", "gc", NULL, NULL, NULL);
-        if (!ret) {
-          return JNI_EINVAL;
-        }
+        LogConfiguration::configure_stdout(LogLevel::Info, true, LOG_TAGS(gc));
       } else if (!strcmp(tail, ":jni")) {
         if (FLAG_SET_CMDLINE(bool, PrintJNIResolving, true) != Flag::SUCCESS) {
           return JNI_EINVAL;
--- a/hotspot/src/share/vm/services/memoryService.cpp	Thu Jan 14 15:09:11 2016 +0100
+++ b/hotspot/src/share/vm/services/memoryService.cpp	Mon Jan 18 09:14:58 2016 +0100
@@ -519,9 +519,9 @@
   MutexLocker m(Management_lock);
   // verbose will be set to the previous value
   if (verbose) {
-    LogConfiguration::parse_log_arguments("stdout", "gc", NULL, NULL, NULL);
+    LogConfiguration::configure_stdout(LogLevel::Info, true, LOG_TAGS(gc));
   } else {
-    LogConfiguration::parse_log_arguments("stdout", "gc=off", NULL, NULL, NULL);
+    LogConfiguration::configure_stdout(LogLevel::Off, true, LOG_TAGS(gc));
   }
   ClassLoadingService::reset_trace_class_unloading();