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* output_options,
outputStream* errstream) {
assert(errstream != NULL, "errstream can not be NULL");
if (outputstr == NULL || strlen(outputstr) == 0) {
outputstr = "stdout";
}

View File

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

View File

@ -33,8 +33,9 @@
#include "gc/shared/referenceProcessor.hpp"
#include "gc/shared/taskqueue.hpp"
#include "logging/log.hpp"
#include "logging/logTag.hpp"
#include "logging/logConfiguration.hpp"
#include "logging/logStream.hpp"
#include "logging/logTag.hpp"
#include "memory/allocation.inline.hpp"
#include "memory/universe.inline.hpp"
#include "oops/oop.inline.hpp"
@ -4176,7 +4177,10 @@ bool Arguments::handle_deprecated_print_gc_flags() {
if (_gc_log_filename != NULL) {
// -Xloggc was used to specify a filename
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) {
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) {
MutexLocker m(Management_lock);
// verbose will be set to the previous value
if (verbose) {
LogConfiguration::parse_log_arguments("stdout", "class+load=info", NULL, NULL, NULL);
} else {
LogConfiguration::parse_log_arguments("stdout", "class+load=off", NULL, NULL, NULL);
}
LogLevelType level = verbose ? LogLevel::Info : LogLevel::Off;
LogConfiguration::configure_stdout(level, false, LOG_TAGS(class, load));
reset_trace_class_unloading();
return verbose;
}
@ -196,11 +193,8 @@ bool ClassLoadingService::set_verbose(bool verbose) {
void ClassLoadingService::reset_trace_class_unloading() {
assert(Management_lock->owned_by_self(), "Must own the Management_lock");
bool value = MemoryService::get_verbose() || ClassLoadingService::get_verbose();
if (value) {
LogConfiguration::parse_log_arguments("stdout", "class+unload=info", NULL, NULL, NULL);
} else {
LogConfiguration::parse_log_arguments("stdout", "class+unload=off", NULL, NULL, NULL);
}
LogLevelType level = value ? LogLevel::Info : LogLevel::Off;
LogConfiguration::configure_stdout(level, false, LOG_TAGS(class, unload));
}
GrowableArray<KlassHandle>* LoadedClassesEnumerator::_loaded_classes = NULL;