8218753: Obsolete nonproduct flag ProfilerCheckIntervals
authorredestad
Thu, 14 Feb 2019 11:33:45 +0100
changeset 53750 2cf90fac6e39
parent 53749 5bd93a49c640
child 53751 22c78a512937
8218753: Obsolete nonproduct flag ProfilerCheckIntervals Reviewed-by: dholmes, coleenp
src/hotspot/share/runtime/arguments.cpp
src/hotspot/share/runtime/globals.hpp
src/hotspot/share/runtime/java.cpp
src/hotspot/share/runtime/task.cpp
src/hotspot/share/runtime/task.hpp
--- a/src/hotspot/share/runtime/arguments.cpp	Thu Feb 14 01:25:04 2019 +0100
+++ b/src/hotspot/share/runtime/arguments.cpp	Thu Feb 14 11:33:45 2019 +0100
@@ -546,6 +546,7 @@
   { "ProfileVM",                     JDK_Version::undefined(), JDK_Version::jdk(13), JDK_Version::jdk(14) },
   { "ProfileIntervals",              JDK_Version::undefined(), JDK_Version::jdk(13), JDK_Version::jdk(14) },
   { "ProfileIntervalsTicks",         JDK_Version::undefined(), JDK_Version::jdk(13), JDK_Version::jdk(14) },
+  { "ProfilerCheckIntervals",        JDK_Version::undefined(), JDK_Version::jdk(13), JDK_Version::jdk(14) },
   { "ProfilerNumberOfInterpretedMethods", JDK_Version::undefined(), JDK_Version::jdk(13), JDK_Version::jdk(14) },
   { "ProfilerNumberOfCompiledMethods", JDK_Version::undefined(), JDK_Version::jdk(13), JDK_Version::jdk(14) },
   { "ProfilerNumberOfStubMethods",   JDK_Version::undefined(), JDK_Version::jdk(13), JDK_Version::jdk(14) },
--- a/src/hotspot/share/runtime/globals.hpp	Thu Feb 14 01:25:04 2019 +0100
+++ b/src/hotspot/share/runtime/globals.hpp	Thu Feb 14 11:33:45 2019 +0100
@@ -749,9 +749,6 @@
   product(bool, OmitStackTraceInFastThrow, true,                            \
           "Omit backtraces for some 'hot' exceptions in optimized code")    \
                                                                             \
-  notproduct(bool, ProfilerCheckIntervals, false,                           \
-          "Collect and print information on spacing of profiler ticks")     \
-                                                                            \
   product(bool, PrintWarnings, true,                                        \
           "Print JVM warnings to output stream")                            \
                                                                             \
--- a/src/hotspot/share/runtime/java.cpp	Thu Feb 14 01:25:04 2019 +0100
+++ b/src/hotspot/share/runtime/java.cpp	Thu Feb 14 11:33:45 2019 +0100
@@ -291,9 +291,6 @@
   if (TimeOopMap) {
     GenerateOopMap::print_time();
   }
-  if (ProfilerCheckIntervals) {
-    PeriodicTask::print_intervals();
-  }
   if (PrintSymbolTableSizeHistogram) {
     SymbolTable::print_histogram();
   }
--- a/src/hotspot/share/runtime/task.cpp	Thu Feb 14 01:25:04 2019 +0100
+++ b/src/hotspot/share/runtime/task.cpp	Thu Feb 14 11:33:45 2019 +0100
@@ -31,48 +31,20 @@
 
 int PeriodicTask::_num_tasks = 0;
 PeriodicTask* PeriodicTask::_tasks[PeriodicTask::max_tasks];
-#ifndef PRODUCT
-elapsedTimer PeriodicTask::_timer;
-int PeriodicTask::_intervalHistogram[PeriodicTask::max_interval];
-int PeriodicTask::_ticks;
-
-void PeriodicTask::print_intervals() {
-  if (ProfilerCheckIntervals) {
-    for (int i = 0; i < PeriodicTask::max_interval; i++) {
-      int n = _intervalHistogram[i];
-      if (n > 0) tty->print_cr("%3d: %5d (%4.1f%%)", i, n, 100.0 * n / _ticks);
-    }
-  }
-}
-#endif
 
 void PeriodicTask::real_time_tick(int delay_time) {
   assert(Thread::current()->is_Watcher_thread(), "must be WatcherThread");
 
-#ifndef PRODUCT
-  if (ProfilerCheckIntervals) {
-    _ticks++;
-    _timer.stop();
-    int ms = (int)_timer.milliseconds();
-    _timer.reset();
-    _timer.start();
-    if (ms >= PeriodicTask::max_interval) ms = PeriodicTask::max_interval - 1;
-    _intervalHistogram[ms]++;
-  }
-#endif
+  // The WatcherThread does not participate in the safepoint protocol
+  // for the PeriodicTask_lock because it is not a JavaThread.
+  MutexLockerEx ml(PeriodicTask_lock, Mutex::_no_safepoint_check_flag);
+  int orig_num_tasks = _num_tasks;
 
-  {
-    // The WatcherThread does not participate in the safepoint protocol
-    // for the PeriodicTask_lock because it is not a JavaThread.
-    MutexLockerEx ml(PeriodicTask_lock, Mutex::_no_safepoint_check_flag);
-    int orig_num_tasks = _num_tasks;
-
-    for(int index = 0; index < _num_tasks; index++) {
-      _tasks[index]->execute_if_pending(delay_time);
-      if (_num_tasks < orig_num_tasks) { // task dis-enrolled itself
-        index--;  // re-do current slot as it has changed
-        orig_num_tasks = _num_tasks;
-      }
+  for(int index = 0; index < _num_tasks; index++) {
+    _tasks[index]->execute_if_pending(delay_time);
+    if (_num_tasks < orig_num_tasks) { // task dis-enrolled itself
+      index--;  // re-do current slot as it has changed
+      orig_num_tasks = _num_tasks;
     }
   }
 }
--- a/src/hotspot/share/runtime/task.hpp	Thu Feb 14 01:25:04 2019 +0100
+++ b/src/hotspot/share/runtime/task.hpp	Thu Feb 14 11:33:45 2019 +0100
@@ -58,13 +58,6 @@
   // Can only be called by the WatcherThread
   static void real_time_tick(int delay_time);
 
-#ifndef PRODUCT
-  static elapsedTimer _timer;                      // measures time between ticks
-  static int _ticks;                               // total number of ticks
-  static int _intervalHistogram[max_interval];     // to check spacing of timer interrupts
- public:
-  static void print_intervals();
-#endif
   // Only the WatcherThread can cause us to execute PeriodicTasks
   friend class WatcherThread;
  public: