Skip to content

Commit e4497c9

Browse files
author
Harold Seigel
committed
8256718: Obsolete the long term deprecated and aliased Trace flags
Reviewed-by: sspitsyn, iklam, dholmes, coleenp
1 parent 4a267f1 commit e4497c9

23 files changed

+37
-310
lines changed

src/hotspot/cpu/aarch64/methodHandles_aarch64.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -132,8 +132,6 @@ void MethodHandles::jump_to_lambda_form(MacroAssembler* _masm,
132132
assert(recv != noreg, "required register");
133133
assert(method_temp == rmethod, "required register for loading method");
134134

135-
//NOT_PRODUCT({ FlagSetting fs(TraceMethodHandles, true); trace_method_handle(_masm, "LZMH"); });
136-
137135
// Load the invoker, as MH -> MH.form -> LF.vmentry
138136
__ verify_oop(recv);
139137
__ load_heap_oop(method_temp, Address(recv, NONZERO(java_lang_invoke_MethodHandle::form_offset())), temp2);

src/hotspot/cpu/x86/methodHandles_x86.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -168,8 +168,6 @@ void MethodHandles::jump_to_lambda_form(MacroAssembler* _masm,
168168
assert(recv != noreg, "required register");
169169
assert(method_temp == rbx, "required register for loading method");
170170

171-
//NOT_PRODUCT({ FlagSetting fs(TraceMethodHandles, true); trace_method_handle(_masm, "LZMH"); });
172-
173171
// Load the invoker, as MH -> MH.form -> LF.vmentry
174172
__ verify_oop(recv);
175173
__ load_heap_oop(method_temp, Address(recv, NONZERO(java_lang_invoke_MethodHandle::form_offset())), temp2);

src/hotspot/share/oops/method.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1009,7 +1009,7 @@ class Method : public Metadata {
10091009
// Printing
10101010
void print_short_name(outputStream* st = tty); // prints as klassname::methodname; Exposed so field engineers can debug VM
10111011
#if INCLUDE_JVMTI
1012-
void print_name(outputStream* st = tty); // prints as "virtual void foo(int)"; exposed for TraceRedefineClasses
1012+
void print_name(outputStream* st = tty); // prints as "virtual void foo(int)"; exposed for -Xlog:redefine+class
10131013
#else
10141014
void print_name(outputStream* st = tty) PRODUCT_RETURN; // prints as "virtual void foo(int)"
10151015
#endif

src/hotspot/share/runtime/arguments.cpp

Lines changed: 16 additions & 114 deletions
Original file line numberDiff line numberDiff line change
@@ -557,6 +557,22 @@ static SpecialFlag const special_jvm_flags[] = {
557557
{ "Debugging", JDK_Version::undefined(), JDK_Version::jdk(16), JDK_Version::jdk(17) },
558558
{ "UseRDPCForConstantTableBase", JDK_Version::undefined(), JDK_Version::jdk(16), JDK_Version::jdk(17) },
559559
{ "VerifyMergedCPBytecodes", JDK_Version::undefined(), JDK_Version::jdk(16), JDK_Version::jdk(17) },
560+
{ "PrintSharedSpaces", JDK_Version::undefined(), JDK_Version::jdk(16), JDK_Version::jdk(17) },
561+
{ "TraceBiasedLocking", JDK_Version::undefined(), JDK_Version::jdk(16), JDK_Version::jdk(17) },
562+
{ "TraceClassLoading", JDK_Version::undefined(), JDK_Version::jdk(16), JDK_Version::jdk(17) },
563+
{ "TraceClassLoadingPreorder", JDK_Version::undefined(), JDK_Version::jdk(16), JDK_Version::jdk(17) },
564+
{ "TraceClassPaths", JDK_Version::undefined(), JDK_Version::jdk(16), JDK_Version::jdk(17) },
565+
{ "TraceClassResolution", JDK_Version::undefined(), JDK_Version::jdk(16), JDK_Version::jdk(17) },
566+
{ "TraceClassUnloading", JDK_Version::undefined(), JDK_Version::jdk(16), JDK_Version::jdk(17) },
567+
{ "TraceExceptions", JDK_Version::undefined(), JDK_Version::jdk(16), JDK_Version::jdk(17) },
568+
{ "TraceInvokeDynamic", JDK_Version::undefined(), JDK_Version::jdk(16), JDK_Version::jdk(17) },
569+
{ "TraceLoaderConstraints", JDK_Version::undefined(), JDK_Version::jdk(16), JDK_Version::jdk(17) },
570+
{ "TraceMethodHandles", JDK_Version::undefined(), JDK_Version::jdk(16), JDK_Version::jdk(17) },
571+
{ "TraceMonitorInflation", JDK_Version::undefined(), JDK_Version::jdk(16), JDK_Version::jdk(17) },
572+
{ "TraceSafepointCleanupTime", JDK_Version::undefined(), JDK_Version::jdk(16), JDK_Version::jdk(17) },
573+
{ "TraceJVMTIObjectTagging", JDK_Version::undefined(), JDK_Version::jdk(16), JDK_Version::jdk(17) },
574+
{ "TraceRedefineClasses", JDK_Version::undefined(), JDK_Version::jdk(16), JDK_Version::jdk(17) },
575+
{ "PrintJNIResolving", JDK_Version::undefined(), JDK_Version::jdk(16), JDK_Version::jdk(17) },
560576

561577
#ifdef TEST_VERIFY_SPECIAL_JVM_FLAGS
562578
// These entries will generate build errors. Their purpose is to test the macros.
@@ -584,44 +600,6 @@ static AliasedFlag const aliased_jvm_flags[] = {
584600
{ NULL, NULL}
585601
};
586602

587-
// NOTE: A compatibility request will be necessary for each alias to be removed.
588-
static AliasedLoggingFlag const aliased_logging_flags[] = {
589-
{ "PrintSharedSpaces", LogLevel::Info, true, LOG_TAGS(cds) },
590-
{ "TraceBiasedLocking", LogLevel::Info, true, LOG_TAGS(biasedlocking) },
591-
{ "TraceClassLoading", LogLevel::Info, true, LOG_TAGS(class, load) },
592-
{ "TraceClassLoadingPreorder", LogLevel::Debug, true, LOG_TAGS(class, preorder) },
593-
{ "TraceClassPaths", LogLevel::Info, true, LOG_TAGS(class, path) },
594-
{ "TraceClassResolution", LogLevel::Debug, true, LOG_TAGS(class, resolve) },
595-
{ "TraceClassUnloading", LogLevel::Info, true, LOG_TAGS(class, unload) },
596-
{ "TraceExceptions", LogLevel::Info, true, LOG_TAGS(exceptions) },
597-
{ "TraceInvokeDynamic", LogLevel::Debug, true, LOG_TAGS(methodhandles, indy) },
598-
{ "TraceLoaderConstraints", LogLevel::Info, true, LOG_TAGS(class, loader, constraints) },
599-
{ "TraceMethodHandles", LogLevel::Info, true, LOG_TAGS(methodhandles) },
600-
{ "TraceMonitorInflation", LogLevel::Trace, true, LOG_TAGS(monitorinflation) },
601-
{ "TraceSafepointCleanupTime", LogLevel::Info, true, LOG_TAGS(safepoint, cleanup) },
602-
{ "TraceJVMTIObjectTagging", LogLevel::Debug, true, LOG_TAGS(jvmti, objecttagging) },
603-
{ "TraceRedefineClasses", LogLevel::Info, false, LOG_TAGS(redefine, class) },
604-
{ "PrintJNIResolving", LogLevel::Debug, true, LOG_TAGS(jni, resolve) },
605-
{ NULL, LogLevel::Off, false, LOG_TAGS(_NO_TAG) }
606-
};
607-
608-
#ifndef PRODUCT
609-
// These options are removed in jdk9. Remove this code for jdk10.
610-
static AliasedFlag const removed_develop_logging_flags[] = {
611-
{ "TraceClassInitialization", "-Xlog:class+init" },
612-
{ "TraceClassLoaderData", "-Xlog:class+loader+data" },
613-
{ "TraceDefaultMethods", "-Xlog:defaultmethods=debug" },
614-
{ "TraceItables", "-Xlog:itables=debug" },
615-
{ "TraceMonitorMismatch", "-Xlog:monitormismatch=info" },
616-
{ "TraceSafepoint", "-Xlog:safepoint=debug" },
617-
{ "TraceStartupTime", "-Xlog:startuptime" },
618-
{ "TraceVMOperation", "-Xlog:vmoperation=debug" },
619-
{ "PrintVtables", "-Xlog:vtables=debug" },
620-
{ "VerboseVerification", "-Xlog:verification" },
621-
{ NULL, NULL }
622-
};
623-
#endif //PRODUCT
624-
625603
// Return true if "v" is less than "other", where "other" may be "undefined".
626604
static bool version_less_than(JDK_Version v, JDK_Version other) {
627605
assert(!v.is_undefined(), "must be defined");
@@ -685,18 +663,6 @@ int Arguments::is_deprecated_flag(const char *flag_name, JDK_Version* version) {
685663
return 0;
686664
}
687665

688-
#ifndef PRODUCT
689-
const char* Arguments::removed_develop_logging_flag_name(const char* name){
690-
for (size_t i = 0; removed_develop_logging_flags[i].alias_name != NULL; i++) {
691-
const AliasedFlag& flag = removed_develop_logging_flags[i];
692-
if (strcmp(flag.alias_name, name) == 0) {
693-
return flag.real_name;
694-
}
695-
}
696-
return NULL;
697-
}
698-
#endif // PRODUCT
699-
700666
const char* Arguments::real_flag_name(const char *flag_name) {
701667
for (size_t i = 0; aliased_jvm_flags[i].alias_name != NULL; i++) {
702668
const AliasedFlag& flag_status = aliased_jvm_flags[i];
@@ -1014,44 +980,6 @@ const char* Arguments::handle_aliases_and_deprecation(const char* arg, bool warn
1014980
return NULL;
1015981
}
1016982

1017-
void log_deprecated_flag(const char* name, bool on, AliasedLoggingFlag alf) {
1018-
LogTagType tagSet[] = {alf.tag0, alf.tag1, alf.tag2, alf.tag3, alf.tag4, alf.tag5};
1019-
// Set tagset string buffer at max size of 256, large enough for any alias tagset
1020-
const int max_tagset_size = 256;
1021-
int max_tagset_len = max_tagset_size - 1;
1022-
char tagset_buffer[max_tagset_size];
1023-
tagset_buffer[0] = '\0';
1024-
1025-
// Write tag-set for aliased logging option, in string list form
1026-
int max_tags = sizeof(tagSet)/sizeof(tagSet[0]);
1027-
for (int i = 0; i < max_tags && tagSet[i] != LogTag::__NO_TAG; i++) {
1028-
if (i > 0) {
1029-
strncat(tagset_buffer, "+", max_tagset_len - strlen(tagset_buffer));
1030-
}
1031-
strncat(tagset_buffer, LogTag::name(tagSet[i]), max_tagset_len - strlen(tagset_buffer));
1032-
}
1033-
if (!alf.exactMatch) {
1034-
strncat(tagset_buffer, "*", max_tagset_len - strlen(tagset_buffer));
1035-
}
1036-
log_warning(arguments)("-XX:%s%s is deprecated. Will use -Xlog:%s=%s instead.",
1037-
(on) ? "+" : "-",
1038-
name,
1039-
tagset_buffer,
1040-
(on) ? LogLevel::name(alf.level) : "off");
1041-
}
1042-
1043-
AliasedLoggingFlag Arguments::catch_logging_aliases(const char* name, bool on){
1044-
for (size_t i = 0; aliased_logging_flags[i].alias_name != NULL; i++) {
1045-
const AliasedLoggingFlag& alf = aliased_logging_flags[i];
1046-
if (strcmp(alf.alias_name, name) == 0) {
1047-
log_deprecated_flag(name, on, alf);
1048-
return alf;
1049-
}
1050-
}
1051-
AliasedLoggingFlag a = {NULL, LogLevel::Off, false, LOG_TAGS(_NO_TAG)};
1052-
return a;
1053-
}
1054-
1055983
bool Arguments::parse_argument(const char* arg, JVMFlagOrigin origin) {
1056984

1057985
// range of acceptable characters spelled out for portability reasons
@@ -1063,11 +991,6 @@ bool Arguments::parse_argument(const char* arg, JVMFlagOrigin origin) {
1063991
bool warn_if_deprecated = true;
1064992

1065993
if (sscanf(arg, "-%" XSTR(BUFLEN) NAME_RANGE "%c", name, &dummy) == 1) {
1066-
AliasedLoggingFlag alf = catch_logging_aliases(name, false);
1067-
if (alf.alias_name != NULL){
1068-
LogConfiguration::configure_stdout(LogLevel::Off, alf.exactMatch, alf.tag0, alf.tag1, alf.tag2, alf.tag3, alf.tag4, alf.tag5);
1069-
return true;
1070-
}
1071994
real_name = handle_aliases_and_deprecation(name, warn_if_deprecated);
1072995
if (real_name == NULL) {
1073996
return false;
@@ -1076,11 +999,6 @@ bool Arguments::parse_argument(const char* arg, JVMFlagOrigin origin) {
1076999
return set_bool_flag(flag, false, origin);
10771000
}
10781001
if (sscanf(arg, "+%" XSTR(BUFLEN) NAME_RANGE "%c", name, &dummy) == 1) {
1079-
AliasedLoggingFlag alf = catch_logging_aliases(name, true);
1080-
if (alf.alias_name != NULL){
1081-
LogConfiguration::configure_stdout(alf.level, alf.exactMatch, alf.tag0, alf.tag1, alf.tag2, alf.tag3, alf.tag4, alf.tag5);
1082-
return true;
1083-
}
10841002
real_name = handle_aliases_and_deprecation(name, warn_if_deprecated);
10851003
if (real_name == NULL) {
10861004
return false;
@@ -1094,11 +1012,6 @@ bool Arguments::parse_argument(const char* arg, JVMFlagOrigin origin) {
10941012
const char* value = strchr(arg, '=') + 1;
10951013

10961014
// this scanf pattern matches both strings (handled here) and numbers (handled later))
1097-
AliasedLoggingFlag alf = catch_logging_aliases(name, true);
1098-
if (alf.alias_name != NULL) {
1099-
LogConfiguration::configure_stdout(alf.level, alf.exactMatch, alf.tag0, alf.tag1, alf.tag2, alf.tag3, alf.tag4, alf.tag5);
1100-
return true;
1101-
}
11021015
real_name = handle_aliases_and_deprecation(name, warn_if_deprecated);
11031016
if (real_name == NULL) {
11041017
return false;
@@ -1297,17 +1210,6 @@ bool Arguments::process_argument(const char* arg,
12971210
warning("Ignoring option %s; support was removed in %s", stripped_argname, version);
12981211
return true;
12991212
}
1300-
#ifndef PRODUCT
1301-
else {
1302-
const char* replacement;
1303-
if ((replacement = removed_develop_logging_flag_name(stripped_argname)) != NULL){
1304-
log_warning(arguments)("%s has been removed. Please use %s instead.",
1305-
stripped_argname,
1306-
replacement);
1307-
return false;
1308-
}
1309-
}
1310-
#endif //PRODUCT
13111213
}
13121214

13131215
// For locked flags, report a custom error message if available.

src/hotspot/share/runtime/arguments.hpp

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -226,19 +226,6 @@ class AgentLibraryList {
226226
// Helper class for controlling the lifetime of JavaVMInitArgs objects.
227227
class ScopedVMInitArgs;
228228

229-
// Most logging functions require 5 tags. Some of them may be _NO_TAG.
230-
typedef struct {
231-
const char* alias_name;
232-
LogLevelType level;
233-
bool exactMatch;
234-
LogTagType tag0;
235-
LogTagType tag1;
236-
LogTagType tag2;
237-
LogTagType tag3;
238-
LogTagType tag4;
239-
LogTagType tag5;
240-
} AliasedLoggingFlag;
241-
242229
class Arguments : AllStatic {
243230
friend class VMStructs;
244231
friend class JvmtiExport;
@@ -460,10 +447,6 @@ class Arguments : AllStatic {
460447
// the version number when the flag became obsolete.
461448
static bool is_obsolete_flag(const char* flag_name, JDK_Version* version);
462449

463-
#ifndef PRODUCT
464-
static const char* removed_develop_logging_flag_name(const char* name);
465-
#endif // PRODUCT
466-
467450
// Returns 1 if the flag is deprecated (and not yet obsolete or expired).
468451
// In this case the 'version' buffer is filled in with the version number when
469452
// the flag became deprecated.
@@ -477,7 +460,6 @@ class Arguments : AllStatic {
477460
// Return the "real" name for option arg if arg is an alias, and print a warning if arg is deprecated.
478461
// Return NULL if the arg has expired.
479462
static const char* handle_aliases_and_deprecation(const char* arg, bool warn);
480-
static AliasedLoggingFlag catch_logging_aliases(const char* name, bool on);
481463

482464
static char* SharedArchivePath;
483465
static char* SharedDynamicArchivePath;

src/hotspot/share/runtime/globals.hpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -955,9 +955,6 @@ const intx ObjectAlignmentInBytes = 8;
955955
\
956956
/* JVMTI heap profiling */ \
957957
\
958-
product(bool, TraceJVMTIObjectTagging, false, DIAGNOSTIC, \
959-
"Trace JVMTI object tagging calls") \
960-
\
961958
product(bool, VerifyBeforeIteration, false, DIAGNOSTIC, \
962959
"Verify memory system before JVMTI iteration") \
963960
\

test/hotspot/jtreg/runtime/CommandLine/TraceExceptionsTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
/*
2525
* @test
2626
* @bug 8048933
27-
* @summary TraceExceptions output should have the exception message - useful for ClassNotFoundExceptions especially
27+
* @summary -Xlog:exceptions=info output should have the exception message - useful for ClassNotFoundExceptions especially
2828
* @library /test/lib
2929
* @modules java.base/jdk.internal.misc
3030
* java.management

test/hotspot/jtreg/runtime/cds/appcds/ClassPathAttr.java

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -85,16 +85,6 @@ static void testNormalOps() throws Exception {
8585
output.shouldMatch("checking shared classpath entry: .*cpattr2.jar");
8686
output.shouldMatch("checking shared classpath entry: .*cpattr3.jar");
8787
});
88-
89-
// Make sure aliased TraceClassPaths still works
90-
TestCommon.run(
91-
"-XX:+TraceClassPaths",
92-
"-cp", cp,
93-
"CpAttr1")
94-
.assertNormalExit(output -> {
95-
output.shouldMatch("checking shared classpath entry: .*cpattr2.jar");
96-
output.shouldMatch("checking shared classpath entry: .*cpattr3.jar");
97-
});
9888
}
9989
}
10090

test/hotspot/jtreg/runtime/cds/appcds/IgnoreEmptyClassPaths.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2014, 2019, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2014, 2020, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -46,13 +46,13 @@ public static void main(String[] args) throws Exception {
4646
String cp_exec = sep + jar1 + sep + sep + jar2 + sep;
4747

4848
TestCommon.testDump(cp_dump, TestCommon.list("Hello", "HelloMore"),
49-
"-XX:+TraceClassPaths", "-XX:+IgnoreEmptyClassPaths");
49+
"-Xlog:class+path=info", "-XX:+IgnoreEmptyClassPaths");
5050

5151
TestCommon.run(
5252
"-verbose:class",
5353
"-cp", cp_exec,
5454
"-XX:+IgnoreEmptyClassPaths", // should affect classpath even if placed after the "-cp" argument
55-
"-XX:+TraceClassPaths",
55+
"-Xlog:class+path=info",
5656
"HelloMore")
5757
.assertNormalExit();
5858
}

test/hotspot/jtreg/runtime/cds/appcds/javaldr/GCDuringDump.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ public static void main(String[] args) throws Throwable {
7373
TestCommon.run(
7474
"-cp", appJar,
7575
"-Xmx32m",
76-
"-XX:+PrintSharedSpaces",
76+
"-Xlog:cds=info",
7777
"-XX:+UnlockDiagnosticVMOptions", extraOption,
7878
gcLog,
7979
Hello.class.getName())

0 commit comments

Comments
 (0)