8213058: remove ExecuteInternalVMTests and VerboseInternalVMTests flags
authoriignatyev
Fri, 02 Nov 2018 16:27:55 -0700
changeset 52396 e292e94b448a
parent 52395 5ca10e4e052c
child 52397 1322829d1501
8213058: remove ExecuteInternalVMTests and VerboseInternalVMTests flags Reviewed-by: erikj, dholmes, ihse
doc/testing.html
doc/testing.md
make/RunTests.gmk
make/common/FindTests.gmk
src/hotspot/os/linux/os_linux.cpp
src/hotspot/os/windows/os_windows.cpp
src/hotspot/share/gc/shared/gc_globals.hpp
src/hotspot/share/memory/virtualspace.cpp
src/hotspot/share/prims/jni.cpp
src/hotspot/share/utilities/internalVMTests.cpp
src/hotspot/share/utilities/internalVMTests.hpp
test/hotspot/jtreg/Makefile
test/hotspot/jtreg/TEST.groups
test/hotspot/jtreg/runtime/CommandLine/VMOptionWarning.java
test/hotspot/jtreg/sanity/ExecuteInternalVMTests.java
--- a/doc/testing.html	Fri Nov 02 16:26:11 2018 -0700
+++ b/doc/testing.html	Fri Nov 02 16:27:55 2018 -0700
@@ -62,9 +62,8 @@
 <p>If you want, you can single out an individual test or a group of tests, for instance <code>gtest:LogDecorations</code> or <code>gtest:LogDecorations.level_test_vm</code>. This can be particularly useful if you want to run a shaky test repeatedly.</p>
 <p>For Gtest, there is a separate test suite for each JVM variant. The JVM variant is defined by adding <code>/&lt;variant&gt;</code> to the test descriptor, e.g. <code>gtest:Log/client</code>. If you specify no variant, gtest will run once for each JVM variant present (e.g. server, client). So if you only have the server JVM present, then <code>gtest:all</code> will be equivalent to <code>gtest:all/server</code>.</p>
 <h3 id="special-tests">Special tests</h3>
-<p>A handful of odd tests that are not covered by any other testing framework are accessible using the <code>special:</code> test descriptor. Currently, this includes <code>hotspot-internal</code>, <code>failure-handler</code> and <code>make</code>.</p>
+<p>A handful of odd tests that are not covered by any other testing framework are accessible using the <code>special:</code> test descriptor. Currently, this includes <code>failure-handler</code> and <code>make</code>.</p>
 <ul>
-<li><p>Hotspot legacy internal testing (run using <code>-XX:+ExecuteInternalVMTests</code>) is run using <code>special:hotspot-internal</code> or just <code>hotspot-internal</code> as test descriptor, and will only work on a debug JVM.</p></li>
 <li><p>Failure handler testing is run using <code>special:failure-handler</code> or just <code>failure-handler</code> as test descriptor.</p></li>
 <li><p>Tests for the build system, including both makefiles and related functionality, is run using <code>special:make</code> or just <code>make</code> as test descriptor. This is equivalent to <code>special:make:all</code>.</p>
 <p>A specific make test can be run by supplying it as argument, e.g. <code>special:make:idea</code>. As a special syntax, this can also be expressed as <code>make-idea</code>, which allows for command lines as <code>make test-make-idea</code>.</p></li>
--- a/doc/testing.md	Fri Nov 02 16:26:11 2018 -0700
+++ b/doc/testing.md	Fri Nov 02 16:27:55 2018 -0700
@@ -108,11 +108,7 @@
 
 A handful of odd tests that are not covered by any other testing framework are
 accessible using the `special:` test descriptor. Currently, this includes
-`hotspot-internal`, `failure-handler` and `make`.
-
-  * Hotspot legacy internal testing (run using `-XX:+ExecuteInternalVMTests`)
-    is run using `special:hotspot-internal` or just `hotspot-internal` as test
-    descriptor, and will only work on a debug JVM.
+`failure-handler` and `make`.
 
   * Failure handler testing is run using `special:failure-handler` or just
     `failure-handler` as test descriptor.
--- a/make/RunTests.gmk	Fri Nov 02 16:26:11 2018 -0700
+++ b/make/RunTests.gmk	Fri Nov 02 16:27:55 2018 -0700
@@ -405,7 +405,7 @@
       special:make:all \
     )
   ) \
-  $(if $(filter hotspot-internal failure-handler, $1), \
+  $(if $(filter failure-handler, $1), \
     special:$(strip $1) \
   )
 endef
@@ -779,11 +779,7 @@
     $1_TEST_ARGS :=
   endif
 
-  ifeq ($$($1_TEST_NAME), hotspot-internal)
-    $1_TEST_COMMAND_LINE := \
-        $$(JDK_IMAGE_DIR)/bin/java -XX:+ExecuteInternalVMTests \
-        -XX:+ShowMessageBoxOnError -version
-  else ifeq ($$($1_TEST_NAME), failure-handler)
+  ifeq ($$($1_TEST_NAME), failure-handler)
     ifeq ($(BUILD_FAILURE_HANDLER), true)
       $1_TEST_COMMAND_LINE := \
           ($(CD) $(TOPDIR)/make/test && $(MAKE) $(MAKE_ARGS) -f \
--- a/make/common/FindTests.gmk	Fri Nov 02 16:26:11 2018 -0700
+++ b/make/common/FindTests.gmk	Fri Nov 02 16:27:55 2018 -0700
@@ -79,7 +79,7 @@
 ALL_NAMED_TESTS += $(addprefix make-, $(MAKE_TEST_TARGETS))
 
 # Add special tests
-ALL_NAMED_TESTS += hotspot-internal failure-handler make
+ALL_NAMED_TESTS += failure-handler make
 
 ################################################################################
 
--- a/src/hotspot/os/linux/os_linux.cpp	Fri Nov 02 16:26:11 2018 -0700
+++ b/src/hotspot/os/linux/os_linux.cpp	Fri Nov 02 16:27:55 2018 -0700
@@ -5956,14 +5956,6 @@
 
 #ifndef PRODUCT
 
-#define test_log(...)              \
-  do {                             \
-    if (VerboseInternalVMTests) {  \
-      tty->print_cr(__VA_ARGS__);  \
-      tty->flush();                \
-    }                              \
-  } while (false)
-
 class TestReserveMemorySpecial : AllStatic {
  public:
   static void small_page_write(void* addr, size_t size) {
@@ -5980,8 +5972,6 @@
       return;
     }
 
-    test_log("test_reserve_memory_special_huge_tlbfs_only(" SIZE_FORMAT ")", size);
-
     char* addr = os::Linux::reserve_memory_special_huge_tlbfs_only(size, NULL, false);
 
     if (addr != NULL) {
@@ -6040,15 +6030,10 @@
     ::munmap(mapping1, mapping_size);
 
     // Case 1
-    test_log("%s, req_addr NULL:", __FUNCTION__);
-    test_log("size            align           result");
-
     for (int i = 0; i < num_sizes; i++) {
       const size_t size = sizes[i];
       for (size_t alignment = ag; is_aligned(size, alignment); alignment *= 2) {
         char* p = os::Linux::reserve_memory_special_huge_tlbfs_mixed(size, alignment, NULL, false);
-        test_log(SIZE_FORMAT_HEX " " SIZE_FORMAT_HEX " ->  " PTR_FORMAT " %s",
-                 size, alignment, p2i(p), (p != NULL ? "" : "(failed)"));
         if (p != NULL) {
           assert(is_aligned(p, alignment), "must be");
           small_page_write(p, size);
@@ -6058,17 +6043,11 @@
     }
 
     // Case 2
-    test_log("%s, req_addr non-NULL:", __FUNCTION__);
-    test_log("size            align           req_addr         result");
-
     for (int i = 0; i < num_sizes; i++) {
       const size_t size = sizes[i];
       for (size_t alignment = ag; is_aligned(size, alignment); alignment *= 2) {
         char* const req_addr = align_up(mapping1, alignment);
         char* p = os::Linux::reserve_memory_special_huge_tlbfs_mixed(size, alignment, req_addr, false);
-        test_log(SIZE_FORMAT_HEX " " SIZE_FORMAT_HEX " " PTR_FORMAT " ->  " PTR_FORMAT " %s",
-                 size, alignment, p2i(req_addr), p2i(p),
-                 ((p != NULL ? (p == req_addr ? "(exact match)" : "") : "(failed)")));
         if (p != NULL) {
           assert(p == req_addr, "must be");
           small_page_write(p, size);
@@ -6078,16 +6057,11 @@
     }
 
     // Case 3
-    test_log("%s, req_addr non-NULL with preexisting mapping:", __FUNCTION__);
-    test_log("size            align           req_addr         result");
-
     for (int i = 0; i < num_sizes; i++) {
       const size_t size = sizes[i];
       for (size_t alignment = ag; is_aligned(size, alignment); alignment *= 2) {
         char* const req_addr = align_up(mapping2, alignment);
         char* p = os::Linux::reserve_memory_special_huge_tlbfs_mixed(size, alignment, req_addr, false);
-        test_log(SIZE_FORMAT_HEX " " SIZE_FORMAT_HEX " " PTR_FORMAT " ->  " PTR_FORMAT " %s",
-                 size, alignment, p2i(req_addr), p2i(p), ((p != NULL ? "" : "(failed)")));
         // as the area around req_addr contains already existing mappings, the API should always
         // return NULL (as per contract, it cannot return another address)
         assert(p == NULL, "must be");
@@ -6112,8 +6086,6 @@
       return;
     }
 
-    test_log("test_reserve_memory_special_shm(" SIZE_FORMAT ", " SIZE_FORMAT ")", size, alignment);
-
     char* addr = os::Linux::reserve_memory_special_shm(size, alignment, NULL, false);
 
     if (addr != NULL) {
--- a/src/hotspot/os/windows/os_windows.cpp	Fri Nov 02 16:26:11 2018 -0700
+++ b/src/hotspot/os/windows/os_windows.cpp	Fri Nov 02 16:27:55 2018 -0700
@@ -5557,12 +5557,8 @@
 // that is reported is when the test tries to allocate at a particular location but gets a
 // different valid one. A NULL return value at this point is not considered an error but may
 // be legitimate.
-// If -XX:+VerboseInternalVMTests is enabled, print some explanatory messages.
 void TestReserveMemorySpecial_test() {
   if (!UseLargePages) {
-    if (VerboseInternalVMTests) {
-      tty->print("Skipping test because large pages are disabled");
-    }
     return;
   }
   // save current value of globals
@@ -5576,10 +5572,6 @@
   const size_t large_allocation_size = os::large_page_size() * 4;
   char* result = os::reserve_memory_special(large_allocation_size, os::large_page_size(), NULL, false);
   if (result == NULL) {
-    if (VerboseInternalVMTests) {
-      tty->print("Failed to allocate control block with size " SIZE_FORMAT ". Skipping remainder of test.",
-                          large_allocation_size);
-    }
   } else {
     os::release_memory_special(result, large_allocation_size);
 
@@ -5589,10 +5581,6 @@
     char* expected_location = result + os::large_page_size();
     char* actual_location = os::reserve_memory_special(expected_allocation_size, os::large_page_size(), expected_location, false);
     if (actual_location == NULL) {
-      if (VerboseInternalVMTests) {
-        tty->print("Failed to allocate any memory at " PTR_FORMAT " size " SIZE_FORMAT ". Skipping remainder of test.",
-                            expected_location, large_allocation_size);
-      }
     } else {
       // release memory
       os::release_memory_special(actual_location, expected_allocation_size);
--- a/src/hotspot/share/gc/shared/gc_globals.hpp	Fri Nov 02 16:26:11 2018 -0700
+++ b/src/hotspot/share/gc/shared/gc_globals.hpp	Fri Nov 02 16:27:55 2018 -0700
@@ -372,12 +372,6 @@
   develop(uintx, MetadataAllocationFailALotInterval, 1000,                  \
           "Metadata allocation failure a lot interval")                     \
                                                                             \
-  notproduct(bool, ExecuteInternalVMTests, false,                           \
-          "Enable execution of internal VM tests")                          \
-                                                                            \
-  notproduct(bool, VerboseInternalVMTests, false,                           \
-          "Turn on logging for internal VM tests.")                         \
-                                                                            \
   product(bool, ExecutingUnitTests, false,                                  \
           "Whether the JVM is running unit tests or not")                   \
                                                                             \
--- a/src/hotspot/share/memory/virtualspace.cpp	Fri Nov 02 16:26:11 2018 -0700
+++ b/src/hotspot/share/memory/virtualspace.cpp	Fri Nov 02 16:27:55 2018 -0700
@@ -1059,14 +1059,6 @@
 
 #ifndef PRODUCT
 
-#define test_log(...) \
-  do {\
-    if (VerboseInternalVMTests) { \
-      tty->print_cr(__VA_ARGS__); \
-      tty->flush(); \
-    }\
-  } while (false)
-
 class TestReservedSpace : AllStatic {
  public:
   static void small_page_write(void* addr, size_t size) {
@@ -1087,8 +1079,6 @@
   }
 
   static void test_reserved_space1(size_t size, size_t alignment) {
-    test_log("test_reserved_space1(%p)", (void*) (uintptr_t) size);
-
     assert(is_aligned(size, alignment), "Incorrect input parameters");
 
     ReservedSpace rs(size,          // size
@@ -1096,8 +1086,6 @@
                      UseLargePages, // large
                      (char *)NULL); // requested_address
 
-    test_log(" rs.special() == %d", rs.special());
-
     assert(rs.base() != NULL, "Must be");
     assert(rs.size() == size, "Must be");
 
@@ -1112,14 +1100,10 @@
   }
 
   static void test_reserved_space2(size_t size) {
-    test_log("test_reserved_space2(%p)", (void*)(uintptr_t)size);
-
     assert(is_aligned(size, os::vm_allocation_granularity()), "Must be at least AG aligned");
 
     ReservedSpace rs(size);
 
-    test_log(" rs.special() == %d", rs.special());
-
     assert(rs.base() != NULL, "Must be");
     assert(rs.size() == size, "Must be");
 
@@ -1131,9 +1115,6 @@
   }
 
   static void test_reserved_space3(size_t size, size_t alignment, bool maybe_large) {
-    test_log("test_reserved_space3(%p, %p, %d)",
-        (void*)(uintptr_t)size, (void*)(uintptr_t)alignment, maybe_large);
-
     if (size < alignment) {
       // Tests might set -XX:LargePageSizeInBytes=<small pages> and cause unexpected input arguments for this test.
       assert((size_t)os::vm_page_size() == os::large_page_size(), "Test needs further refinement");
@@ -1147,8 +1128,6 @@
 
     ReservedSpace rs(size, alignment, large, false);
 
-    test_log(" rs.special() == %d", rs.special());
-
     assert(rs.base() != NULL, "Must be");
     assert(rs.size() == size, "Must be");
 
--- a/src/hotspot/share/prims/jni.cpp	Fri Nov 02 16:26:11 2018 -0700
+++ b/src/hotspot/share/prims/jni.cpp	Fri Nov 02 16:27:55 2018 -0700
@@ -86,7 +86,6 @@
 #include "utilities/dtrace.hpp"
 #include "utilities/events.hpp"
 #include "utilities/histogram.hpp"
-#include "utilities/internalVMTests.hpp"
 #include "utilities/macros.hpp"
 #include "utilities/vmError.hpp"
 #if INCLUDE_JVMCI
@@ -3977,9 +3976,6 @@
     // Some platforms (like Win*) need a wrapper around these test
     // functions in order to properly handle error conditions.
     VMError::test_error_handler();
-    if (ExecuteInternalVMTests) {
-      InternalVMTests::run();
-    }
 #endif
 
     // Since this is not a JVM_ENTRY we have to set the thread state manually before leaving.
--- a/src/hotspot/share/utilities/internalVMTests.cpp	Fri Nov 02 16:26:11 2018 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,48 +0,0 @@
-/*
- * Copyright (c) 2016, 2018, 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.
- *
- */
-
-#include "precompiled.hpp"
-
-#ifndef PRODUCT
-#include <locale.h>
-
-#include "utilities/internalVMTests.hpp"
-#include "utilities/macros.hpp"
-#include "utilities/ostream.hpp"
-
-#define run_unit_test(unit_test_function_call)                \
-  void unit_test_function_call();                             \
-  run_test(#unit_test_function_call, unit_test_function_call);
-
-void InternalVMTests::run_test(const char* name, void (*test)()) {
-  tty->print_cr("Running test: %s", name);
-  test();
-}
-
-void InternalVMTests::run() {
-  tty->print_cr("Running internal VM tests");
-  tty->print_cr("All internal VM tests passed");
-}
-
-#endif
--- a/src/hotspot/share/utilities/internalVMTests.hpp	Fri Nov 02 16:26:11 2018 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,40 +0,0 @@
-/*
- * Copyright (c) 2016, 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.
- *
- */
-
-#ifndef SHARE_VM_UTILITIES_INTERNALVMTESTS_HPP
-#define SHARE_VM_UTILITIES_INTERNALVMTESTS_HPP
-
-#ifndef PRODUCT
-
-#include "memory/allocation.hpp"
-
-class InternalVMTests : public AllStatic {
-  static void run_test(const char* name, void (*test)());
- public:
-  static void run();
-};
-
-#endif
-
-#endif // SHARE_VM_UTILITIES_INTERNALVMTESTS_HPP
--- a/test/hotspot/jtreg/Makefile	Fri Nov 02 16:26:11 2018 -0700
+++ b/test/hotspot/jtreg/Makefile	Fri Nov 02 16:27:55 2018 -0700
@@ -49,9 +49,6 @@
 	$(ECHO) "Running tests: $@"
 	$(MAKE) -j 1 TEST_SELECTION=":$@" UNIQUE_DIR=$@ jtreg_tests;
 
-hotspot_internal:
-	$(ALT_OUTPUTDIR)/jdk/bin/java -XX:+ExecuteInternalVMTests -XX:+ShowMessageBoxOnError -version
-
 ################################################################
 
 # Set up the directory in which the jvm directories live (client/, server/, etc.)
--- a/test/hotspot/jtreg/TEST.groups	Fri Nov 02 16:26:11 2018 -0700
+++ b/test/hotspot/jtreg/TEST.groups	Fri Nov 02 16:27:55 2018 -0700
@@ -180,7 +180,6 @@
   -gc/g1/ihop/TestIHOPErgo.java
 
 tier1_gc_2 = \
-  sanity/ExecuteInternalVMTests.java \
   gc/ \
   -gc/epsilon/ \
   -gc/g1/ \
--- a/test/hotspot/jtreg/runtime/CommandLine/VMOptionWarning.java	Fri Nov 02 16:26:11 2018 -0700
+++ b/test/hotspot/jtreg/runtime/CommandLine/VMOptionWarning.java	Fri Nov 02 16:27:55 2018 -0700
@@ -53,8 +53,8 @@
         output = new OutputAnalyzer(pb.start());
         output.shouldContain("Error: VM option 'VerifyStack' is develop and is available only in debug version of VM.");
 
-        pb = ProcessTools.createJavaProcessBuilder("-XX:+ExecuteInternalVMTests", "-version");
+        pb = ProcessTools.createJavaProcessBuilder("-XX:+CheckCompressedOops", "-version");
         output = new OutputAnalyzer(pb.start());
-        output.shouldContain("Error: VM option 'ExecuteInternalVMTests' is notproduct and is available only in debug version of VM.");
+        output.shouldContain("Error: VM option 'CheckCompressedOops' is notproduct and is available only in debug version of VM.");
     }
 }
--- a/test/hotspot/jtreg/sanity/ExecuteInternalVMTests.java	Fri Nov 02 16:26:11 2018 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,39 +0,0 @@
-/*
- * Copyright (c) 2012, 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 ExecuteInternalVMTests
- * @bug 8004691
- * @summary Add a jtreg test that exercises the ExecuteInternalVMTests flag
- * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:+ExecuteInternalVMTests ExecuteInternalVMTests
- */
-public class ExecuteInternalVMTests {
-    public static void main(String[] args) throws Exception {
-        // The tests that are run are the HotSpot internal tests which are
-        // executed only when the flag -XX:+ExecuteInternalVMTests is used.
-
-        // The flag -XX:+ExecuteInternalVMTests can only be used for
-        // non-product builds of HotSpot. Therefore, the flag
-        // -XX:+IgnoreUnrecognizedVMOptions is also used, which means that this
-        // test will do nothing on a product build.
-    }
-}