8149995: TraceClassLoadingPreorder has been converted to Unified Logging

TraceClassLoadingPreorder has been converted to Unified Logging. Logging alias table now has extra columns to support multi-tag configurations.

Reviewed-by: iklam, coleenp
This commit is contained in:
Max Ockner 2016-03-14 15:06:49 -04:00
parent edd3f7ca77
commit 5f9883ad73
6 changed files with 30 additions and 26 deletions

@ -5684,15 +5684,16 @@ void ClassFileParser::parse_stream(const ClassFileStream* const stream,
}
if (!is_internal()) {
if (TraceClassLoadingPreorder) {
tty->print("[Loading %s",
_class_name->as_klass_external_name());
if (log_is_enabled(Debug, classload, preorder)){
ResourceMark rm(THREAD);
outputStream* log = LogHandle(classload, preorder)::debug_stream();
log->print("%s", _class_name->as_klass_external_name());
if (stream->source() != NULL) {
tty->print(" from %s", stream->source());
log->print(" source: %s", stream->source());
}
tty->print_cr("]");
log->cr();
}
#if INCLUDE_CDS
if (DumpLoadedClassList != NULL && stream->source() != NULL && classlist_file->is_open()) {
// Only dump the classes that can be stored into CDS archive

@ -68,6 +68,7 @@
LOG_TAG(phases) \
LOG_TAG(plab) \
LOG_TAG(promotion) \
LOG_TAG(preorder) /* Trace all classes loaded in order referenced (not loaded) */ \
LOG_TAG(protectiondomain) /* "Trace protection domain verification" */ \
LOG_TAG(ref) \
LOG_TAG(refine) \

@ -879,7 +879,7 @@ int MetaspaceShared::preload_and_dump(const char* class_list_path,
InstanceKlass* ik = InstanceKlass::cast(klass);
// Should be class load order as per -XX:+TraceClassLoadingPreorder
// Should be class load order as per -Xlog:classload+preorder
class_promote_order->append(ik);
// Link the class to cause the bytecodes to be rewritten and the

@ -405,15 +405,16 @@ static AliasedFlag const aliased_jvm_flags[] = {
};
static AliasedLoggingFlag const aliased_logging_flags[] = {
{ "TraceBiasedLocking", LogLevel::Info, true, LogTag::_biasedlocking },
{ "TraceClassLoading", LogLevel::Info, true, LogTag::_classload },
{ "TraceClassPaths", LogLevel::Info, true, LogTag::_classpath },
{ "TraceClassResolution", LogLevel::Debug, true, LogTag::_classresolve },
{ "TraceClassUnloading", LogLevel::Info, true, LogTag::_classunload },
{ "TraceExceptions", LogLevel::Info, true, LogTag::_exceptions },
{ "TraceMonitorInflation", LogLevel::Debug, true, LogTag::_monitorinflation },
{ "TraceSafepointCleanupTime", LogLevel::Info, true, LogTag::_safepointcleanup },
{ NULL, LogLevel::Off, false, LogTag::__NO_TAG }
{ "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) },
{ "TraceExceptions", LogLevel::Info, true, LOG_TAGS(exceptions) },
{ "TraceMonitorInflation", LogLevel::Debug, true, LOG_TAGS(monitorinflation) },
{ "TraceSafepointCleanupTime", LogLevel::Info, true, LOG_TAGS(safepointcleanup) },
{ NULL, LogLevel::Off, false, LOG_TAGS(_NO_TAG) }
};
// Return true if "v" is less than "other", where "other" may be "undefined".
@ -953,7 +954,7 @@ AliasedLoggingFlag Arguments::catch_logging_aliases(const char* name){
return alf;
}
}
AliasedLoggingFlag a = {NULL, LogLevel::Off, false, LogTag::__NO_TAG};
AliasedLoggingFlag a = {NULL, LogLevel::Off, false, LOG_TAGS(_NO_TAG)};
return a;
}
@ -966,12 +967,11 @@ bool Arguments::parse_argument(const char* arg, Flag::Flags origin) {
char dummy;
const char* real_name;
bool warn_if_deprecated = true;
AliasedLoggingFlag alf;
if (sscanf(arg, "-%" XSTR(BUFLEN) NAME_RANGE "%c", name, &dummy) == 1) {
alf = catch_logging_aliases(name);
AliasedLoggingFlag alf = catch_logging_aliases(name);
if (alf.alias_name != NULL){
LogConfiguration::configure_stdout(LogLevel::Off, alf.exactMatch, alf.tag, LogTag::__NO_TAG);
LogConfiguration::configure_stdout(LogLevel::Off, alf.exactMatch, alf.tag0, alf.tag1, alf.tag2, alf.tag3, alf.tag4, alf.tag5);
return true;
}
real_name = handle_aliases_and_deprecation(name, warn_if_deprecated);
@ -981,9 +981,9 @@ bool Arguments::parse_argument(const char* arg, Flag::Flags origin) {
return set_bool_flag(real_name, false, origin);
}
if (sscanf(arg, "+%" XSTR(BUFLEN) NAME_RANGE "%c", name, &dummy) == 1) {
alf = catch_logging_aliases(name);
AliasedLoggingFlag alf = catch_logging_aliases(name);
if (alf.alias_name != NULL){
LogConfiguration::configure_stdout(alf.level, alf.exactMatch, alf.tag, LogTag::__NO_TAG);
LogConfiguration::configure_stdout(alf.level, alf.exactMatch, alf.tag0, alf.tag1, alf.tag2, alf.tag3, alf.tag4, alf.tag5);
return true;
}
real_name = handle_aliases_and_deprecation(name, warn_if_deprecated);

@ -230,7 +230,12 @@ typedef struct {
const char* alias_name;
LogLevelType level;
bool exactMatch;
LogTagType tag;
LogTagType tag0;
LogTagType tag1;
LogTagType tag2;
LogTagType tag3;
LogTagType tag4;
LogTagType tag5;
} AliasedLoggingFlag;
class Arguments : AllStatic {

@ -2382,9 +2382,6 @@ public:
product(bool, IgnoreEmptyClassPaths, false, \
"Ignore empty path elements in -classpath") \
\
product(bool, TraceClassLoadingPreorder, false, \
"Trace all classes loaded in order referenced (not loaded)") \
\
product_rw(bool, TraceLoaderConstraints, false, \
"Trace loader constraints") \
\