8154110: Update class* and safepoint* logging subsystems
Refactored logging tags in class and safepoint subsystems. Reviewed-by: coleenp, rehn, hseigel
This commit is contained in:
parent
c011c03c17
commit
da0fe9d476
hotspot
src/share/vm
classfile
classFileParser.cppclassLoader.cppclassLoaderData.cppjavaClasses.cpploaderConstraints.cppmodules.cppsharedPathsMiscInfo.cppsystemDictionary.cppverificationType.cppverifier.cppverifier.hpp
code
logging
memory
oops
prims
runtime
services
test
compiler/jsr292
gc/g1/humongousObjects
runtime
@ -5349,7 +5349,7 @@ void ClassFileParser::fill_instance_klass(InstanceKlass* ik, bool changed_by_loa
|
||||
ClassLoadingService::notify_class_loaded(ik, false /* not shared class */);
|
||||
|
||||
if (!is_internal()) {
|
||||
if (log_is_enabled(Info, classload)) {
|
||||
if (log_is_enabled(Info, class, load)) {
|
||||
ResourceMark rm;
|
||||
const char* module_name = NULL;
|
||||
static const size_t modules_image_name_len = strlen(MODULES_IMAGE_NAME);
|
||||
@ -5361,21 +5361,21 @@ void ClassFileParser::fill_instance_klass(InstanceKlass* ik, bool changed_by_loa
|
||||
module_name = module_entry->name()->as_C_string();
|
||||
}
|
||||
|
||||
if (log_is_enabled(Info, classload)) {
|
||||
if (log_is_enabled(Info, class, load)) {
|
||||
ik->print_loading_log(LogLevel::Info, _loader_data, module_name, _stream);
|
||||
}
|
||||
// No 'else' here as logging levels are not mutually exclusive
|
||||
if (log_is_enabled(Debug, classload)) {
|
||||
if (log_is_enabled(Debug, class, load)) {
|
||||
ik->print_loading_log(LogLevel::Debug, _loader_data, module_name, _stream);
|
||||
}
|
||||
}
|
||||
|
||||
if (log_is_enabled(Debug, classresolve)) {
|
||||
if (log_is_enabled(Debug, class, resolve)) {
|
||||
ResourceMark rm;
|
||||
// print out the superclass.
|
||||
const char * from = ik->external_name();
|
||||
if (ik->java_super() != NULL) {
|
||||
log_debug(classresolve)("%s %s (super)",
|
||||
log_debug(class, resolve)("%s %s (super)",
|
||||
from,
|
||||
ik->java_super()->external_name());
|
||||
}
|
||||
@ -5386,7 +5386,7 @@ void ClassFileParser::fill_instance_klass(InstanceKlass* ik, bool changed_by_loa
|
||||
for (int i = 0; i < length; i++) {
|
||||
const Klass* const k = local_interfaces->at(i);
|
||||
const char * to = k->external_name();
|
||||
log_debug(classresolve)("%s %s (interface)", from, to);
|
||||
log_debug(class, resolve)("%s %s (interface)", from, to);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -5696,9 +5696,9 @@ void ClassFileParser::parse_stream(const ClassFileStream* const stream,
|
||||
}
|
||||
|
||||
if (!is_internal()) {
|
||||
if (log_is_enabled(Debug, classload, preorder)){
|
||||
if (log_is_enabled(Debug, class, preorder)){
|
||||
ResourceMark rm(THREAD);
|
||||
outputStream* log = Log(classload, preorder)::debug_stream();
|
||||
outputStream* log = Log(class, preorder)::debug_stream();
|
||||
log->print("%s", _class_name->as_klass_external_name());
|
||||
if (stream->source() != NULL) {
|
||||
log->print(" source: %s", stream->source());
|
||||
|
@ -537,15 +537,15 @@ bool ClassPathImageEntry::is_jrt() {
|
||||
#if INCLUDE_CDS
|
||||
void ClassLoader::exit_with_path_failure(const char* error, const char* message) {
|
||||
assert(DumpSharedSpaces, "only called at dump time");
|
||||
tty->print_cr("Hint: enable -Xlog:classpath=info to diagnose the failure");
|
||||
tty->print_cr("Hint: enable -Xlog:class+path=info to diagnose the failure");
|
||||
vm_exit_during_initialization(error, message);
|
||||
}
|
||||
#endif
|
||||
|
||||
void ClassLoader::trace_class_path(const char* msg, const char* name) {
|
||||
if (log_is_enabled(Info, classpath)) {
|
||||
if (log_is_enabled(Info, class, path)) {
|
||||
ResourceMark rm;
|
||||
outputStream* out = Log(classpath)::info_stream();
|
||||
outputStream* out = Log(class, path)::info_stream();
|
||||
if (msg) {
|
||||
out->print("%s", msg);
|
||||
}
|
||||
@ -711,12 +711,12 @@ ClassPathEntry* ClassLoader::create_class_path_entry(const char *path, const str
|
||||
}
|
||||
}
|
||||
}
|
||||
log_info(classpath)("opened: %s", path);
|
||||
log_info(classload)("opened: %s", path);
|
||||
log_info(class, path)("opened: %s", path);
|
||||
log_info(class, load)("opened: %s", path);
|
||||
} else {
|
||||
// Directory
|
||||
new_entry = new ClassPathDirEntry(path);
|
||||
log_info(classload)("path: %s", path);
|
||||
log_info(class, load)("path: %s", path);
|
||||
}
|
||||
return new_entry;
|
||||
}
|
||||
|
@ -333,7 +333,7 @@ void ClassLoaderData::add_class(Klass* k, bool publicize /* true */) {
|
||||
|
||||
if (publicize && k->class_loader_data() != NULL) {
|
||||
ResourceMark rm;
|
||||
log_trace(classloaderdata)("Adding k: " PTR_FORMAT " %s to CLD: "
|
||||
log_trace(class, loader, data)("Adding k: " PTR_FORMAT " %s to CLD: "
|
||||
PTR_FORMAT " loader: " PTR_FORMAT " %s",
|
||||
p2i(k),
|
||||
k->external_name(),
|
||||
@ -371,9 +371,9 @@ void ClassLoaderData::unload() {
|
||||
// Tell serviceability tools these classes are unloading
|
||||
classes_do(InstanceKlass::notify_unload_class);
|
||||
|
||||
if (log_is_enabled(Debug, classloaderdata)) {
|
||||
if (log_is_enabled(Debug, class, loader, data)) {
|
||||
ResourceMark rm;
|
||||
outputStream* log = Log(classloaderdata)::debug_stream();
|
||||
outputStream* log = Log(class, loader, data)::debug_stream();
|
||||
log->print(": unload loader data " INTPTR_FORMAT, p2i(this));
|
||||
log->print(" for instance " INTPTR_FORMAT " of %s", p2i((void *)class_loader()),
|
||||
loader_name());
|
||||
@ -506,12 +506,12 @@ Metaspace* ClassLoaderData::metaspace_non_null() {
|
||||
set_metaspace(new Metaspace(_metaspace_lock, Metaspace::BootMetaspaceType));
|
||||
} else if (is_anonymous()) {
|
||||
if (class_loader() != NULL) {
|
||||
log_trace(classloaderdata)("is_anonymous: %s", class_loader()->klass()->internal_name());
|
||||
log_trace(class, loader, data)("is_anonymous: %s", class_loader()->klass()->internal_name());
|
||||
}
|
||||
set_metaspace(new Metaspace(_metaspace_lock, Metaspace::AnonymousMetaspaceType));
|
||||
} else if (class_loader()->is_a(SystemDictionary::reflect_DelegatingClassLoader_klass())) {
|
||||
if (class_loader() != NULL) {
|
||||
log_trace(classloaderdata)("is_reflection: %s", class_loader()->klass()->internal_name());
|
||||
log_trace(class, loader, data)("is_reflection: %s", class_loader()->klass()->internal_name());
|
||||
}
|
||||
set_metaspace(new Metaspace(_metaspace_lock, Metaspace::ReflectionMetaspaceType));
|
||||
} else {
|
||||
@ -702,7 +702,7 @@ ClassLoaderData* ClassLoaderDataGraph::add(Handle loader, bool is_anonymous, TRA
|
||||
cld->set_next(next);
|
||||
ClassLoaderData* exchanged = (ClassLoaderData*)Atomic::cmpxchg_ptr(cld, list_head, next);
|
||||
if (exchanged == next) {
|
||||
if (log_is_enabled(Debug, classloaderdata)) {
|
||||
if (log_is_enabled(Debug, class, loader, data)) {
|
||||
PauseNoSafepointVerifier pnsv(&no_safepoints); // Need safe points for JavaCalls::call_virtual
|
||||
log_creation(loader, cld, CHECK_NULL);
|
||||
}
|
||||
@ -730,7 +730,7 @@ void ClassLoaderDataGraph::log_creation(Handle loader, ClassLoaderData* cld, TRA
|
||||
}
|
||||
|
||||
ResourceMark rm;
|
||||
outputStream* log = Log(classloaderdata)::debug_stream();
|
||||
outputStream* log = Log(class, loader, data)::debug_stream();
|
||||
log->print("create class loader data " INTPTR_FORMAT, p2i(cld));
|
||||
log->print(" for instance " INTPTR_FORMAT " of %s", p2i((void *)cld->class_loader()),
|
||||
cld->loader_name());
|
||||
@ -871,8 +871,8 @@ GrowableArray<ClassLoaderData*>* ClassLoaderDataGraph::new_clds() {
|
||||
if (!curr->claimed()) {
|
||||
array->push(curr);
|
||||
|
||||
if (log_is_enabled(Debug, classloaderdata)) {
|
||||
outputStream* log = Log(classloaderdata)::debug_stream();
|
||||
if (log_is_enabled(Debug, class, loader, data)) {
|
||||
outputStream* log = Log(class, loader, data)::debug_stream();
|
||||
log->print("found new CLD: ");
|
||||
curr->print_value_on(log);
|
||||
log->cr();
|
||||
|
@ -131,7 +131,7 @@ compute_offset(int &dest_offset,
|
||||
tty->print_cr(" name: %s, sig: %s, flags: %08x", fs.name()->as_C_string(), fs.signature()->as_C_string(), fs.access_flags().as_int());
|
||||
}
|
||||
#endif //PRODUCT
|
||||
vm_exit_during_initialization("Invalid layout of preloaded class: use -Xlog:classload=info to see the origin of the problem class");
|
||||
vm_exit_during_initialization("Invalid layout of preloaded class: use -Xlog:class+load=info to see the origin of the problem class");
|
||||
}
|
||||
dest_offset = fd.offset();
|
||||
}
|
||||
@ -4059,7 +4059,7 @@ int InjectedField::compute_offset() {
|
||||
tty->print_cr(" name: %s, sig: %s, flags: %08x", fs.name()->as_C_string(), fs.signature()->as_C_string(), fs.access_flags().as_int());
|
||||
}
|
||||
#endif //PRODUCT
|
||||
vm_exit_during_initialization("Invalid layout of preloaded class: use -Xlog:classload=info to see the origin of the problem class");
|
||||
vm_exit_during_initialization("Invalid layout of preloaded class: use -Xlog:class+load=info to see the origin of the problem class");
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
@ -111,9 +111,9 @@ void LoaderConstraintTable::purge_loader_constraints() {
|
||||
if (klass != NULL &&
|
||||
klass->class_loader_data()->is_unloading()) {
|
||||
probe->set_klass(NULL);
|
||||
if (log_is_enabled(Info, constraints)) {
|
||||
if (log_is_enabled(Info, class, loader, constraints)) {
|
||||
ResourceMark rm;
|
||||
outputStream* out = Log(classload, constraints)::info_stream();
|
||||
outputStream* out = Log(class, loader, constraints)::info_stream();
|
||||
out->print_cr("purging class object from constraint for name %s,"
|
||||
" loader list:",
|
||||
probe->name()->as_C_string());
|
||||
@ -127,9 +127,9 @@ void LoaderConstraintTable::purge_loader_constraints() {
|
||||
int n = 0;
|
||||
while (n < probe->num_loaders()) {
|
||||
if (probe->loader_data(n)->is_unloading()) {
|
||||
if (log_is_enabled(Info, classload, constraints)) {
|
||||
if (log_is_enabled(Info, class, loader, constraints)) {
|
||||
ResourceMark rm;
|
||||
outputStream* out = Log(classload, constraints)::info_stream();
|
||||
outputStream* out = Log(class, loader, constraints)::info_stream();
|
||||
out->print_cr("purging loader %s from constraint for name %s",
|
||||
probe->loader_data(n)->loader_name(),
|
||||
probe->name()->as_C_string()
|
||||
@ -142,9 +142,9 @@ void LoaderConstraintTable::purge_loader_constraints() {
|
||||
probe->set_loader_data(n, probe->loader_data(num));
|
||||
probe->set_loader_data(num, NULL);
|
||||
|
||||
if (log_is_enabled(Info, classload, constraints)) {
|
||||
if (log_is_enabled(Info, class, loader, constraints)) {
|
||||
ResourceMark rm;
|
||||
outputStream* out = Log(classload, constraints)::info_stream();
|
||||
outputStream* out = Log(class, loader, constraints)::info_stream();
|
||||
out->print_cr("new loader list:");
|
||||
for (int i = 0; i < probe->num_loaders(); i++) {
|
||||
out->print_cr(" [%d]: %s", i,
|
||||
@ -159,9 +159,9 @@ void LoaderConstraintTable::purge_loader_constraints() {
|
||||
}
|
||||
// Check whether entry should be purged
|
||||
if (probe->num_loaders() < 2) {
|
||||
if (log_is_enabled(Info, classload, constraints)) {
|
||||
if (log_is_enabled(Info, class, loader, constraints)) {
|
||||
ResourceMark rm;
|
||||
outputStream* out = Log(classload, constraints)::info_stream();
|
||||
outputStream* out = Log(class, loader, constraints)::info_stream();
|
||||
out->print_cr("purging complete constraint for name %s",
|
||||
probe->name()->as_C_string());
|
||||
}
|
||||
@ -231,9 +231,9 @@ bool LoaderConstraintTable::add_entry(Symbol* class_name,
|
||||
p->set_klass(klass);
|
||||
p->set_next(bucket(index));
|
||||
set_entry(index, p);
|
||||
if (log_is_enabled(Info, classload, constraints)) {
|
||||
if (log_is_enabled(Info, class, loader, constraints)) {
|
||||
ResourceMark rm;
|
||||
outputStream* out = Log(classload, constraints)::info_stream();
|
||||
outputStream* out = Log(class, loader, constraints)::info_stream();
|
||||
out->print_cr("adding new constraint for name: %s, loader[0]: %s,"
|
||||
" loader[1]: %s",
|
||||
class_name->as_C_string(),
|
||||
@ -245,9 +245,9 @@ bool LoaderConstraintTable::add_entry(Symbol* class_name,
|
||||
/* constraint already imposed */
|
||||
if ((*pp1)->klass() == NULL) {
|
||||
(*pp1)->set_klass(klass);
|
||||
if (log_is_enabled(Info, classload, constraints)) {
|
||||
if (log_is_enabled(Info, class, loader, constraints)) {
|
||||
ResourceMark rm;
|
||||
outputStream* out = Log(classload, constraints)::info_stream();
|
||||
outputStream* out = Log(class, loader, constraints)::info_stream();
|
||||
out->print_cr("setting class object in existing constraint for"
|
||||
" name: %s and loader %s",
|
||||
class_name->as_C_string(),
|
||||
@ -267,9 +267,9 @@ bool LoaderConstraintTable::add_entry(Symbol* class_name,
|
||||
}
|
||||
}
|
||||
|
||||
if (failure_code != 0 && log_is_enabled(Info, classload, constraints)) {
|
||||
if (failure_code != 0 && log_is_enabled(Info, class, loader, constraints)) {
|
||||
ResourceMark rm;
|
||||
outputStream* out = Log(classload, constraints)::info_stream();
|
||||
outputStream* out = Log(class, loader, constraints)::info_stream();
|
||||
const char* reason = "";
|
||||
switch(failure_code) {
|
||||
case 1: reason = "the class objects presented by loader[0] and loader[1]"
|
||||
@ -300,9 +300,9 @@ bool LoaderConstraintTable::check_or_update(instanceKlassHandle k,
|
||||
Symbol* name) {
|
||||
LoaderConstraintEntry* p = *(find_loader_constraint(name, loader));
|
||||
if (p && p->klass() != NULL && p->klass() != k()) {
|
||||
if (log_is_enabled(Info, classload, constraints)) {
|
||||
if (log_is_enabled(Info, class, loader, constraints)) {
|
||||
ResourceMark rm;
|
||||
outputStream* out = Log(classload, constraints)::info_stream();
|
||||
outputStream* out = Log(class, loader, constraints)::info_stream();
|
||||
out->print_cr("constraint check failed for name %s, loader %s: "
|
||||
"the presented class object differs from that stored",
|
||||
name->as_C_string(),
|
||||
@ -312,9 +312,9 @@ bool LoaderConstraintTable::check_or_update(instanceKlassHandle k,
|
||||
} else {
|
||||
if (p && p->klass() == NULL) {
|
||||
p->set_klass(k());
|
||||
if (log_is_enabled(Info, classload, constraints)) {
|
||||
if (log_is_enabled(Info, class, loader, constraints)) {
|
||||
ResourceMark rm;
|
||||
outputStream* out = Log(classload, constraints)::info_stream();
|
||||
outputStream* out = Log(class, loader, constraints)::info_stream();
|
||||
out->print_cr("updating constraint for name %s, loader %s, "
|
||||
"by setting class object",
|
||||
name->as_C_string(),
|
||||
@ -362,9 +362,9 @@ void LoaderConstraintTable::extend_loader_constraint(LoaderConstraintEntry* p,
|
||||
int num = p->num_loaders();
|
||||
p->set_loader(num, loader());
|
||||
p->set_num_loaders(num + 1);
|
||||
if (log_is_enabled(Info, classload, constraints)) {
|
||||
if (log_is_enabled(Info, class, loader, constraints)) {
|
||||
ResourceMark rm;
|
||||
outputStream* out = Log(classload, constraints)::info_stream();
|
||||
outputStream* out = Log(class, loader, constraints)::info_stream();
|
||||
out->print_cr("extending constraint for name %s by adding loader[%d]: %s %s",
|
||||
p->name()->as_C_string(),
|
||||
num,
|
||||
@ -402,9 +402,9 @@ void LoaderConstraintTable::merge_loader_constraints(
|
||||
p1->set_num_loaders(num + 1);
|
||||
}
|
||||
|
||||
if (log_is_enabled(Info, classload, constraints)) {
|
||||
if (log_is_enabled(Info, class, loader, constraints)) {
|
||||
ResourceMark rm;
|
||||
outputStream* out = Log(classload, constraints)::info_stream();
|
||||
outputStream* out = Log(class, loader, constraints)::info_stream();
|
||||
out->print_cr("merged constraints for name %s, new loader list:",
|
||||
p1->name()->as_C_string()
|
||||
);
|
||||
|
@ -167,7 +167,7 @@ static void add_to_boot_loader_list(char *module_name, TRAPS) {
|
||||
ObjectLocker ol(loader_lock, THREAD);
|
||||
ClassLoader::prepend_to_list(prefix_path);
|
||||
}
|
||||
log_info(classload)("opened: -Xpatch %s", prefix_path);
|
||||
log_info(class, load)("opened: -Xpatch %s", prefix_path);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -195,7 +195,7 @@ static void add_to_boot_loader_list(char *module_name, TRAPS) {
|
||||
Handle loader_lock = Handle(THREAD, SystemDictionary::system_loader_lock());
|
||||
ObjectLocker ol(loader_lock, THREAD);
|
||||
|
||||
log_info(classload)("opened: %s", path);
|
||||
log_info(class, load)("opened: %s", path);
|
||||
ClassLoader::add_to_list(path);
|
||||
}
|
||||
}
|
||||
|
@ -34,7 +34,7 @@
|
||||
#include "utilities/ostream.hpp"
|
||||
|
||||
void SharedPathsMiscInfo::add_path(const char* path, int type) {
|
||||
log_info(classpath)("type=%s ", type_name(type));
|
||||
log_info(class, path)("type=%s ", type_name(type));
|
||||
ClassLoader::trace_class_path("add misc shared path ", path);
|
||||
write(path, strlen(path) + 1);
|
||||
write_jint(jint(type));
|
||||
@ -75,7 +75,7 @@ bool SharedPathsMiscInfo::fail(const char* msg, const char* name) {
|
||||
|
||||
void SharedPathsMiscInfo::print_path(int type, const char* path) {
|
||||
ResourceMark rm;
|
||||
outputStream* out = Log(classpath)::info_stream();
|
||||
outputStream* out = Log(class, path)::info_stream();
|
||||
switch (type) {
|
||||
case BOOT:
|
||||
out->print("Expecting BOOT path=%s", path);
|
||||
@ -109,7 +109,7 @@ bool SharedPathsMiscInfo::check() {
|
||||
if (!read_jint(&type)) {
|
||||
return fail("Corrupted archive file header");
|
||||
}
|
||||
log_info(classpath)("type=%s ", type_name(type));
|
||||
log_info(class, path)("type=%s ", type_name(type));
|
||||
print_path(type, path);
|
||||
if (!check(type, path)) {
|
||||
if (!PrintSharedArchiveAndExit) {
|
||||
|
@ -1388,12 +1388,12 @@ instanceKlassHandle SystemDictionary::load_shared_class(instanceKlassHandle ik,
|
||||
ik->restore_unshareable_info(loader_data, protection_domain, CHECK_(nh));
|
||||
}
|
||||
|
||||
if (log_is_enabled(Info, classload)) {
|
||||
if (log_is_enabled(Info, class, load)) {
|
||||
ik()->print_loading_log(LogLevel::Info, loader_data, NULL, NULL);
|
||||
}
|
||||
// No 'else' here as logging levels are not mutually exclusive
|
||||
|
||||
if (log_is_enabled(Debug, classload)) {
|
||||
if (log_is_enabled(Debug, class, load)) {
|
||||
ik()->print_loading_log(LogLevel::Debug, loader_data, NULL, NULL);
|
||||
}
|
||||
|
||||
|
@ -61,7 +61,7 @@ bool VerificationType::is_reference_assignable_from(
|
||||
Klass* obj = SystemDictionary::resolve_or_fail(
|
||||
name(), Handle(THREAD, klass->class_loader()),
|
||||
Handle(THREAD, klass->protection_domain()), true, CHECK_false);
|
||||
if (log_is_enabled(Debug, classresolve)) {
|
||||
if (log_is_enabled(Debug, class, resolve)) {
|
||||
Verifier::trace_class_resolution(obj, klass());
|
||||
}
|
||||
|
||||
@ -80,7 +80,7 @@ bool VerificationType::is_reference_assignable_from(
|
||||
Klass* from_class = SystemDictionary::resolve_or_fail(
|
||||
from.name(), Handle(THREAD, klass->class_loader()),
|
||||
Handle(THREAD, klass->protection_domain()), true, CHECK_false);
|
||||
if (log_is_enabled(Debug, classresolve)) {
|
||||
if (log_is_enabled(Debug, class, resolve)) {
|
||||
Verifier::trace_class_resolution(from_class, klass());
|
||||
}
|
||||
return InstanceKlass::cast(from_class)->is_subclass_of(this_class());
|
||||
|
@ -107,9 +107,9 @@ void Verifier::trace_class_resolution(Klass* resolve_class, InstanceKlass* verif
|
||||
const char* resolve = resolve_class->external_name();
|
||||
// print in a single call to reduce interleaving between threads
|
||||
if (source_file != NULL) {
|
||||
log_debug(classresolve)("%s %s %s (verification)", verify, resolve, source_file);
|
||||
log_debug(class, resolve)("%s %s %s (verification)", verify, resolve, source_file);
|
||||
} else {
|
||||
log_debug(classresolve)("%s %s (verification)", verify, resolve);
|
||||
log_debug(class, resolve)("%s %s (verification)", verify, resolve);
|
||||
}
|
||||
}
|
||||
|
||||
@ -169,7 +169,7 @@ bool Verifier::verify(instanceKlassHandle klass, Verifier::Mode mode, bool shoul
|
||||
bool can_failover = FailOverToOldVerifier &&
|
||||
klass->major_version() < NOFAILOVER_MAJOR_VERSION;
|
||||
|
||||
log_info(classinit)("Start class verification for: %s", klassName);
|
||||
log_info(class, init)("Start class verification for: %s", klassName);
|
||||
if (klass->major_version() >= STACKMAP_ATTRIBUTE_MAJOR_VERSION) {
|
||||
ClassVerifier split_verifier(klass, THREAD);
|
||||
split_verifier.verify_class(THREAD);
|
||||
@ -178,7 +178,7 @@ bool Verifier::verify(instanceKlassHandle klass, Verifier::Mode mode, bool shoul
|
||||
(exception_name == vmSymbols::java_lang_VerifyError() ||
|
||||
exception_name == vmSymbols::java_lang_ClassFormatError())) {
|
||||
log_info(verification)("Fail over class verification to old verifier for: %s", klassName);
|
||||
log_info(classinit)("Fail over class verification to old verifier for: %s", klassName);
|
||||
log_info(class, init)("Fail over class verification to old verifier for: %s", klassName);
|
||||
exception_name = inference_verify(
|
||||
klass, message_buffer, message_buffer_len, THREAD);
|
||||
}
|
||||
@ -190,8 +190,8 @@ bool Verifier::verify(instanceKlassHandle klass, Verifier::Mode mode, bool shoul
|
||||
klass, message_buffer, message_buffer_len, THREAD);
|
||||
}
|
||||
|
||||
if (log_is_enabled(Info, classinit)){
|
||||
log_end_verification(Log(classinit)::info_stream(), klassName, exception_name, THREAD);
|
||||
if (log_is_enabled(Info, class, init)){
|
||||
log_end_verification(Log(class, init)::info_stream(), klassName, exception_name, THREAD);
|
||||
}
|
||||
if (log_is_enabled(Info, verification)){
|
||||
log_end_verification(Log(verification)::info_stream(), klassName, exception_name, THREAD);
|
||||
@ -205,7 +205,7 @@ bool Verifier::verify(instanceKlassHandle klass, Verifier::Mode mode, bool shoul
|
||||
ResourceMark rm(THREAD);
|
||||
instanceKlassHandle kls =
|
||||
SystemDictionary::resolve_or_fail(exception_name, true, CHECK_false);
|
||||
if (log_is_enabled(Debug, classresolve)) {
|
||||
if (log_is_enabled(Debug, class, resolve)) {
|
||||
Verifier::trace_class_resolution(kls(), klass());
|
||||
}
|
||||
|
||||
@ -601,7 +601,7 @@ void ClassVerifier::verify_class(TRAPS) {
|
||||
|
||||
if (was_recursively_verified()){
|
||||
log_info(verification)("Recursive verification detected for: %s", _klass->external_name());
|
||||
log_info(classinit)("Recursive verification detected for: %s",
|
||||
log_info(class, init)("Recursive verification detected for: %s",
|
||||
_klass->external_name());
|
||||
}
|
||||
}
|
||||
@ -1994,7 +1994,7 @@ Klass* ClassVerifier::load_class(Symbol* name, TRAPS) {
|
||||
name, Handle(THREAD, loader), Handle(THREAD, protection_domain),
|
||||
true, THREAD);
|
||||
|
||||
if (log_is_enabled(Debug, classresolve)) {
|
||||
if (log_is_enabled(Debug, class, resolve)) {
|
||||
instanceKlassHandle cur_class = current_class();
|
||||
Verifier::trace_class_resolution(kls, cur_class());
|
||||
}
|
||||
|
@ -61,7 +61,7 @@ class Verifier : AllStatic {
|
||||
// Relax certain verifier checks to enable some broken 1.1 apps to run on 1.2.
|
||||
static bool relax_verify_for(oop class_loader);
|
||||
|
||||
// Print output for classresolve
|
||||
// Print output for class+resolve
|
||||
static void trace_class_resolution(Klass* resolve_class, InstanceKlass* verify_class);
|
||||
|
||||
private:
|
||||
|
@ -1076,8 +1076,8 @@ void nmethod::make_unloaded(BoolObjectClosure* is_alive, oop cause) {
|
||||
flush_dependencies(is_alive);
|
||||
|
||||
// Break cycle between nmethod & method
|
||||
if (log_is_enabled(Trace, classunload)) {
|
||||
outputStream* log = Log(classunload)::trace_stream();
|
||||
if (log_is_enabled(Trace, class, unload)) {
|
||||
outputStream* log = Log(class, unload)::trace_stream();
|
||||
log->print_cr("making nmethod " INTPTR_FORMAT
|
||||
" unloadable, Method*(" INTPTR_FORMAT
|
||||
"), cause(" INTPTR_FORMAT ")",
|
||||
|
@ -39,18 +39,15 @@
|
||||
LOG_TAG(biasedlocking) \
|
||||
LOG_TAG(bot) \
|
||||
LOG_TAG(census) \
|
||||
LOG_TAG(class) \
|
||||
LOG_TAG(classhisto) \
|
||||
LOG_TAG(classresolve) \
|
||||
LOG_TAG(classinit) \
|
||||
LOG_TAG(classload) /* Trace all classes loaded */ \
|
||||
LOG_TAG(classloaderdata) /* class loader loader_data lifetime */ \
|
||||
LOG_TAG(classunload) /* Trace unloading of classes */ \
|
||||
LOG_TAG(classpath) \
|
||||
LOG_TAG(cleanup) \
|
||||
LOG_TAG(compaction) \
|
||||
LOG_TAG(constraints) \
|
||||
LOG_TAG(coops) \
|
||||
LOG_TAG(cpu) \
|
||||
LOG_TAG(cset) \
|
||||
LOG_TAG(data) \
|
||||
LOG_TAG(defaultmethods) \
|
||||
LOG_TAG(ergo) \
|
||||
LOG_TAG(exceptions) \
|
||||
@ -60,10 +57,13 @@
|
||||
LOG_TAG(heap) \
|
||||
LOG_TAG(humongous) \
|
||||
LOG_TAG(ihop) \
|
||||
LOG_TAG(init) \
|
||||
LOG_TAG(itables) \
|
||||
LOG_TAG(jni) \
|
||||
LOG_TAG(jvmti) \
|
||||
LOG_TAG(liveness) \
|
||||
LOG_TAG(load) /* Trace all classes loaded */ \
|
||||
LOG_TAG(loader) \
|
||||
LOG_TAG(logging) \
|
||||
LOG_TAG(marking) \
|
||||
LOG_TAG(metaspace) \
|
||||
@ -74,6 +74,7 @@
|
||||
LOG_TAG(objecttagging) \
|
||||
LOG_TAG(os) \
|
||||
LOG_TAG(pagesize) \
|
||||
LOG_TAG(path) \
|
||||
LOG_TAG(phases) \
|
||||
LOG_TAG(plab) \
|
||||
LOG_TAG(promotion) \
|
||||
@ -83,8 +84,8 @@
|
||||
LOG_TAG(refine) \
|
||||
LOG_TAG(region) \
|
||||
LOG_TAG(remset) \
|
||||
LOG_TAG(resolve) \
|
||||
LOG_TAG(safepoint) \
|
||||
LOG_TAG(safepointcleanup) \
|
||||
LOG_TAG(scavenge) \
|
||||
LOG_TAG(scrub) \
|
||||
LOG_TAG(stacktrace) \
|
||||
@ -101,6 +102,7 @@
|
||||
LOG_TAG(thread) \
|
||||
LOG_TAG(tlab) \
|
||||
LOG_TAG(time) \
|
||||
LOG_TAG(unload) /* Trace unloading of classes */ \
|
||||
LOG_TAG(verification) \
|
||||
LOG_TAG(verify) \
|
||||
LOG_TAG(vmoperation) \
|
||||
|
@ -209,7 +209,7 @@ void FileMapInfo::allocate_classpath_entry_table() {
|
||||
count ++;
|
||||
bytes += (int)entry_size;
|
||||
bytes += name_bytes;
|
||||
log_info(classpath)("add main shared path (%s) %s", (cpe->is_jar_file() ? "jar" : "dir"), name);
|
||||
log_info(class, path)("add main shared path (%s) %s", (cpe->is_jar_file() ? "jar" : "dir"), name);
|
||||
} else {
|
||||
SharedClassPathEntry* ent = shared_classpath(cur_entry);
|
||||
if (cpe->is_jar_file()) {
|
||||
@ -283,7 +283,7 @@ bool FileMapInfo::validate_classpath_entry_table() {
|
||||
struct stat st;
|
||||
const char* name = ent->_name;
|
||||
bool ok = true;
|
||||
log_info(classpath)("checking shared classpath entry: %s", name);
|
||||
log_info(class, path)("checking shared classpath entry: %s", name);
|
||||
if (os::stat(name, &st) != 0) {
|
||||
fail_continue("Required classpath entry does not exist: %s", name);
|
||||
ok = false;
|
||||
@ -307,7 +307,7 @@ bool FileMapInfo::validate_classpath_entry_table() {
|
||||
}
|
||||
}
|
||||
if (ok) {
|
||||
log_info(classpath)("ok");
|
||||
log_info(class, path)("ok");
|
||||
} else if (!PrintSharedArchiveAndExit) {
|
||||
_validating_classpath_entry_table = false;
|
||||
return false;
|
||||
@ -897,8 +897,8 @@ bool FileMapInfo::FileMapHeader::validate() {
|
||||
char header_version[JVM_IDENT_MAX];
|
||||
get_header_version(header_version);
|
||||
if (strncmp(_jvm_ident, header_version, JVM_IDENT_MAX-1) != 0) {
|
||||
log_info(classpath)("expected: %s", header_version);
|
||||
log_info(classpath)("actual: %s", _jvm_ident);
|
||||
log_info(class, path)("expected: %s", header_version);
|
||||
log_info(class, path)("actual: %s", _jvm_ident);
|
||||
FileMapInfo::fail_continue("The shared archive file was created by a different"
|
||||
" version or build of HotSpot");
|
||||
return false;
|
||||
@ -926,7 +926,7 @@ bool FileMapInfo::validate_header() {
|
||||
if (status) {
|
||||
if (!ClassLoader::check_shared_paths_misc_info(_paths_misc_info, _header->_paths_misc_info_size)) {
|
||||
if (!PrintSharedArchiveAndExit) {
|
||||
fail_continue("shared class paths mismatch (hint: enable -Xlog:classpath=info to diagnose the failure)");
|
||||
fail_continue("shared class paths mismatch (hint: enable -Xlog:class+path=info to diagnose the failure)");
|
||||
status = false;
|
||||
}
|
||||
}
|
||||
|
@ -919,7 +919,7 @@ int MetaspaceShared::preload_and_dump(const char* class_list_path,
|
||||
|
||||
InstanceKlass* ik = InstanceKlass::cast(klass);
|
||||
|
||||
// Should be class load order as per -Xlog:classload+preorder
|
||||
// Should be class load order as per -Xlog:class+preorder
|
||||
class_promote_order->append(ik);
|
||||
|
||||
// Link the class to cause the bytecodes to be rewritten and the
|
||||
|
@ -209,11 +209,11 @@ void ConstantPool::trace_class_resolution(const constantPoolHandle& this_cp, Kla
|
||||
if (k() != this_cp->pool_holder()) {
|
||||
// only print something if the classes are different
|
||||
if (source_file != NULL) {
|
||||
log_debug(classresolve)("%s %s %s:%d",
|
||||
log_debug(class, resolve)("%s %s %s:%d",
|
||||
this_cp->pool_holder()->external_name(),
|
||||
k->external_name(), source_file, line_number);
|
||||
} else {
|
||||
log_debug(classresolve)("%s %s",
|
||||
log_debug(class, resolve)("%s %s",
|
||||
this_cp->pool_holder()->external_name(),
|
||||
k->external_name());
|
||||
}
|
||||
@ -282,8 +282,8 @@ Klass* ConstantPool::klass_at_impl(const constantPoolHandle& this_cp, int which,
|
||||
ClassLoaderData* this_key = this_cp->pool_holder()->class_loader_data();
|
||||
this_key->record_dependency(k(), CHECK_NULL); // Can throw OOM
|
||||
|
||||
// logging for classresolve tag.
|
||||
if (log_is_enabled(Debug, classresolve)){
|
||||
// logging for class+resolve.
|
||||
if (log_is_enabled(Debug, class, resolve)){
|
||||
trace_class_resolution(this_cp, k);
|
||||
}
|
||||
this_cp->klass_at_put(which, k());
|
||||
@ -341,7 +341,7 @@ Method* ConstantPool::method_at_if_loaded(const constantPoolHandle& cpool,
|
||||
int cache_index = decode_cpcache_index(which, true);
|
||||
if (!(cache_index >= 0 && cache_index < cpool->cache()->length())) {
|
||||
// FIXME: should be an assert
|
||||
log_debug(classresolve)("bad operand %d in:", which); cpool->print();
|
||||
log_debug(class, resolve)("bad operand %d in:", which); cpool->print();
|
||||
return NULL;
|
||||
}
|
||||
ConstantPoolCacheEntry* e = cpool->cache()->entry_at(cache_index);
|
||||
@ -672,7 +672,7 @@ oop ConstantPool::resolve_constant_at_impl(const constantPoolHandle& this_cp, in
|
||||
Symbol* name = this_cp->method_handle_name_ref_at(index);
|
||||
Symbol* signature = this_cp->method_handle_signature_ref_at(index);
|
||||
{ ResourceMark rm(THREAD);
|
||||
log_debug(classresolve)("resolve JVM_CONSTANT_MethodHandle:%d [%d/%d/%d] %s.%s",
|
||||
log_debug(class, resolve)("resolve JVM_CONSTANT_MethodHandle:%d [%d/%d/%d] %s.%s",
|
||||
ref_kind, index, this_cp->method_handle_index_at(index),
|
||||
callee_index, name->as_C_string(), signature->as_C_string());
|
||||
}
|
||||
@ -695,7 +695,7 @@ oop ConstantPool::resolve_constant_at_impl(const constantPoolHandle& this_cp, in
|
||||
{
|
||||
Symbol* signature = this_cp->method_type_signature_at(index);
|
||||
{ ResourceMark rm(THREAD);
|
||||
log_debug(classresolve)("resolve JVM_CONSTANT_MethodType [%d/%d] %s",
|
||||
log_debug(class, resolve)("resolve JVM_CONSTANT_MethodType [%d/%d] %s",
|
||||
index, this_cp->method_type_index_at(index),
|
||||
signature->as_C_string());
|
||||
}
|
||||
|
@ -450,9 +450,9 @@ void InstanceKlass::eager_initialize_impl(instanceKlassHandle this_k) {
|
||||
this_k->set_init_state (fully_initialized);
|
||||
this_k->fence_and_clear_init_lock();
|
||||
// trace
|
||||
if (log_is_enabled(Info, classinit)) {
|
||||
if (log_is_enabled(Info, class, init)) {
|
||||
ResourceMark rm(THREAD);
|
||||
log_info(classinit)("[Initialized %s without side effects]", this_k->external_name());
|
||||
log_info(class, init)("[Initialized %s without side effects]", this_k->external_name());
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1088,9 +1088,9 @@ void InstanceKlass::call_class_initializer_impl(instanceKlassHandle this_k, TRAP
|
||||
|
||||
methodHandle h_method(THREAD, this_k->class_initializer());
|
||||
assert(!this_k->is_initialized(), "we cannot initialize twice");
|
||||
if (log_is_enabled(Info, classinit)) {
|
||||
if (log_is_enabled(Info, class, init)) {
|
||||
ResourceMark rm;
|
||||
outputStream* log = Log(classinit)::info_stream();
|
||||
outputStream* log = Log(class, init)::info_stream();
|
||||
log->print("%d Initializing ", call_class_initializer_impl_counter++);
|
||||
this_k->name()->print_value_on(log);
|
||||
log->print_cr("%s (" INTPTR_FORMAT ")", h_method() == NULL ? "(no method)" : "", p2i(this_k()));
|
||||
@ -3014,11 +3014,11 @@ void InstanceKlass::print_loading_log(LogLevel::type type,
|
||||
assert(type == LogLevel::Info || type == LogLevel::Debug, "sanity");
|
||||
|
||||
if (type == LogLevel::Info) {
|
||||
log = Log(classload)::info_stream();
|
||||
log = Log(class, load)::info_stream();
|
||||
} else {
|
||||
assert(type == LogLevel::Debug,
|
||||
"print_loading_log supports only Debug and Info levels");
|
||||
log = Log(classload)::debug_stream();
|
||||
log = Log(class, load)::debug_stream();
|
||||
}
|
||||
|
||||
// Name and class hierarchy info
|
||||
|
@ -401,9 +401,9 @@ void Klass::clean_weak_klass_links(BoolObjectClosure* is_alive, bool clean_alive
|
||||
Klass* sub = current->subklass();
|
||||
while (sub != NULL && !sub->is_loader_alive(is_alive)) {
|
||||
#ifndef PRODUCT
|
||||
if (log_is_enabled(Trace, classunload)) {
|
||||
if (log_is_enabled(Trace, class, unload)) {
|
||||
ResourceMark rm;
|
||||
log_trace(classunload)("unlinking class (subclass): %s", sub->external_name());
|
||||
log_trace(class, unload)("unlinking class (subclass): %s", sub->external_name());
|
||||
}
|
||||
#endif
|
||||
sub = sub->next_sibling();
|
||||
@ -416,9 +416,9 @@ void Klass::clean_weak_klass_links(BoolObjectClosure* is_alive, bool clean_alive
|
||||
// Find and set the first alive sibling
|
||||
Klass* sibling = current->next_sibling();
|
||||
while (sibling != NULL && !sibling->is_loader_alive(is_alive)) {
|
||||
if (log_is_enabled(Trace, classunload)) {
|
||||
if (log_is_enabled(Trace, class, unload)) {
|
||||
ResourceMark rm;
|
||||
log_trace(classunload)("[Unlinking class (sibling) %s]", sibling->external_name());
|
||||
log_trace(class, unload)("[Unlinking class (sibling) %s]", sibling->external_name());
|
||||
}
|
||||
sibling = sibling->next_sibling();
|
||||
}
|
||||
|
@ -350,7 +350,7 @@ JNI_ENTRY(jclass, jni_DefineClass(JNIEnv *env, const char *name, jobject loaderR
|
||||
&st,
|
||||
CHECK_NULL);
|
||||
|
||||
if (log_is_enabled(Debug, classresolve) && k != NULL) {
|
||||
if (log_is_enabled(Debug, class, resolve) && k != NULL) {
|
||||
trace_class_resolution(k);
|
||||
}
|
||||
|
||||
@ -420,7 +420,7 @@ JNI_ENTRY(jclass, jni_FindClass(JNIEnv *env, const char *name))
|
||||
result = find_class_from_class_loader(env, sym, true, loader,
|
||||
protection_domain, true, thread);
|
||||
|
||||
if (log_is_enabled(Debug, classresolve) && result != NULL) {
|
||||
if (log_is_enabled(Debug, class, resolve) && result != NULL) {
|
||||
trace_class_resolution(java_lang_Class::as_Klass(JNIHandles::resolve_non_null(result)));
|
||||
}
|
||||
|
||||
@ -3296,7 +3296,7 @@ static jclass lookupOne(JNIEnv* env, const char* name, TRAPS) {
|
||||
TempNewSymbol sym = SymbolTable::new_symbol(name, CHECK_NULL);
|
||||
jclass result = find_class_from_class_loader(env, sym, true, loader, protection_domain, true, CHECK_NULL);
|
||||
|
||||
if (log_is_enabled(Debug, classresolve) && result != NULL) {
|
||||
if (log_is_enabled(Debug, class, resolve) && result != NULL) {
|
||||
trace_class_resolution(java_lang_Class::as_Klass(JNIHandles::resolve_non_null(result)));
|
||||
}
|
||||
return result;
|
||||
|
@ -210,9 +210,9 @@ static void trace_class_resolution_impl(Klass* to_class, TRAPS) {
|
||||
const char * to = to_class->external_name();
|
||||
// print in a single call to reduce interleaving between threads
|
||||
if (source_file != NULL) {
|
||||
log_debug(classresolve)("%s %s %s:%d (%s)", from, to, source_file, line_number, trace);
|
||||
log_debug(class, resolve)("%s %s %s:%d (%s)", from, to, source_file, line_number, trace);
|
||||
} else {
|
||||
log_debug(classresolve)("%s %s (%s)", from, to, trace);
|
||||
log_debug(class, resolve)("%s %s (%s)", from, to, trace);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -805,7 +805,7 @@ JVM_ENTRY(jclass, JVM_FindClassFromBootLoader(JNIEnv* env,
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (log_is_enabled(Debug, classresolve)) {
|
||||
if (log_is_enabled(Debug, class, resolve)) {
|
||||
trace_class_resolution(k);
|
||||
}
|
||||
return (jclass) JNIHandles::make_local(env, k->java_mirror());
|
||||
@ -842,7 +842,7 @@ JVM_ENTRY(jclass, JVM_FindClassFromCaller(JNIEnv* env, const char* name,
|
||||
jclass result = find_class_from_class_loader(env, h_name, init, h_loader,
|
||||
h_prot, false, THREAD);
|
||||
|
||||
if (log_is_enabled(Debug, classresolve) && result != NULL) {
|
||||
if (log_is_enabled(Debug, class, resolve) && result != NULL) {
|
||||
trace_class_resolution(java_lang_Class::as_Klass(JNIHandles::resolve_non_null(result)));
|
||||
}
|
||||
return result;
|
||||
@ -872,7 +872,7 @@ JVM_ENTRY(jclass, JVM_FindClassFromClass(JNIEnv *env, const char *name,
|
||||
jclass result = find_class_from_class_loader(env, h_name, init, h_loader,
|
||||
h_prot, true, thread);
|
||||
|
||||
if (log_is_enabled(Debug, classresolve) && result != NULL) {
|
||||
if (log_is_enabled(Debug, class, resolve) && result != NULL) {
|
||||
// this function is generally only used for class loading during verification.
|
||||
ResourceMark rm;
|
||||
oop from_mirror = JNIHandles::resolve_non_null(from);
|
||||
@ -882,7 +882,7 @@ JVM_ENTRY(jclass, JVM_FindClassFromClass(JNIEnv *env, const char *name,
|
||||
oop mirror = JNIHandles::resolve_non_null(result);
|
||||
Klass* to_class = java_lang_Class::as_Klass(mirror);
|
||||
const char * to = to_class->external_name();
|
||||
log_debug(classresolve)("%s %s (verification)", from_name, to);
|
||||
log_debug(class, resolve)("%s %s (verification)", from_name, to);
|
||||
}
|
||||
|
||||
return result;
|
||||
@ -950,7 +950,7 @@ static jclass jvm_define_class_common(JNIEnv *env, const char *name,
|
||||
&st,
|
||||
CHECK_NULL);
|
||||
|
||||
if (log_is_enabled(Debug, classresolve) && k != NULL) {
|
||||
if (log_is_enabled(Debug, class, resolve) && k != NULL) {
|
||||
trace_class_resolution(k);
|
||||
}
|
||||
|
||||
|
@ -489,7 +489,7 @@ JvmtiEnv::AddToBootstrapClassLoaderSearch(const char* segment) {
|
||||
ObjectLocker ol(loader_lock, thread);
|
||||
|
||||
// add the jar file to the bootclasspath
|
||||
log_info(classload)("opened: %s", zip_entry->name());
|
||||
log_info(class, load)("opened: %s", zip_entry->name());
|
||||
ClassLoaderExt::append_boot_classpath(zip_entry);
|
||||
return JVMTI_ERROR_NONE;
|
||||
} else {
|
||||
@ -640,11 +640,11 @@ JvmtiEnv::SetVerboseFlag(jvmtiVerboseFlag flag, jboolean value) {
|
||||
break;
|
||||
case JVMTI_VERBOSE_CLASS:
|
||||
if (value == 0) {
|
||||
LogConfiguration::parse_log_arguments("stdout", "classunload=off", NULL, NULL, NULL);
|
||||
LogConfiguration::parse_log_arguments("stdout", "classload=off", NULL, NULL, NULL);
|
||||
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", "classload=info", NULL, NULL, NULL);
|
||||
LogConfiguration::parse_log_arguments("stdout", "classunload=info", NULL, NULL, NULL);
|
||||
LogConfiguration::parse_log_arguments("stdout", "class+load=info", NULL, NULL, NULL);
|
||||
LogConfiguration::parse_log_arguments("stdout", "class+unload=info", NULL, NULL, NULL);
|
||||
}
|
||||
break;
|
||||
case JVMTI_VERBOSE_GC:
|
||||
|
@ -1555,7 +1555,7 @@ int WhiteBox::offset_for_field(const char* field_name, oop object,
|
||||
if (res == NULL) {
|
||||
tty->print_cr("Invalid layout of %s at %s", ik->external_name(),
|
||||
name_symbol->as_C_string());
|
||||
vm_exit_during_initialization("Invalid layout of preloaded class: use -Xlog:classload=info to see the origin of the problem class");
|
||||
vm_exit_during_initialization("Invalid layout of preloaded class: use -Xlog:class+load=info to see the origin of the problem class");
|
||||
}
|
||||
|
||||
//fetch the field at the offset we've found
|
||||
|
@ -411,15 +411,15 @@ static AliasedFlag const aliased_jvm_flags[] = {
|
||||
static AliasedLoggingFlag const aliased_logging_flags[] = {
|
||||
{ "PrintCompressedOopsMode", LogLevel::Info, true, LOG_TAGS(gc, heap, coops) },
|
||||
{ "TraceBiasedLocking", LogLevel::Info, true, LOG_TAGS(biasedlocking) },
|
||||
{ "TraceClassLoading", LogLevel::Info, true, LOG_TAGS(classload) },
|
||||
{ "TraceClassLoadingPreorder", LogLevel::Debug, true, LOG_TAGS(classload, preorder) },
|
||||
{ "TraceClassPaths", LogLevel::Info, true, LOG_TAGS(classpath) },
|
||||
{ "TraceClassResolution", LogLevel::Debug, true, LOG_TAGS(classresolve) },
|
||||
{ "TraceClassUnloading", LogLevel::Info, true, LOG_TAGS(classunload) },
|
||||
{ "TraceClassLoading", LogLevel::Info, true, LOG_TAGS(class, load) },
|
||||
{ "TraceClassLoadingPreorder", LogLevel::Debug, true, LOG_TAGS(class, preorder) },
|
||||
{ "TraceClassPaths", LogLevel::Info, true, LOG_TAGS(class, path) },
|
||||
{ "TraceClassResolution", LogLevel::Debug, true, LOG_TAGS(class, resolve) },
|
||||
{ "TraceClassUnloading", LogLevel::Info, true, LOG_TAGS(class, unload) },
|
||||
{ "TraceExceptions", LogLevel::Info, true, LOG_TAGS(exceptions) },
|
||||
{ "TraceLoaderConstraints", LogLevel::Info, true, LOG_TAGS(classload, constraints) },
|
||||
{ "TraceLoaderConstraints", LogLevel::Info, true, LOG_TAGS(class, loader, constraints) },
|
||||
{ "TraceMonitorInflation", LogLevel::Debug, true, LOG_TAGS(monitorinflation) },
|
||||
{ "TraceSafepointCleanupTime", LogLevel::Info, true, LOG_TAGS(safepointcleanup) },
|
||||
{ "TraceSafepointCleanupTime", LogLevel::Info, true, LOG_TAGS(safepoint, cleanup) },
|
||||
{ "TraceJVMTIObjectTagging", LogLevel::Debug, true, LOG_TAGS(jvmti, objecttagging) },
|
||||
{ NULL, LogLevel::Off, false, LOG_TAGS(_NO_TAG) }
|
||||
};
|
||||
@ -427,8 +427,8 @@ static AliasedLoggingFlag const aliased_logging_flags[] = {
|
||||
#ifndef PRODUCT
|
||||
// These options are removed in jdk9. Remove this code for jdk10.
|
||||
static AliasedFlag const removed_develop_logging_flags[] = {
|
||||
{ "TraceClassInitialization", "-Xlog:classinit" },
|
||||
{ "TraceClassLoaderData", "-Xlog:classloaderdata" },
|
||||
{ "TraceClassInitialization", "-Xlog:class+init" },
|
||||
{ "TraceClassLoaderData", "-Xlog:class+loader+data" },
|
||||
{ "TraceDefaultMethods", "-Xlog:defaultmethods=debug" },
|
||||
{ "TraceItables", "-Xlog:itables=debug" },
|
||||
{ "TraceMonitorMismatch", "-Xlog:monitormismatch=info" },
|
||||
@ -2846,8 +2846,8 @@ jint Arguments::parse_each_vm_init_arg(const JavaVMInitArgs* args,
|
||||
// -verbose:[class/gc/jni]
|
||||
if (match_option(option, "-verbose", &tail)) {
|
||||
if (!strcmp(tail, ":class") || !strcmp(tail, "")) {
|
||||
LogConfiguration::configure_stdout(LogLevel::Info, true, LOG_TAGS(classload));
|
||||
LogConfiguration::configure_stdout(LogLevel::Info, true, LOG_TAGS(classunload));
|
||||
LogConfiguration::configure_stdout(LogLevel::Info, true, LOG_TAGS(class, load));
|
||||
LogConfiguration::configure_stdout(LogLevel::Info, true, LOG_TAGS(class, unload));
|
||||
} else if (!strcmp(tail, ":gc")) {
|
||||
LogConfiguration::configure_stdout(LogLevel::Info, true, LOG_TAGS(gc));
|
||||
} else if (!strcmp(tail, ":jni")) {
|
||||
@ -3488,7 +3488,7 @@ jint Arguments::parse_each_vm_init_arg(const JavaVMInitArgs* args,
|
||||
|
||||
// PrintSharedArchiveAndExit will turn on
|
||||
// -Xshare:on
|
||||
// -Xlog:classpath=info
|
||||
// -Xlog:class+path=info
|
||||
if (PrintSharedArchiveAndExit) {
|
||||
if (FLAG_SET_CMDLINE(bool, UseSharedSpaces, true) != Flag::SUCCESS) {
|
||||
return JNI_EINVAL;
|
||||
@ -3496,7 +3496,7 @@ jint Arguments::parse_each_vm_init_arg(const JavaVMInitArgs* args,
|
||||
if (FLAG_SET_CMDLINE(bool, RequireSharedSpaces, true) != Flag::SUCCESS) {
|
||||
return JNI_EINVAL;
|
||||
}
|
||||
LogConfiguration::configure_stdout(LogLevel::Info, true, LOG_TAGS(classpath));
|
||||
LogConfiguration::configure_stdout(LogLevel::Info, true, LOG_TAGS(class, path));
|
||||
}
|
||||
|
||||
// Change the default value for flags which have different default values
|
||||
|
@ -76,9 +76,9 @@ static void trace_class_resolution(const Klass* to_class) {
|
||||
const char * to = to_class->external_name();
|
||||
// print in a single call to reduce interleaving between threads
|
||||
if (source_file != NULL) {
|
||||
log_debug(classresolve)("%s %s %s:%d (reflection)", from, to, source_file, line_number);
|
||||
log_debug(class, resolve)("%s %s %s:%d (reflection)", from, to, source_file, line_number);
|
||||
} else {
|
||||
log_debug(classresolve)("%s %s (reflection)", from, to);
|
||||
log_debug(class, resolve)("%s %s (reflection)", from, to);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -761,7 +761,7 @@ static oop get_mirror_from_signature(methodHandle method,
|
||||
Handle(THREAD, protection_domain),
|
||||
true,
|
||||
CHECK_NULL);
|
||||
if (log_is_enabled(Debug, classresolve)) {
|
||||
if (log_is_enabled(Debug, class, resolve)) {
|
||||
trace_class_resolution(k);
|
||||
}
|
||||
return k->java_mirror();
|
||||
@ -816,7 +816,7 @@ static Handle new_type(Symbol* signature, KlassHandle k, TRAPS) {
|
||||
Handle(THREAD, k->protection_domain()),
|
||||
true, CHECK_(Handle()));
|
||||
|
||||
if (log_is_enabled(Debug, classresolve)) {
|
||||
if (log_is_enabled(Debug, class, resolve)) {
|
||||
trace_class_resolution(result);
|
||||
}
|
||||
|
||||
|
@ -545,7 +545,7 @@ void SafepointSynchronize::do_cleanup_tasks() {
|
||||
{
|
||||
const char* name = "deflating idle monitors";
|
||||
EventSafepointCleanupTask event;
|
||||
TraceTime timer(name, TRACETIME_LOG(Info, safepointcleanup));
|
||||
TraceTime timer(name, TRACETIME_LOG(Info, safepoint, cleanup));
|
||||
ObjectSynchronizer::deflate_idle_monitors();
|
||||
event_safepoint_cleanup_task_commit(event, name);
|
||||
}
|
||||
@ -553,14 +553,14 @@ void SafepointSynchronize::do_cleanup_tasks() {
|
||||
{
|
||||
const char* name = "updating inline caches";
|
||||
EventSafepointCleanupTask event;
|
||||
TraceTime timer(name, TRACETIME_LOG(Info, safepointcleanup));
|
||||
TraceTime timer(name, TRACETIME_LOG(Info, safepoint, cleanup));
|
||||
InlineCacheBuffer::update_inline_caches();
|
||||
event_safepoint_cleanup_task_commit(event, name);
|
||||
}
|
||||
{
|
||||
const char* name = "compilation policy safepoint handler";
|
||||
EventSafepointCleanupTask event;
|
||||
TraceTime timer("compilation policy safepoint handler", TRACETIME_LOG(Info, safepointcleanup));
|
||||
TraceTime timer("compilation policy safepoint handler", TRACETIME_LOG(Info, safepoint, cleanup));
|
||||
CompilationPolicy::policy()->do_safepoint_work();
|
||||
event_safepoint_cleanup_task_commit(event, name);
|
||||
}
|
||||
@ -568,7 +568,7 @@ void SafepointSynchronize::do_cleanup_tasks() {
|
||||
{
|
||||
const char* name = "mark nmethods";
|
||||
EventSafepointCleanupTask event;
|
||||
TraceTime timer(name, TRACETIME_LOG(Info, safepointcleanup));
|
||||
TraceTime timer(name, TRACETIME_LOG(Info, safepoint, cleanup));
|
||||
NMethodSweeper::mark_active_nmethods();
|
||||
event_safepoint_cleanup_task_commit(event, name);
|
||||
}
|
||||
@ -576,7 +576,7 @@ void SafepointSynchronize::do_cleanup_tasks() {
|
||||
if (SymbolTable::needs_rehashing()) {
|
||||
const char* name = "rehashing symbol table";
|
||||
EventSafepointCleanupTask event;
|
||||
TraceTime timer(name, TRACETIME_LOG(Info, safepointcleanup));
|
||||
TraceTime timer(name, TRACETIME_LOG(Info, safepoint, cleanup));
|
||||
SymbolTable::rehash_table();
|
||||
event_safepoint_cleanup_task_commit(event, name);
|
||||
}
|
||||
@ -584,7 +584,7 @@ void SafepointSynchronize::do_cleanup_tasks() {
|
||||
if (StringTable::needs_rehashing()) {
|
||||
const char* name = "rehashing string table";
|
||||
EventSafepointCleanupTask event;
|
||||
TraceTime timer(name, TRACETIME_LOG(Info, safepointcleanup));
|
||||
TraceTime timer(name, TRACETIME_LOG(Info, safepoint, cleanup));
|
||||
StringTable::rehash_table();
|
||||
event_safepoint_cleanup_task_commit(event, name);
|
||||
}
|
||||
@ -594,7 +594,7 @@ void SafepointSynchronize::do_cleanup_tasks() {
|
||||
// make sure concurrent sweep is done
|
||||
const char* name = "purging class loader data graph";
|
||||
EventSafepointCleanupTask event;
|
||||
TraceTime timer(name, TRACETIME_LOG(Info, safepointcleanup));
|
||||
TraceTime timer(name, TRACETIME_LOG(Info, safepoint, cleanup));
|
||||
ClassLoaderDataGraph::purge_if_needed();
|
||||
event_safepoint_cleanup_task_commit(event, name);
|
||||
}
|
||||
|
@ -138,9 +138,9 @@ void ClassLoadingService::notify_class_unloaded(InstanceKlass* k) {
|
||||
}
|
||||
}
|
||||
|
||||
if (log_is_enabled(Info, classunload)) {
|
||||
if (log_is_enabled(Info, class, unload)) {
|
||||
ResourceMark rm;
|
||||
log_info(classunload)("unloading class %s " INTPTR_FORMAT , k->external_name(), p2i(k));
|
||||
log_info(class, unload)("unloading class %s " INTPTR_FORMAT , k->external_name(), p2i(k));
|
||||
}
|
||||
}
|
||||
|
||||
@ -184,9 +184,9 @@ 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);
|
||||
LogConfiguration::parse_log_arguments("stdout", "class+load=info", NULL, NULL, NULL);
|
||||
} else {
|
||||
LogConfiguration::parse_log_arguments("stdout", "classload=off", NULL, NULL, NULL);
|
||||
LogConfiguration::parse_log_arguments("stdout", "class+load=off", NULL, NULL, NULL);
|
||||
}
|
||||
reset_trace_class_unloading();
|
||||
return verbose;
|
||||
@ -197,9 +197,9 @@ 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);
|
||||
LogConfiguration::parse_log_arguments("stdout", "class+unload=info", NULL, NULL, NULL);
|
||||
} else {
|
||||
LogConfiguration::parse_log_arguments("stdout", "classunload=off", NULL, NULL, NULL);
|
||||
LogConfiguration::parse_log_arguments("stdout", "class+unload=off", NULL, NULL, NULL);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -55,7 +55,7 @@ private:
|
||||
public:
|
||||
static void init();
|
||||
|
||||
static bool get_verbose() { return log_is_enabled(Info, classload); }
|
||||
static bool get_verbose() { return log_is_enabled(Info, class, load); }
|
||||
static bool set_verbose(bool verbose);
|
||||
static void reset_trace_class_unloading() NOT_MANAGEMENT_RETURN;
|
||||
|
||||
|
@ -27,7 +27,7 @@
|
||||
* @modules java.base/jdk.internal.org.objectweb.asm
|
||||
* @library patches
|
||||
* @build java.base/java.lang.invoke.MethodHandleHelper
|
||||
* @run main/bootclasspath -Xbatch -XX:+IgnoreUnrecognizedVMOptions -Xlog:classunload
|
||||
* @run main/bootclasspath -Xbatch -XX:+IgnoreUnrecognizedVMOptions -Xlog:class+unload
|
||||
* -XX:+PrintCompilation -XX:+TraceDependencies -XX:+TraceReferenceGC
|
||||
* -verbose:gc compiler.jsr292.CallSiteDepContextTest
|
||||
*/
|
||||
|
@ -56,17 +56,17 @@ import java.nio.file.Paths;
|
||||
* gc.g1.humongousObjects.ClassLoaderGenerator 1
|
||||
*
|
||||
* @run main/othervm -Xms256M -Xmx256M -XX:+UseG1GC -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:.
|
||||
* -Xlog:classload,classunload=debug:file=TestHumongousClassLoader_Full_GC.log
|
||||
* -Xlog:class+load,class+unload=debug:file=TestHumongousClassLoader_Full_GC.log
|
||||
* -XX:G1HeapRegionSize=1M
|
||||
* gc.g1.humongousObjects.TestHumongousClassLoader FULL_GC
|
||||
*
|
||||
* @run main/othervm -Xms256M -Xmx256M -XX:+UseG1GC -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:.
|
||||
* -Xlog:classload,classunload=debug:file=TestHumongousClassLoader_Full_GC_Mem_Pressure.log
|
||||
* -Xlog:class+load,class+unload=debug:file=TestHumongousClassLoader_Full_GC_Mem_Pressure.log
|
||||
* -XX:G1HeapRegionSize=1M
|
||||
* gc.g1.humongousObjects.TestHumongousClassLoader FULL_GC_MEMORY_PRESSURE
|
||||
*
|
||||
*@run main/othervm -Xms256M -Xmx256M -XX:+UseG1GC -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:.
|
||||
* -Xlog:classload,classunload=debug:file=TestHumongousClassLoader_CMC.log
|
||||
* -Xlog:class+load,class+unload=debug:file=TestHumongousClassLoader_CMC.log
|
||||
* -XX:G1HeapRegionSize=1M -XX:MaxTenuringThreshold=1
|
||||
* gc.g1.humongousObjects.TestHumongousClassLoader CMC
|
||||
*
|
||||
|
@ -154,7 +154,7 @@ public class BootAppendTests {
|
||||
APP_CLASS,
|
||||
BOOT_APPEND_DUPLICATE_MODULE_CLASS_NAME);
|
||||
OutputAnalyzer output = new OutputAnalyzer(pb.start());
|
||||
output.shouldContain("[classload] org.omg.CORBA.Context source: jrt:/java.corba");
|
||||
output.shouldContain("[class,load] org.omg.CORBA.Context source: jrt:/java.corba");
|
||||
}
|
||||
}
|
||||
|
||||
@ -179,11 +179,11 @@ public class BootAppendTests {
|
||||
APP_CLASS,
|
||||
BOOT_APPEND_MODULE_CLASS_NAME);
|
||||
OutputAnalyzer output = new OutputAnalyzer(pb.start());
|
||||
output.shouldContain("[classload] javax.sound.sampled.MyClass");
|
||||
output.shouldContain("[class,load] javax.sound.sampled.MyClass");
|
||||
|
||||
// When CDS is enabled, the shared class should be loaded from the archive.
|
||||
if (mode.equals("on")) {
|
||||
output.shouldContain("[classload] javax.sound.sampled.MyClass source: shared objects file");
|
||||
output.shouldContain("[class,load] javax.sound.sampled.MyClass source: shared objects file");
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -211,8 +211,8 @@ public class BootAppendTests {
|
||||
APP_CLASS,
|
||||
BOOT_APPEND_DUPLICATE_MODULE_CLASS_NAME);
|
||||
OutputAnalyzer output = new OutputAnalyzer(pb.start());
|
||||
output.shouldContain("[classload] org.omg.CORBA.Context");
|
||||
output.shouldMatch(".*\\[classload\\] org.omg.CORBA.Context source:.*bootAppend.jar");
|
||||
output.shouldContain("[class,load] org.omg.CORBA.Context");
|
||||
output.shouldMatch(".*\\[class,load\\] org.omg.CORBA.Context source:.*bootAppend.jar");
|
||||
}
|
||||
}
|
||||
|
||||
@ -235,13 +235,13 @@ public class BootAppendTests {
|
||||
APP_CLASS,
|
||||
BOOT_APPEND_CLASS_NAME);
|
||||
OutputAnalyzer output = new OutputAnalyzer(pb.start());
|
||||
output.shouldContain("[classload] nonjdk.myPackage.MyClass");
|
||||
output.shouldContain("[class,load] nonjdk.myPackage.MyClass");
|
||||
|
||||
// If CDS is enabled, the nonjdk.myPackage.MyClass should be loaded
|
||||
// from the shared archive.
|
||||
if (mode.equals("on")) {
|
||||
output.shouldContain(
|
||||
"[classload] nonjdk.myPackage.MyClass source: shared objects file");
|
||||
"[class,load] nonjdk.myPackage.MyClass source: shared objects file");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -40,7 +40,7 @@ public class ClassInitializationTest {
|
||||
public static void main(String... args) throws Exception {
|
||||
|
||||
// (1)
|
||||
ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-Xlog:classinit=info",
|
||||
ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-Xlog:class+init=info",
|
||||
"-Xverify:all",
|
||||
"-Xmx64m",
|
||||
"BadMap50");
|
||||
@ -53,7 +53,7 @@ public class ClassInitializationTest {
|
||||
|
||||
// (2)
|
||||
if (Platform.isDebugBuild()) {
|
||||
pb = ProcessTools.createJavaProcessBuilder("-Xlog:classinit=info",
|
||||
pb = ProcessTools.createJavaProcessBuilder("-Xlog:class+init=info",
|
||||
"-Xverify:all",
|
||||
"-XX:+EagerInitialization",
|
||||
"-Xmx64m",
|
||||
@ -63,13 +63,13 @@ public class ClassInitializationTest {
|
||||
out.shouldHaveExitValue(0);
|
||||
}
|
||||
|
||||
// (3) classinit should turn off.
|
||||
pb = ProcessTools.createJavaProcessBuilder("-Xlog:classinit=off",
|
||||
// (3) class+init should turn off.
|
||||
pb = ProcessTools.createJavaProcessBuilder("-Xlog:class+init=off",
|
||||
"-Xverify:all",
|
||||
"-Xmx64m",
|
||||
"BadMap50");
|
||||
out = new OutputAnalyzer(pb.start());
|
||||
out.shouldNotContain("[classinit]");
|
||||
out.shouldNotContain("[class,init]");
|
||||
out.shouldNotContain("Fail over class verification to old verifier for: BadMap50");
|
||||
|
||||
}
|
||||
|
@ -79,50 +79,50 @@ public class ClassLoadUnloadTest {
|
||||
|
||||
public static void main(String... args) throws Exception {
|
||||
|
||||
// -Xlog:classunload=info
|
||||
pb = exec("-Xlog:classunload=info");
|
||||
checkFor("[classunload]", "unloading class");
|
||||
// -Xlog:class+unload=info
|
||||
pb = exec("-Xlog:class+unload=info");
|
||||
checkFor("[class,unload]", "unloading class");
|
||||
|
||||
// -Xlog:classunload=off
|
||||
pb = exec("-Xlog:classunload=off");
|
||||
checkAbsent("[classunload]");
|
||||
// -Xlog:class+unload=off
|
||||
pb = exec("-Xlog:class+unload=off");
|
||||
checkAbsent("[class,unload]");
|
||||
|
||||
// -XX:+TraceClassUnloading
|
||||
pb = exec("-XX:+TraceClassUnloading");
|
||||
checkFor("[classunload]", "unloading class");
|
||||
checkFor("[class,unload]", "unloading class");
|
||||
|
||||
// -XX:-TraceClassUnloading
|
||||
pb = exec("-XX:-TraceClassUnloading");
|
||||
checkAbsent("[classunload]");
|
||||
checkAbsent("[class,unload]");
|
||||
|
||||
// -Xlog:classload=info
|
||||
pb = exec("-Xlog:classload=info");
|
||||
checkFor("[classload]", "java.lang.Object", "source:");
|
||||
// -Xlog:class+load=info
|
||||
pb = exec("-Xlog:class+load=info");
|
||||
checkFor("[class,load]", "java.lang.Object", "source:");
|
||||
|
||||
// -Xlog:classload=debug
|
||||
pb = exec("-Xlog:classload=debug");
|
||||
checkFor("[classload]", "java.lang.Object", "source:", "klass:", "super:", "loader:", "bytes:");
|
||||
// -Xlog:class+load=debug
|
||||
pb = exec("-Xlog:class+load=debug");
|
||||
checkFor("[class,load]", "java.lang.Object", "source:", "klass:", "super:", "loader:", "bytes:");
|
||||
|
||||
// -Xlog:classload=off
|
||||
pb = exec("-Xlog:classload=off");
|
||||
checkAbsent("[classload]");
|
||||
// -Xlog:class+load=off
|
||||
pb = exec("-Xlog:class+load=off");
|
||||
checkAbsent("[class,load]");
|
||||
|
||||
// -XX:+TraceClassLoading
|
||||
pb = exec("-XX:+TraceClassLoading");
|
||||
checkFor("[classload]", "java.lang.Object", "source:");
|
||||
checkFor("[class,load]", "java.lang.Object", "source:");
|
||||
|
||||
// -XX:-TraceClassLoading
|
||||
pb = exec("-XX:-TraceClassLoading");
|
||||
checkAbsent("[classload]");
|
||||
checkAbsent("[class,load]");
|
||||
|
||||
// -verbose:class
|
||||
pb = exec("-verbose:class");
|
||||
checkFor("[classload]", "java.lang.Object", "source:");
|
||||
checkFor("[classunload]", "unloading class");
|
||||
checkFor("[class,load]", "java.lang.Object", "source:");
|
||||
checkFor("[class,unload]", "unloading class");
|
||||
|
||||
// -Xlog:classloaderdata=trace
|
||||
pb = exec("-Xlog:classloaderdata=trace");
|
||||
checkFor("[classloaderdata]", "create class loader data");
|
||||
// -Xlog:class+loader+data=trace
|
||||
pb = exec("-Xlog:class+loader+data=trace");
|
||||
checkFor("[class,loader,data]", "create class loader data");
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -58,32 +58,32 @@ public class ClassResolutionTest {
|
||||
|
||||
public static void main(String... args) throws Exception {
|
||||
|
||||
// (1) classresolve should turn on.
|
||||
ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-Xlog:classresolve=debug",
|
||||
// (1) class+resolve should turn on.
|
||||
ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-Xlog:class+resolve=debug",
|
||||
ClassResolutionTestMain.class.getName());
|
||||
OutputAnalyzer o = new OutputAnalyzer(pb.start());
|
||||
o.shouldContain("[classresolve] ClassResolutionTest$ClassResolutionTestMain$Thing1Handler ClassResolutionTest$ClassResolutionTestMain$Thing1");
|
||||
o.shouldContain("[classresolve] resolve JVM_CONSTANT_MethodHandle");
|
||||
o.shouldContain("[class,resolve] ClassResolutionTest$ClassResolutionTestMain$Thing1Handler ClassResolutionTest$ClassResolutionTestMain$Thing1");
|
||||
o.shouldContain("[class,resolve] resolve JVM_CONSTANT_MethodHandle");
|
||||
|
||||
// (2) classresolve should turn off.
|
||||
pb = ProcessTools.createJavaProcessBuilder("-Xlog:classresolve=debug",
|
||||
"-Xlog:classresolve=off",
|
||||
// (2) class+resolve should turn off.
|
||||
pb = ProcessTools.createJavaProcessBuilder("-Xlog:class+resolve=debug",
|
||||
"-Xlog:class+resolve=off",
|
||||
ClassResolutionTestMain.class.getName());
|
||||
o = new OutputAnalyzer(pb.start());
|
||||
o.shouldNotContain("[classresolve]");
|
||||
o.shouldNotContain("[class,resolve]");
|
||||
|
||||
// (3) TraceClassResolution should turn on.
|
||||
pb = ProcessTools.createJavaProcessBuilder("-XX:+TraceClassResolution",
|
||||
ClassResolutionTestMain.class.getName());
|
||||
o = new OutputAnalyzer(pb.start());
|
||||
o.shouldContain("[classresolve] ClassResolutionTest$ClassResolutionTestMain$Thing1Handler ClassResolutionTest$ClassResolutionTestMain$Thing1");
|
||||
o.shouldContain("[class,resolve] ClassResolutionTest$ClassResolutionTestMain$Thing1Handler ClassResolutionTest$ClassResolutionTestMain$Thing1");
|
||||
|
||||
// (4) TraceClassResolution should turn off.
|
||||
pb = ProcessTools.createJavaProcessBuilder("-Xlog:classresolve=debug",
|
||||
pb = ProcessTools.createJavaProcessBuilder("-Xlog:class+resolve=debug",
|
||||
"-XX:-TraceClassResolution",
|
||||
ClassResolutionTestMain.class.getName());
|
||||
o = new OutputAnalyzer(pb.start());
|
||||
o.shouldNotContain("[classresolve]");
|
||||
o.shouldNotContain("[class,resolve]");
|
||||
|
||||
};
|
||||
|
||||
|
@ -67,22 +67,22 @@ public class LoaderConstraintsTest {
|
||||
pb = exec("-XX:+TraceLoaderConstraints");
|
||||
out = new OutputAnalyzer(pb.start());
|
||||
out.getOutput();
|
||||
out.shouldContain("[classload,constraints] adding new constraint for name: java/lang/Class, loader[0]: jdk/internal/loader/ClassLoaders$AppClassLoader, loader[1]: <bootloader>");
|
||||
out.shouldContain("[class,loader,constraints] adding new constraint for name: java/lang/Class, loader[0]: jdk/internal/loader/ClassLoaders$AppClassLoader, loader[1]: <bootloader>");
|
||||
|
||||
// -Xlog:classload+constraints=info
|
||||
pb = exec("-Xlog:classload+constraints=info");
|
||||
// -Xlog:class+loader+constraints=info
|
||||
pb = exec("-Xlog:class+loader+constraints=info");
|
||||
out = new OutputAnalyzer(pb.start());
|
||||
out.shouldContain("[classload,constraints] adding new constraint for name: java/lang/Class, loader[0]: jdk/internal/loader/ClassLoaders$AppClassLoader, loader[1]: <bootloader>");
|
||||
out.shouldContain("[class,loader,constraints] adding new constraint for name: java/lang/Class, loader[0]: jdk/internal/loader/ClassLoaders$AppClassLoader, loader[1]: <bootloader>");
|
||||
|
||||
// -XX:-TraceLoaderConstraints
|
||||
pb = exec("-XX:-TraceLoaderConstraints");
|
||||
out = new OutputAnalyzer(pb.start());
|
||||
out.shouldNotContain("[classload,constraints]");
|
||||
out.shouldNotContain("[class,loaderconstraints]");
|
||||
|
||||
// -Xlog:classload+constraints=off
|
||||
pb = exec("-Xlog:classload+constraints=off");
|
||||
// -Xlog:class+loader+constraints=off
|
||||
pb = exec("-Xlog:class+loader+constraints=off");
|
||||
out = new OutputAnalyzer(pb.start());
|
||||
out.shouldNotContain("[classload,constraints]");
|
||||
out.shouldNotContain("[class,loader,constraints]");
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -49,8 +49,8 @@ public class RemovedDevelopFlagsTest {
|
||||
|
||||
public static void main(String... args) throws Exception {
|
||||
if (Platform.isDebugBuild()){
|
||||
exec("TraceClassInitialization", "-Xlog:classinit");
|
||||
exec("TraceClassLoaderData", "-Xlog:classloaderdata");
|
||||
exec("TraceClassInitialization", "-Xlog:class+init");
|
||||
exec("TraceClassLoaderData", "-Xlog:class+loader+data");
|
||||
exec("TraceDefaultMethods", "-Xlog:defaultmethods=debug");
|
||||
exec("TraceItables", "-Xlog:itables=debug");
|
||||
exec("TraceSafepoint", "-Xlog:safepoint=debug");
|
||||
|
@ -24,7 +24,7 @@
|
||||
/*
|
||||
* @test
|
||||
* @bug 8149991
|
||||
* @summary safepointcleanup=info should have output from the code
|
||||
* @summary safepoint+cleanup=info should have output from the code
|
||||
* @library /testlibrary
|
||||
* @modules java.base/jdk.internal.misc
|
||||
* java.management
|
||||
@ -38,7 +38,7 @@ import jdk.test.lib.ProcessTools;
|
||||
public class SafepointCleanupTest {
|
||||
static void analyzeOutputOn(ProcessBuilder pb) throws Exception {
|
||||
OutputAnalyzer output = new OutputAnalyzer(pb.start());
|
||||
output.shouldContain("[safepointcleanup]");
|
||||
output.shouldContain("[safepoint,cleanup]");
|
||||
output.shouldContain("deflating idle monitors");
|
||||
output.shouldContain("updating inline caches");
|
||||
output.shouldContain("compilation policy safepoint handler");
|
||||
@ -49,12 +49,12 @@ public class SafepointCleanupTest {
|
||||
|
||||
static void analyzeOutputOff(ProcessBuilder pb) throws Exception {
|
||||
OutputAnalyzer output = new OutputAnalyzer(pb.start());
|
||||
output.shouldNotContain("[safepointcleanup]");
|
||||
output.shouldNotContain("[safepoint,cleanup]");
|
||||
output.shouldHaveExitValue(0);
|
||||
}
|
||||
|
||||
public static void main(String[] args) throws Exception {
|
||||
ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-Xlog:safepointcleanup=info",
|
||||
ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-Xlog:safepoint+cleanup=info",
|
||||
InnerClass.class.getName());
|
||||
analyzeOutputOn(pb);
|
||||
|
||||
@ -62,7 +62,7 @@ public class SafepointCleanupTest {
|
||||
InnerClass.class.getName());
|
||||
analyzeOutputOn(pb);
|
||||
|
||||
pb = ProcessTools.createJavaProcessBuilder("-Xlog:safepointcleanup=off",
|
||||
pb = ProcessTools.createJavaProcessBuilder("-Xlog:safepoint+cleanup=off",
|
||||
InnerClass.class.getName());
|
||||
analyzeOutputOff(pb);
|
||||
|
||||
|
@ -54,12 +54,12 @@ public class XpatchTraceCL {
|
||||
|
||||
OutputAnalyzer output = new OutputAnalyzer(pb.start());
|
||||
// "modules" jimage case.
|
||||
output.shouldContain("[classload] java.lang.Thread source: jrt:/java.base");
|
||||
output.shouldContain("[class,load] java.lang.Thread source: jrt:/java.base");
|
||||
// -Xpatch case.
|
||||
output.shouldContain("[classload] javax.naming.spi.NamingManager source: mods" +
|
||||
output.shouldContain("[class,load] javax.naming.spi.NamingManager source: mods" +
|
||||
File.separator + "java.naming");
|
||||
// -cp case.
|
||||
output.shouldContain("[classload] XpatchMain source: file");
|
||||
output.shouldContain("[class,load] XpatchMain source: file");
|
||||
|
||||
// Test -XX:+TraceClassLoading output for -Xbootclasspath/a
|
||||
source = "package XpatchTraceCL_pkg; " +
|
||||
@ -77,7 +77,7 @@ public class XpatchTraceCL {
|
||||
"-XX:+TraceClassLoading", "XpatchMain", "XpatchTraceCL_pkg.ItIsI");
|
||||
output = new OutputAnalyzer(pb.start());
|
||||
// -Xbootclasspath/a case.
|
||||
output.shouldContain("[classload] XpatchTraceCL_pkg.ItIsI source: xbcp");
|
||||
output.shouldContain("[class,load] XpatchTraceCL_pkg.ItIsI source: xbcp");
|
||||
output.shouldHaveExitValue(0);
|
||||
}
|
||||
}
|
||||
|
@ -38,7 +38,7 @@ public class TraceClassRes {
|
||||
"-XX:+TraceClassResolution", "-verify", "-Xshare:off", "-version");
|
||||
|
||||
OutputAnalyzer output = new OutputAnalyzer(pb.start());
|
||||
output.shouldContain("[classresolve] java.lang.ClassLoader java.lang.Throwable ClassLoader.java (verification)");
|
||||
output.shouldContain("[class,resolve] java.lang.ClassLoader java.lang.Throwable ClassLoader.java (verification)");
|
||||
output.shouldHaveExitValue(0);
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user