8256718: Obsolete the long term deprecated and aliased Trace flags

Reviewed-by: sspitsyn, iklam, dholmes, coleenp
This commit is contained in:
Harold Seigel 2020-12-03 13:14:57 +00:00
parent 4a267f1bc2
commit e4497c9e69
23 changed files with 37 additions and 310 deletions

View File

@ -132,8 +132,6 @@ void MethodHandles::jump_to_lambda_form(MacroAssembler* _masm,
assert(recv != noreg, "required register");
assert(method_temp == rmethod, "required register for loading method");
//NOT_PRODUCT({ FlagSetting fs(TraceMethodHandles, true); trace_method_handle(_masm, "LZMH"); });
// Load the invoker, as MH -> MH.form -> LF.vmentry
__ verify_oop(recv);
__ load_heap_oop(method_temp, Address(recv, NONZERO(java_lang_invoke_MethodHandle::form_offset())), temp2);

View File

@ -168,8 +168,6 @@ void MethodHandles::jump_to_lambda_form(MacroAssembler* _masm,
assert(recv != noreg, "required register");
assert(method_temp == rbx, "required register for loading method");
//NOT_PRODUCT({ FlagSetting fs(TraceMethodHandles, true); trace_method_handle(_masm, "LZMH"); });
// Load the invoker, as MH -> MH.form -> LF.vmentry
__ verify_oop(recv);
__ load_heap_oop(method_temp, Address(recv, NONZERO(java_lang_invoke_MethodHandle::form_offset())), temp2);

View File

@ -1009,7 +1009,7 @@ public:
// Printing
void print_short_name(outputStream* st = tty); // prints as klassname::methodname; Exposed so field engineers can debug VM
#if INCLUDE_JVMTI
void print_name(outputStream* st = tty); // prints as "virtual void foo(int)"; exposed for TraceRedefineClasses
void print_name(outputStream* st = tty); // prints as "virtual void foo(int)"; exposed for -Xlog:redefine+class
#else
void print_name(outputStream* st = tty) PRODUCT_RETURN; // prints as "virtual void foo(int)"
#endif

View File

@ -557,6 +557,22 @@ static SpecialFlag const special_jvm_flags[] = {
{ "Debugging", JDK_Version::undefined(), JDK_Version::jdk(16), JDK_Version::jdk(17) },
{ "UseRDPCForConstantTableBase", JDK_Version::undefined(), JDK_Version::jdk(16), JDK_Version::jdk(17) },
{ "VerifyMergedCPBytecodes", JDK_Version::undefined(), JDK_Version::jdk(16), JDK_Version::jdk(17) },
{ "PrintSharedSpaces", JDK_Version::undefined(), JDK_Version::jdk(16), JDK_Version::jdk(17) },
{ "TraceBiasedLocking", JDK_Version::undefined(), JDK_Version::jdk(16), JDK_Version::jdk(17) },
{ "TraceClassLoading", JDK_Version::undefined(), JDK_Version::jdk(16), JDK_Version::jdk(17) },
{ "TraceClassLoadingPreorder", JDK_Version::undefined(), JDK_Version::jdk(16), JDK_Version::jdk(17) },
{ "TraceClassPaths", JDK_Version::undefined(), JDK_Version::jdk(16), JDK_Version::jdk(17) },
{ "TraceClassResolution", JDK_Version::undefined(), JDK_Version::jdk(16), JDK_Version::jdk(17) },
{ "TraceClassUnloading", JDK_Version::undefined(), JDK_Version::jdk(16), JDK_Version::jdk(17) },
{ "TraceExceptions", JDK_Version::undefined(), JDK_Version::jdk(16), JDK_Version::jdk(17) },
{ "TraceInvokeDynamic", JDK_Version::undefined(), JDK_Version::jdk(16), JDK_Version::jdk(17) },
{ "TraceLoaderConstraints", JDK_Version::undefined(), JDK_Version::jdk(16), JDK_Version::jdk(17) },
{ "TraceMethodHandles", JDK_Version::undefined(), JDK_Version::jdk(16), JDK_Version::jdk(17) },
{ "TraceMonitorInflation", JDK_Version::undefined(), JDK_Version::jdk(16), JDK_Version::jdk(17) },
{ "TraceSafepointCleanupTime", JDK_Version::undefined(), JDK_Version::jdk(16), JDK_Version::jdk(17) },
{ "TraceJVMTIObjectTagging", JDK_Version::undefined(), JDK_Version::jdk(16), JDK_Version::jdk(17) },
{ "TraceRedefineClasses", JDK_Version::undefined(), JDK_Version::jdk(16), JDK_Version::jdk(17) },
{ "PrintJNIResolving", JDK_Version::undefined(), JDK_Version::jdk(16), JDK_Version::jdk(17) },
#ifdef TEST_VERIFY_SPECIAL_JVM_FLAGS
// These entries will generate build errors. Their purpose is to test the macros.
@ -584,44 +600,6 @@ static AliasedFlag const aliased_jvm_flags[] = {
{ NULL, NULL}
};
// NOTE: A compatibility request will be necessary for each alias to be removed.
static AliasedLoggingFlag const aliased_logging_flags[] = {
{ "PrintSharedSpaces", LogLevel::Info, true, LOG_TAGS(cds) },
{ "TraceBiasedLocking", LogLevel::Info, true, LOG_TAGS(biasedlocking) },
{ "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) },
{ "TraceInvokeDynamic", LogLevel::Debug, true, LOG_TAGS(methodhandles, indy) },
{ "TraceLoaderConstraints", LogLevel::Info, true, LOG_TAGS(class, loader, constraints) },
{ "TraceMethodHandles", LogLevel::Info, true, LOG_TAGS(methodhandles) },
{ "TraceMonitorInflation", LogLevel::Trace, true, LOG_TAGS(monitorinflation) },
{ "TraceSafepointCleanupTime", LogLevel::Info, true, LOG_TAGS(safepoint, cleanup) },
{ "TraceJVMTIObjectTagging", LogLevel::Debug, true, LOG_TAGS(jvmti, objecttagging) },
{ "TraceRedefineClasses", LogLevel::Info, false, LOG_TAGS(redefine, class) },
{ "PrintJNIResolving", LogLevel::Debug, true, LOG_TAGS(jni, resolve) },
{ NULL, LogLevel::Off, false, LOG_TAGS(_NO_TAG) }
};
#ifndef PRODUCT
// These options are removed in jdk9. Remove this code for jdk10.
static AliasedFlag const removed_develop_logging_flags[] = {
{ "TraceClassInitialization", "-Xlog:class+init" },
{ "TraceClassLoaderData", "-Xlog:class+loader+data" },
{ "TraceDefaultMethods", "-Xlog:defaultmethods=debug" },
{ "TraceItables", "-Xlog:itables=debug" },
{ "TraceMonitorMismatch", "-Xlog:monitormismatch=info" },
{ "TraceSafepoint", "-Xlog:safepoint=debug" },
{ "TraceStartupTime", "-Xlog:startuptime" },
{ "TraceVMOperation", "-Xlog:vmoperation=debug" },
{ "PrintVtables", "-Xlog:vtables=debug" },
{ "VerboseVerification", "-Xlog:verification" },
{ NULL, NULL }
};
#endif //PRODUCT
// 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");
@ -685,18 +663,6 @@ int Arguments::is_deprecated_flag(const char *flag_name, JDK_Version* version) {
return 0;
}
#ifndef PRODUCT
const char* Arguments::removed_develop_logging_flag_name(const char* name){
for (size_t i = 0; removed_develop_logging_flags[i].alias_name != NULL; i++) {
const AliasedFlag& flag = removed_develop_logging_flags[i];
if (strcmp(flag.alias_name, name) == 0) {
return flag.real_name;
}
}
return NULL;
}
#endif // PRODUCT
const char* Arguments::real_flag_name(const char *flag_name) {
for (size_t i = 0; aliased_jvm_flags[i].alias_name != NULL; i++) {
const AliasedFlag& flag_status = aliased_jvm_flags[i];
@ -1014,44 +980,6 @@ const char* Arguments::handle_aliases_and_deprecation(const char* arg, bool warn
return NULL;
}
void log_deprecated_flag(const char* name, bool on, AliasedLoggingFlag alf) {
LogTagType tagSet[] = {alf.tag0, alf.tag1, alf.tag2, alf.tag3, alf.tag4, alf.tag5};
// Set tagset string buffer at max size of 256, large enough for any alias tagset
const int max_tagset_size = 256;
int max_tagset_len = max_tagset_size - 1;
char tagset_buffer[max_tagset_size];
tagset_buffer[0] = '\0';
// Write tag-set for aliased logging option, in string list form
int max_tags = sizeof(tagSet)/sizeof(tagSet[0]);
for (int i = 0; i < max_tags && tagSet[i] != LogTag::__NO_TAG; i++) {
if (i > 0) {
strncat(tagset_buffer, "+", max_tagset_len - strlen(tagset_buffer));
}
strncat(tagset_buffer, LogTag::name(tagSet[i]), max_tagset_len - strlen(tagset_buffer));
}
if (!alf.exactMatch) {
strncat(tagset_buffer, "*", max_tagset_len - strlen(tagset_buffer));
}
log_warning(arguments)("-XX:%s%s is deprecated. Will use -Xlog:%s=%s instead.",
(on) ? "+" : "-",
name,
tagset_buffer,
(on) ? LogLevel::name(alf.level) : "off");
}
AliasedLoggingFlag Arguments::catch_logging_aliases(const char* name, bool on){
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) {
log_deprecated_flag(name, on, alf);
return alf;
}
}
AliasedLoggingFlag a = {NULL, LogLevel::Off, false, LOG_TAGS(_NO_TAG)};
return a;
}
bool Arguments::parse_argument(const char* arg, JVMFlagOrigin origin) {
// range of acceptable characters spelled out for portability reasons
@ -1063,11 +991,6 @@ bool Arguments::parse_argument(const char* arg, JVMFlagOrigin origin) {
bool warn_if_deprecated = true;
if (sscanf(arg, "-%" XSTR(BUFLEN) NAME_RANGE "%c", name, &dummy) == 1) {
AliasedLoggingFlag alf = catch_logging_aliases(name, false);
if (alf.alias_name != NULL){
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);
if (real_name == NULL) {
return false;
@ -1076,11 +999,6 @@ bool Arguments::parse_argument(const char* arg, JVMFlagOrigin origin) {
return set_bool_flag(flag, false, origin);
}
if (sscanf(arg, "+%" XSTR(BUFLEN) NAME_RANGE "%c", name, &dummy) == 1) {
AliasedLoggingFlag alf = catch_logging_aliases(name, true);
if (alf.alias_name != NULL){
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);
if (real_name == NULL) {
return false;
@ -1094,11 +1012,6 @@ bool Arguments::parse_argument(const char* arg, JVMFlagOrigin origin) {
const char* value = strchr(arg, '=') + 1;
// this scanf pattern matches both strings (handled here) and numbers (handled later))
AliasedLoggingFlag alf = catch_logging_aliases(name, true);
if (alf.alias_name != NULL) {
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);
if (real_name == NULL) {
return false;
@ -1297,17 +1210,6 @@ bool Arguments::process_argument(const char* arg,
warning("Ignoring option %s; support was removed in %s", stripped_argname, version);
return true;
}
#ifndef PRODUCT
else {
const char* replacement;
if ((replacement = removed_develop_logging_flag_name(stripped_argname)) != NULL){
log_warning(arguments)("%s has been removed. Please use %s instead.",
stripped_argname,
replacement);
return false;
}
}
#endif //PRODUCT
}
// For locked flags, report a custom error message if available.

View File

@ -226,19 +226,6 @@ class AgentLibraryList {
// Helper class for controlling the lifetime of JavaVMInitArgs objects.
class ScopedVMInitArgs;
// Most logging functions require 5 tags. Some of them may be _NO_TAG.
typedef struct {
const char* alias_name;
LogLevelType level;
bool exactMatch;
LogTagType tag0;
LogTagType tag1;
LogTagType tag2;
LogTagType tag3;
LogTagType tag4;
LogTagType tag5;
} AliasedLoggingFlag;
class Arguments : AllStatic {
friend class VMStructs;
friend class JvmtiExport;
@ -460,10 +447,6 @@ class Arguments : AllStatic {
// the version number when the flag became obsolete.
static bool is_obsolete_flag(const char* flag_name, JDK_Version* version);
#ifndef PRODUCT
static const char* removed_develop_logging_flag_name(const char* name);
#endif // PRODUCT
// Returns 1 if the flag is deprecated (and not yet obsolete or expired).
// In this case the 'version' buffer is filled in with the version number when
// the flag became deprecated.
@ -477,7 +460,6 @@ class Arguments : AllStatic {
// Return the "real" name for option arg if arg is an alias, and print a warning if arg is deprecated.
// Return NULL if the arg has expired.
static const char* handle_aliases_and_deprecation(const char* arg, bool warn);
static AliasedLoggingFlag catch_logging_aliases(const char* name, bool on);
static char* SharedArchivePath;
static char* SharedDynamicArchivePath;

View File

@ -955,9 +955,6 @@ const intx ObjectAlignmentInBytes = 8;
\
/* JVMTI heap profiling */ \
\
product(bool, TraceJVMTIObjectTagging, false, DIAGNOSTIC, \
"Trace JVMTI object tagging calls") \
\
product(bool, VerifyBeforeIteration, false, DIAGNOSTIC, \
"Verify memory system before JVMTI iteration") \
\

View File

@ -24,7 +24,7 @@
/*
* @test
* @bug 8048933
* @summary TraceExceptions output should have the exception message - useful for ClassNotFoundExceptions especially
* @summary -Xlog:exceptions=info output should have the exception message - useful for ClassNotFoundExceptions especially
* @library /test/lib
* @modules java.base/jdk.internal.misc
* java.management

View File

@ -85,16 +85,6 @@ public class ClassPathAttr {
output.shouldMatch("checking shared classpath entry: .*cpattr2.jar");
output.shouldMatch("checking shared classpath entry: .*cpattr3.jar");
});
// Make sure aliased TraceClassPaths still works
TestCommon.run(
"-XX:+TraceClassPaths",
"-cp", cp,
"CpAttr1")
.assertNormalExit(output -> {
output.shouldMatch("checking shared classpath entry: .*cpattr2.jar");
output.shouldMatch("checking shared classpath entry: .*cpattr3.jar");
});
}
}

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2014, 2019, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2014, 2020, 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
@ -46,13 +46,13 @@ public class IgnoreEmptyClassPaths {
String cp_exec = sep + jar1 + sep + sep + jar2 + sep;
TestCommon.testDump(cp_dump, TestCommon.list("Hello", "HelloMore"),
"-XX:+TraceClassPaths", "-XX:+IgnoreEmptyClassPaths");
"-Xlog:class+path=info", "-XX:+IgnoreEmptyClassPaths");
TestCommon.run(
"-verbose:class",
"-cp", cp_exec,
"-XX:+IgnoreEmptyClassPaths", // should affect classpath even if placed after the "-cp" argument
"-XX:+TraceClassPaths",
"-Xlog:class+path=info",
"HelloMore")
.assertNormalExit();
}

View File

@ -73,7 +73,7 @@ public class GCDuringDump {
TestCommon.run(
"-cp", appJar,
"-Xmx32m",
"-XX:+PrintSharedSpaces",
"-Xlog:cds=info",
"-XX:+UnlockDiagnosticVMOptions", extraOption,
gcLog,
Hello.class.getName())

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2017, 2019, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2017, 2020, 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
@ -112,7 +112,7 @@ public class GCSharedStringsDuringDump {
extraArg,
"-Xlog:cds=info,class+path=info",
"-Xmx32m",
"-XX:+PrintSharedSpaces",
"-Xlog:cds=info",
"-XX:+UnlockDiagnosticVMOptions",
extraOption,
"-XX:+WhiteBoxAPI",

View File

@ -75,7 +75,7 @@ public class HumongousDuringDump {
"-cp", appJar,
"-verbose",
"-Xmx64m",
"-XX:+PrintSharedSpaces",
"-Xlog:cds=info",
"-XX:+UnlockDiagnosticVMOptions", extraOption,
gcLog,
Hello.class.getName())

View File

@ -189,7 +189,7 @@ public class BootAppendTests {
OutputAnalyzer output = TestCommon.exec(
appJar,
"-Xbootclasspath/a:" + bootAppendJar,
"-XX:+TraceClassLoading",
"-Xlog:class+load=info",
MAIN_CLASS,
"Test #6", BOOT_APPEND_CLASS, "true", "BOOT");
TestCommon.checkExec(output);

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2016, 2020, 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
@ -54,23 +54,11 @@ public class BiasedLockingTest {
InnerClass.class.getName());
analyzeOutputOn(pb);
pb = ProcessTools.createJavaProcessBuilder("-XX:+UseBiasedLocking",
"-XX:+TraceBiasedLocking",
"-XX:BiasedLockingStartupDelay=0",
InnerClass.class.getName());
analyzeOutputOn(pb);
pb = ProcessTools.createJavaProcessBuilder("-XX:+UseBiasedLocking",
"-Xlog:biasedlocking=off",
"-XX:BiasedLockingStartupDelay=0",
InnerClass.class.getName());
analyzeOutputOff(pb);
pb = ProcessTools.createJavaProcessBuilder("-XX:+UseBiasedLocking",
"-XX:-TraceBiasedLocking",
"-XX:BiasedLockingStartupDelay=0",
InnerClass.class.getName());
analyzeOutputOff(pb);
}
public static class InnerClass {

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2016, 2020, 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
@ -90,14 +90,6 @@ public class ClassLoadUnloadTest {
pb = exec("-Xlog:class+unload=off");
checkAbsent("[class,unload]");
// -XX:+TraceClassUnloading
pb = exec("-XX:+TraceClassUnloading");
checkFor("[class,unload]", "unloading class");
// -XX:-TraceClassUnloading
pb = exec("-XX:-TraceClassUnloading");
checkAbsent("[class,unload]");
// -Xlog:class+load=info
pb = exec("-Xlog:class+load=info");
checkFor("[class,load]", "java.lang.Object", "source:");
@ -110,14 +102,6 @@ public class ClassLoadUnloadTest {
pb = exec("-Xlog:class+load=off");
checkAbsent("[class,load]");
// -XX:+TraceClassLoading
pb = exec("-XX:+TraceClassLoading");
checkFor("[class,load]", "java.lang.Object", "source:");
// -XX:-TraceClassLoading
pb = exec("-XX:-TraceClassLoading");
checkAbsent("[class,load]");
// -verbose:class
pb = exec("-verbose:class");
checkFor("[class,load]", "java.lang.Object", "source:");

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2016, 2020, 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
@ -71,20 +71,6 @@ public class ClassResolutionTest {
ClassResolutionTestMain.class.getName());
o = new OutputAnalyzer(pb.start());
o.shouldNotContain("[class,resolve]");
// (3) TraceClassResolution should turn on.
pb = ProcessTools.createJavaProcessBuilder("-XX:+TraceClassResolution",
ClassResolutionTestMain.class.getName());
o = new OutputAnalyzer(pb.start());
o.shouldContain("[class,resolve] ClassResolutionTest$ClassResolutionTestMain$Thing1Handler ClassResolutionTest$ClassResolutionTestMain$Thing1");
// (4) TraceClassResolution should turn off.
pb = ProcessTools.createJavaProcessBuilder("-Xlog:class+resolve=debug",
"-XX:-TraceClassResolution",
ClassResolutionTestMain.class.getName());
o = new OutputAnalyzer(pb.start());
o.shouldNotContain("[class,resolve]");
};
}

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2015, 2020, 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
@ -60,24 +60,16 @@ public class ExceptionsTest {
InternalClass.class.getName());
analyzeOutputOn(pb);
pb = ProcessTools.createJavaProcessBuilder("-XX:+TraceExceptions",
InternalClass.class.getName());
analyzeOutputOn(pb);
pb = ProcessTools.createJavaProcessBuilder("-Xlog:exceptions=off",
InternalClass.class.getName());
analyzeOutputOff(pb);
pb = ProcessTools.createJavaProcessBuilder("-XX:-TraceExceptions",
InternalClass.class.getName());
analyzeOutputOff(pb);
pb = ProcessTools.createJavaProcessBuilder(InternalClass.class.getName());
updateEnvironment(pb, "_JAVA_OPTIONS", "-XX:+TraceExceptions");
updateEnvironment(pb, "_JAVA_OPTIONS", "-Xlog:exceptions=info");
analyzeOutputOn(pb);
pb = ProcessTools.createJavaProcessBuilder(InternalClass.class.getName());
updateEnvironment(pb, "JAVA_TOOL_OPTIONS", "-Xlog:exceptions=info -XX:-TraceExceptions");
updateEnvironment(pb, "JAVA_TOOL_OPTIONS", "-Xlog:exceptions=info -Xlog:exceptions=off");
analyzeOutputOff(pb);
pb = ProcessTools.createJavaProcessBuilder("-XX:VMOptionsFile=" + System.getProperty("test.src", ".")

View File

@ -1 +1 @@
-XX:+TraceExceptions
-Xlog:exceptions=info

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2016, 2020, 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
@ -63,22 +63,11 @@ public class LoaderConstraintsTest {
public static void main(String... args) throws Exception {
// -XX:+TraceLoaderConstraints
pb = exec("-XX:+TraceLoaderConstraints");
out = new OutputAnalyzer(pb.start());
out.getOutput();
out.shouldContain("[class,loader,constraints] adding new constraint for name: java/lang/Class, loader[0]: 'app', loader[1]: 'bootstrap'");
// -Xlog:class+loader+constraints=info
pb = exec("-Xlog:class+loader+constraints=info");
out = new OutputAnalyzer(pb.start());
out.shouldContain("[class,loader,constraints] adding new constraint for name: java/lang/Class, loader[0]: 'app', loader[1]: 'bootstrap'");
// -XX:-TraceLoaderConstraints
pb = exec("-XX:-TraceLoaderConstraints");
out = new OutputAnalyzer(pb.start());
out.shouldNotContain("[class,loaderconstraints]");
// -Xlog:class+loader+constraints=off
pb = exec("-Xlog:class+loader+constraints=off");
out = new OutputAnalyzer(pb.start());

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2015, 2019, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2015, 2020, 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
@ -54,17 +54,9 @@ public class MonitorInflationTest {
InnerClass.class.getName());
analyzeOutputOn(pb);
pb = ProcessTools.createJavaProcessBuilder("-XX:+TraceMonitorInflation",
InnerClass.class.getName());
analyzeOutputOn(pb);
pb = ProcessTools.createJavaProcessBuilder("-Xlog:monitorinflation=off",
InnerClass.class.getName());
analyzeOutputOff(pb);
pb = ProcessTools.createJavaProcessBuilder("-XX:-TraceMonitorInflation",
InnerClass.class.getName());
analyzeOutputOff(pb);
}
public static class Waiter {

View File

@ -1,63 +0,0 @@
/*
* Copyright (c) 2016, 2020, 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.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/*
* @test RemovedDevelopFlagsTest
* @bug 8146632
* @modules java.base/jdk.internal.misc
* @requires vm.debug
* @library /test/lib
* @run driver RemovedDevelopFlagsTest
*/
import jdk.test.lib.process.ProcessTools;
import jdk.test.lib.process.OutputAnalyzer;
public class RemovedDevelopFlagsTest {
public static ProcessBuilder pb;
public static class RemovedDevelopFlagsTestMain {
public static void main(String... args) {
System.out.print("Hello!");
}
}
public static void exec(String flag, String value) throws Exception {
pb = ProcessTools.createJavaProcessBuilder("-XX:+"+flag, RemovedDevelopFlagsTestMain.class.getName());
OutputAnalyzer o = new OutputAnalyzer(pb.start());
o.shouldContain(flag+" has been removed. Please use "+value+" instead.");
o.shouldHaveExitValue(1);
}
public static void main(String... args) throws Exception {
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");
exec("TraceStartupTime", "-Xlog:startuptime");
exec("TraceVMOperation", "-Xlog:vmoperation=debug");
exec("PrintVtables", "-Xlog:vtables=debug");
exec("VerboseVerification", "-Xlog:verification");
}
}

View File

@ -55,17 +55,9 @@ public class SafepointCleanupTest {
InnerClass.class.getName());
analyzeOutputOn(pb);
pb = ProcessTools.createJavaProcessBuilder("-XX:+TraceSafepointCleanupTime",
InnerClass.class.getName());
analyzeOutputOn(pb);
pb = ProcessTools.createJavaProcessBuilder("-Xlog:safepoint+cleanup=off",
InnerClass.class.getName());
analyzeOutputOff(pb);
pb = ProcessTools.createJavaProcessBuilder("-XX:-TraceSafepointCleanupTime",
InnerClass.class.getName());
analyzeOutputOff(pb);
}
public static class InnerClass {

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2013, 2019, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2013, 2020, 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
@ -61,7 +61,7 @@ public class CDSJDITest {
// pass them as JVM arguments to the debuggee process it creates.
"-Xbootclasspath/a:" + appJar,
"-XX:+UnlockDiagnosticVMOptions",
"-XX:+TraceClassPaths",
"-Xlog:class+path=info",
"-XX:SharedArchiveFile=./SharedArchiveFile.jsa",
"-Xshare:on",
"-showversion"