src/share/vm/runtime/arguments.cpp
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File
*** old/src/share/vm/runtime/arguments.cpp	Mon Jan 11 11:51:31 2016
--- new/src/share/vm/runtime/arguments.cpp	Mon Jan 11 11:51:31 2016

*** 31,40 **** --- 31,41 ---- #include "gc/shared/cardTableRS.hpp" #include "gc/shared/genCollectedHeap.hpp" #include "gc/shared/referenceProcessor.hpp" #include "gc/shared/taskqueue.hpp" #include "logging/log.hpp" + #include "logging/logTag.hpp" #include "logging/logConfiguration.hpp" #include "memory/allocation.inline.hpp" #include "memory/universe.inline.hpp" #include "oops/oop.inline.hpp" #include "prims/jvmtiExport.hpp"
*** 397,414 **** --- 398,412 ---- { "ParallelCMSThreads", "ConcGCThreads" }, { "CreateMinidumpOnCrash", "CreateCoredumpOnCrash" }, { NULL, NULL} }; ! static AliasedFlag const aliased_jvm_logging_flags[] = { ! { "-XX:+TraceClassResolution", "-Xlog:classresolve=info"}, ! { "-XX:-TraceClassResolution", "-Xlog:classresolve=off"}, ! { "-XX:+TraceExceptions", "-Xlog:exceptions=info" }, { "-XX:-TraceExceptions", "-Xlog:exceptions=off" }, { "-XX:+TraceMonitorInflation", "-Xlog:monitorinflation=debug" }, { "-XX:-TraceMonitorInflation", "-Xlog:monitorinflation=off" }, { NULL, NULL } ! static AliasedLoggingFlag const aliased_logging_flags[] = { ! { "TraceClassResolution", LogLevel::Info, true, LogTag::_classresolve }, ! { "TraceExceptions", LogLevel::Info, true, LogTag::_exceptions }, ! { "TraceMonitorInflation", LogLevel::Debug, true, LogTag::_monitorinflation }, + { NULL, LogLevel::Off, false, LogTag::__NO_TAG } }; // Return true if "v" is less than "other", where "other" may be "undefined". static bool version_less_than(JDK_Version v, JDK_Version other) { assert(!v.is_undefined(), "must be defined");
*** 937,958 **** --- 935,953 ---- } ShouldNotReachHere(); return NULL; } // lookup_logging_aliases // Called from parse_each_vm_init_arg(). Should be called on -XX options before specific cases are checked. // If arg matches any aliased_jvm_logging_flags entry, look up the real name and copy it into buffer. ! bool Arguments::lookup_logging_aliases(const char* arg, char* buffer) { for (size_t i = 0; aliased_jvm_logging_flags[i].alias_name != NULL; i++) { const AliasedFlag& flag_status = aliased_jvm_logging_flags[i]; if (strcmp(flag_status.alias_name, arg) == 0) { strcpy(buffer, flag_status.real_name); return true; + AliasedLoggingFlag Arguments::catch_logging_aliases(const char* name){ + for (size_t i = 0; aliased_logging_flags[i].alias_name != NULL; i++) { + const AliasedLoggingFlag& alf = aliased_logging_flags[i]; ! if (strcmp(alf.alias_name, name) == 0) { + return alf; } } ! return false; ! AliasedLoggingFlag a = {NULL, LogLevel::Off, false, LogTag::__NO_TAG}; + return a; } bool Arguments::parse_argument(const char* arg, Flag::Flags origin) { // range of acceptable characters spelled out for portability reasons
*** 960,978 **** --- 955,984 ---- #define BUFLEN 255 char name[BUFLEN+1]; 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); + if (alf.alias_name != NULL){ + LogConfiguration::configure_stdout(LogLevel::Off, alf.exactMatch, VAR_LOG_TAGS(alf.tag)); + return true; + } real_name = handle_aliases_and_deprecation(name, warn_if_deprecated); if (real_name == NULL) { return false; } return set_bool_flag(real_name, false, origin); } if (sscanf(arg, "+%" XSTR(BUFLEN) NAME_RANGE "%c", name, &dummy) == 1) { + alf = catch_logging_aliases(name); + if (alf.alias_name != NULL){ + LogConfiguration::configure_stdout(alf.level, alf.exactMatch, VAR_LOG_TAGS(alf.tag)); + return true; + } real_name = handle_aliases_and_deprecation(name, warn_if_deprecated); if (real_name == NULL) { return false; } return set_bool_flag(real_name, true, origin);
*** 2627,2637 **** --- 2633,2643 ---- // iterate over arguments for (int index = 0; index < args->nOptions; index++) { bool is_absolute_path = false; // for -agentpath vs -agentlib ! const JavaVMOption* option = args->options + index; if (!match_option(option, "-Djava.class.path", &tail) && !match_option(option, "-Dsun.java.command", &tail) && !match_option(option, "-Dsun.java.launcher", &tail)) {
*** 2641,2660 **** --- 2647,2656 ---- // omitted from jvm_args string as each have their own PerfData // string constant object. build_jvm_args(option->optionString); } // char buffer to store looked up logging option. char aliased_logging_option[256]; // Catch -XX options which are aliased to Unified logging commands. if (match_option(option, "-XX:", &tail)) { if (lookup_logging_aliases(option->optionString, aliased_logging_option)) { option->optionString = aliased_logging_option; } } // -verbose:[class/gc/jni] if (match_option(option, "-verbose", &tail)) { if (!strcmp(tail, ":class") || !strcmp(tail, "")) { if (FLAG_SET_CMDLINE(bool, TraceClassLoading, true) != Flag::SUCCESS) { return JNI_EINVAL;

src/share/vm/runtime/arguments.cpp
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File