This commit is contained in:
Marcus Larsson 2016-09-07 15:21:45 +02:00
commit be0d2c98ed
4 changed files with 14 additions and 19 deletions

View File

@ -385,6 +385,7 @@ bool LogConfiguration::parse_log_arguments(const char* outputstr,
const char* decoratorstr, const char* decoratorstr,
const char* output_options, const char* output_options,
outputStream* errstream) { outputStream* errstream) {
assert(errstream != NULL, "errstream can not be NULL");
if (outputstr == NULL || strlen(outputstr) == 0) { if (outputstr == NULL || strlen(outputstr) == 0) {
outputstr = "stdout"; outputstr = "stdout";
} }

View File

@ -649,18 +649,14 @@ JvmtiEnv::GetErrorName(jvmtiError error, char** name_ptr) {
jvmtiError jvmtiError
JvmtiEnv::SetVerboseFlag(jvmtiVerboseFlag flag, jboolean value) { JvmtiEnv::SetVerboseFlag(jvmtiVerboseFlag flag, jboolean value) {
LogLevelType level = value == 0 ? LogLevel::Off : LogLevel::Info;
switch (flag) { switch (flag) {
case JVMTI_VERBOSE_OTHER: case JVMTI_VERBOSE_OTHER:
// ignore // ignore
break; break;
case JVMTI_VERBOSE_CLASS: case JVMTI_VERBOSE_CLASS:
if (value == 0) { LogConfiguration::configure_stdout(level, false, LOG_TAGS(class, unload));
LogConfiguration::parse_log_arguments("stdout", "class+unload=off", NULL, NULL, NULL); LogConfiguration::configure_stdout(level, false, LOG_TAGS(class, load));
LogConfiguration::parse_log_arguments("stdout", "class+load=off", NULL, NULL, NULL);
} else {
LogConfiguration::parse_log_arguments("stdout", "class+load=info", NULL, NULL, NULL);
LogConfiguration::parse_log_arguments("stdout", "class+unload=info", NULL, NULL, NULL);
}
break; break;
case JVMTI_VERBOSE_GC: case JVMTI_VERBOSE_GC:
if (value == 0) { if (value == 0) {

View File

@ -33,8 +33,9 @@
#include "gc/shared/referenceProcessor.hpp" #include "gc/shared/referenceProcessor.hpp"
#include "gc/shared/taskqueue.hpp" #include "gc/shared/taskqueue.hpp"
#include "logging/log.hpp" #include "logging/log.hpp"
#include "logging/logTag.hpp"
#include "logging/logConfiguration.hpp" #include "logging/logConfiguration.hpp"
#include "logging/logStream.hpp"
#include "logging/logTag.hpp"
#include "memory/allocation.inline.hpp" #include "memory/allocation.inline.hpp"
#include "memory/universe.inline.hpp" #include "memory/universe.inline.hpp"
#include "oops/oop.inline.hpp" #include "oops/oop.inline.hpp"
@ -4176,7 +4177,10 @@ bool Arguments::handle_deprecated_print_gc_flags() {
if (_gc_log_filename != NULL) { if (_gc_log_filename != NULL) {
// -Xloggc was used to specify a filename // -Xloggc was used to specify a filename
const char* gc_conf = PrintGCDetails ? "gc*" : "gc"; const char* gc_conf = PrintGCDetails ? "gc*" : "gc";
return LogConfiguration::parse_log_arguments(_gc_log_filename, gc_conf, NULL, NULL, NULL);
LogTarget(Error, logging) target;
LogStreamCHeap errstream(target);
return LogConfiguration::parse_log_arguments(_gc_log_filename, gc_conf, NULL, NULL, &errstream);
} else if (PrintGC || PrintGCDetails) { } else if (PrintGC || PrintGCDetails) {
LogConfiguration::configure_stdout(LogLevel::Info, !PrintGCDetails, LOG_TAGS(gc)); LogConfiguration::configure_stdout(LogLevel::Info, !PrintGCDetails, LOG_TAGS(gc));
} }

View File

@ -183,11 +183,8 @@ size_t ClassLoadingService::compute_class_size(InstanceKlass* k) {
bool ClassLoadingService::set_verbose(bool verbose) { bool ClassLoadingService::set_verbose(bool verbose) {
MutexLocker m(Management_lock); MutexLocker m(Management_lock);
// verbose will be set to the previous value // verbose will be set to the previous value
if (verbose) { LogLevelType level = verbose ? LogLevel::Info : LogLevel::Off;
LogConfiguration::parse_log_arguments("stdout", "class+load=info", NULL, NULL, NULL); LogConfiguration::configure_stdout(level, false, LOG_TAGS(class, load));
} else {
LogConfiguration::parse_log_arguments("stdout", "class+load=off", NULL, NULL, NULL);
}
reset_trace_class_unloading(); reset_trace_class_unloading();
return verbose; return verbose;
} }
@ -196,11 +193,8 @@ bool ClassLoadingService::set_verbose(bool verbose) {
void ClassLoadingService::reset_trace_class_unloading() { void ClassLoadingService::reset_trace_class_unloading() {
assert(Management_lock->owned_by_self(), "Must own the Management_lock"); assert(Management_lock->owned_by_self(), "Must own the Management_lock");
bool value = MemoryService::get_verbose() || ClassLoadingService::get_verbose(); bool value = MemoryService::get_verbose() || ClassLoadingService::get_verbose();
if (value) { LogLevelType level = value ? LogLevel::Info : LogLevel::Off;
LogConfiguration::parse_log_arguments("stdout", "class+unload=info", NULL, NULL, NULL); LogConfiguration::configure_stdout(level, false, LOG_TAGS(class, unload));
} else {
LogConfiguration::parse_log_arguments("stdout", "class+unload=off", NULL, NULL, NULL);
}
} }
GrowableArray<KlassHandle>* LoadedClassesEnumerator::_loaded_classes = NULL; GrowableArray<KlassHandle>* LoadedClassesEnumerator::_loaded_classes = NULL;