src/share/vm/services/classLoadingService.cpp
Index
Unified diffs
Context diffs
Sdiffs
Patch
New
Old
Previous File
Next File
classload.08 Cdiff src/share/vm/services/classLoadingService.cpp
src/share/vm/services/classLoadingService.cpp
Print this page
*** 1,7 ****
/*
! * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
--- 1,7 ----
/*
! * Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*** 31,40 ****
--- 31,42 ----
#include "services/classLoadingService.hpp"
#include "services/memoryService.hpp"
#include "utilities/dtrace.hpp"
#include "utilities/macros.hpp"
#include "utilities/defaultStream.hpp"
+ #include "logging/log.hpp"
+ #include "logging/logConfiguration.hpp"
#ifdef DTRACE_ENABLED
// Only bother with this argument setup if dtrace is available
*** 133,145 ****
for (int i = 0; i < methods->length(); i++) {
_class_methods_size->inc(-methods->at(i)->size());
}
}
! if (TraceClassUnloading) {
ResourceMark rm;
! tty->print_cr("[Unloading class %s " INTPTR_FORMAT "]", k->external_name(), p2i(k));
}
}
void ClassLoadingService::notify_class_loaded(InstanceKlass* k, bool shared_class) {
DTRACE_CLASSLOAD_PROBE(loaded, k, shared_class);
--- 135,147 ----
for (int i = 0; i < methods->length(); i++) {
_class_methods_size->inc(-methods->at(i)->size());
}
}
! if (log_is_enabled(Info, classunload)) {
ResourceMark rm;
! log_info(classunload)("unloading class %s " INTPTR_FORMAT , k->external_name(), p2i(k));
}
}
void ClassLoadingService::notify_class_loaded(InstanceKlass* k, bool shared_class) {
DTRACE_CLASSLOAD_PROBE(loaded, k, shared_class);
*** 177,201 ****
return class_size * oopSize;
}
bool ClassLoadingService::set_verbose(bool verbose) {
MutexLocker m(Management_lock);
-
// verbose will be set to the previous value
! Flag::Error error = CommandLineFlags::boolAtPut("TraceClassLoading", &verbose, Flag::MANAGEMENT);
! assert(error==Flag::SUCCESS, "Setting TraceClassLoading flag failed with error %s", Flag::flag_error_str(error));
reset_trace_class_unloading();
-
return verbose;
}
// Caller to this function must own Management_lock
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();
! Flag::Error error = CommandLineFlags::boolAtPut("TraceClassUnloading", &value, Flag::MANAGEMENT);
! assert(error==Flag::SUCCESS, "Setting TraceClassUnLoading flag failed with error %s", Flag::flag_error_str(error));
}
GrowableArray<KlassHandle>* LoadedClassesEnumerator::_loaded_classes = NULL;
Thread* LoadedClassesEnumerator::_current_thread = NULL;
--- 179,207 ----
return class_size * oopSize;
}
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", "classload=info", NULL, NULL, NULL);
! } else {
! LogConfiguration::parse_log_arguments("stdout", "classload=off", NULL, NULL, NULL);
! }
reset_trace_class_unloading();
return verbose;
}
// Caller to this function must own Management_lock
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", "classunload=info", NULL, NULL, NULL);
! } else {
! LogConfiguration::parse_log_arguments("stdout", "classunload=off", NULL, NULL, NULL);
! }
}
GrowableArray<KlassHandle>* LoadedClassesEnumerator::_loaded_classes = NULL;
Thread* LoadedClassesEnumerator::_current_thread = NULL;
src/share/vm/services/classLoadingService.cpp
Index
Unified diffs
Context diffs
Sdiffs
Patch
New
Old
Previous File
Next File