changeset 59794:ff131a43962f

8247289: Obsolete unused UseBsdPosixThreadCPUClocks 8247292: Obsolete unused UseOprofile flag on BSD Reviewed-by: hseigel, dcubed Contributed-by: Christoph Dreis <christoph.dreis@freenet.de>, David Holmes <david.holmes@oracle.com>
author dholmes
date Mon, 15 Jun 2020 18:35:46 -0400
parents 87828d2e32fe
children b66fb33922b4
files src/hotspot/os/bsd/globals_bsd.hpp src/hotspot/os/bsd/os_bsd.cpp src/hotspot/share/runtime/arguments.cpp
diffstat 3 files changed, 5 insertions(+), 45 deletions(-) [+]
line wrap: on
line diff
--- a/src/hotspot/os/bsd/globals_bsd.hpp	Mon Jun 15 09:21:39 2020 -0700
+++ b/src/hotspot/os/bsd/globals_bsd.hpp	Mon Jun 15 18:35:46 2020 -0400
@@ -36,15 +36,7 @@
                          diagnostic_pd, \
                          notproduct, \
                          range, \
-                         constraint) \
-                                                                                \
-  product(bool, UseOprofile, false,                                             \
-        "enable support for Oprofile profiler")                                 \
-                                                                                \
-  /*  NB: The default value of UseBsdPosixThreadCPUClocks may be  */            \
-  /*  overridden in Arguments::parse_each_vm_init_arg.            */            \
-  product(bool, UseBsdPosixThreadCPUClocks, true,                               \
-          "enable fast Bsd Posix clocks where available")                       \
+                         constraint)
 
 //
 // Defines Bsd-specific default values. The flags are available on all
--- a/src/hotspot/os/bsd/os_bsd.cpp	Mon Jun 15 09:21:39 2020 -0700
+++ b/src/hotspot/os/bsd/os_bsd.cpp	Mon Jun 15 18:35:46 2020 -0400
@@ -1879,42 +1879,6 @@
   return os::Bsd::page_size();
 }
 
-// Rationale behind this function:
-//  current (Mon Apr 25 20:12:18 MSD 2005) oprofile drops samples without executable
-//  mapping for address (see lookup_dcookie() in the kernel module), thus we cannot get
-//  samples for JITted code. Here we create private executable mapping over the code cache
-//  and then we can use standard (well, almost, as mapping can change) way to provide
-//  info for the reporting script by storing timestamp and location of symbol
-void bsd_wrap_code(char* base, size_t size) {
-  static volatile jint cnt = 0;
-
-  if (!UseOprofile) {
-    return;
-  }
-
-  char buf[PATH_MAX + 1];
-  int num = Atomic::add(&cnt, 1);
-
-  snprintf(buf, PATH_MAX + 1, "%s/hs-vm-%d-%d",
-           os::get_temp_directory(), os::current_process_id(), num);
-  unlink(buf);
-
-  int fd = ::open(buf, O_CREAT | O_RDWR, S_IRWXU);
-
-  if (fd != -1) {
-    off_t rv = ::lseek(fd, size-2, SEEK_SET);
-    if (rv != (off_t)-1) {
-      if (::write(fd, "", 1) == 1) {
-        mmap(base, size,
-             PROT_READ|PROT_WRITE|PROT_EXEC,
-             MAP_PRIVATE|MAP_FIXED|MAP_NORESERVE, fd, 0);
-      }
-    }
-    ::close(fd);
-    unlink(buf);
-  }
-}
-
 static void warn_fail_commit_memory(char* addr, size_t size, bool exec,
                                     int err) {
   warning("INFO: os::commit_memory(" INTPTR_FORMAT ", " SIZE_FORMAT
--- a/src/hotspot/share/runtime/arguments.cpp	Mon Jun 15 09:21:39 2020 -0700
+++ b/src/hotspot/share/runtime/arguments.cpp	Mon Jun 15 18:35:46 2020 -0400
@@ -548,6 +548,10 @@
   { "SharedReadOnlySize",            JDK_Version::undefined(), JDK_Version::jdk(10), JDK_Version::undefined() },
   { "SharedMiscDataSize",            JDK_Version::undefined(), JDK_Version::jdk(10), JDK_Version::undefined() },
   { "SharedMiscCodeSize",            JDK_Version::undefined(), JDK_Version::jdk(10), JDK_Version::undefined() },
+#ifdef BSD
+  { "UseBsdPosixThreadCPUClocks",    JDK_Version::undefined(), JDK_Version::jdk(16), JDK_Version::jdk(17) },
+  { "UseOprofile",                   JDK_Version::undefined(), JDK_Version::jdk(16), JDK_Version::jdk(17) },
+#endif
 
 #ifdef TEST_VERIFY_SPECIAL_JVM_FLAGS
   // These entries will generate build errors.  Their purpose is to test the macros.