< prev index next >

src/hotspot/share/services/threadService.hpp

Print this page




   8  *
   9  * This code is distributed in the hope that it will be useful, but WITHOUT
  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  *
  23  */
  24 
  25 #ifndef SHARE_SERVICES_THREADSERVICE_HPP
  26 #define SHARE_SERVICES_THREADSERVICE_HPP
  27 

  28 #include "classfile/javaClasses.hpp"
  29 #include "runtime/handles.hpp"
  30 #include "runtime/init.hpp"
  31 #include "runtime/jniHandles.hpp"
  32 #include "runtime/objectMonitor.hpp"
  33 #include "runtime/perfData.hpp"
  34 #include "runtime/safepoint.hpp"
  35 #include "runtime/thread.hpp"
  36 #include "runtime/threadSMR.hpp"
  37 #include "services/management.hpp"
  38 
  39 class OopClosure;
  40 class ThreadDumpResult;
  41 class ThreadStackTrace;
  42 class ThreadSnapshot;
  43 class StackFrameInfo;
  44 class ThreadConcurrentLocks;
  45 class DeadlockCycle;
  46 
  47 // VM monitoring and management support for the thread and


 123 private:
 124   // The following contention statistics are only updated by
 125   // the thread owning these statistics when contention occurs.
 126 
 127   jlong        _contended_enter_count;
 128   elapsedTimer _contended_enter_timer;
 129   jlong        _monitor_wait_count;
 130   elapsedTimer _monitor_wait_timer;
 131   jlong        _sleep_count;
 132   elapsedTimer _sleep_timer;
 133 
 134 
 135   // These two reset flags are set to true when another thread
 136   // requests to reset the statistics.  The actual statistics
 137   // are reset when the thread contention occurs and attempts
 138   // to update the statistics.
 139   bool         _count_pending_reset;
 140   bool         _timer_pending_reset;
 141 
 142   // Keep accurate times for potentially recursive class operations
 143   int           _perf_recursion_counts[6];
 144   elapsedTimer  _perf_timers[6];
 145 
 146   // utility functions
 147   void  check_and_reset_count()            {
 148                                              if (!_count_pending_reset) return;
 149                                              _contended_enter_count = 0;
 150                                              _monitor_wait_count = 0;
 151                                              _sleep_count = 0;
 152                                              _count_pending_reset = 0;
 153                                            }
 154   void  check_and_reset_timer()            {
 155                                              if (!_timer_pending_reset) return;
 156                                              _contended_enter_timer.reset();
 157                                              _monitor_wait_timer.reset();
 158                                              _sleep_timer.reset();
 159                                              _timer_pending_reset = 0;
 160                                            }
 161 
 162 public:
 163   ThreadStatistics();
 164 




   8  *
   9  * This code is distributed in the hope that it will be useful, but WITHOUT
  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  *
  23  */
  24 
  25 #ifndef SHARE_SERVICES_THREADSERVICE_HPP
  26 #define SHARE_SERVICES_THREADSERVICE_HPP
  27 
  28 #include "classfile/classLoader.hpp"
  29 #include "classfile/javaClasses.hpp"
  30 #include "runtime/handles.hpp"
  31 #include "runtime/init.hpp"
  32 #include "runtime/jniHandles.hpp"
  33 #include "runtime/objectMonitor.hpp"
  34 #include "runtime/perfData.hpp"
  35 #include "runtime/safepoint.hpp"
  36 #include "runtime/thread.hpp"
  37 #include "runtime/threadSMR.hpp"
  38 #include "services/management.hpp"
  39 
  40 class OopClosure;
  41 class ThreadDumpResult;
  42 class ThreadStackTrace;
  43 class ThreadSnapshot;
  44 class StackFrameInfo;
  45 class ThreadConcurrentLocks;
  46 class DeadlockCycle;
  47 
  48 // VM monitoring and management support for the thread and


 124 private:
 125   // The following contention statistics are only updated by
 126   // the thread owning these statistics when contention occurs.
 127 
 128   jlong        _contended_enter_count;
 129   elapsedTimer _contended_enter_timer;
 130   jlong        _monitor_wait_count;
 131   elapsedTimer _monitor_wait_timer;
 132   jlong        _sleep_count;
 133   elapsedTimer _sleep_timer;
 134 
 135 
 136   // These two reset flags are set to true when another thread
 137   // requests to reset the statistics.  The actual statistics
 138   // are reset when the thread contention occurs and attempts
 139   // to update the statistics.
 140   bool         _count_pending_reset;
 141   bool         _timer_pending_reset;
 142 
 143   // Keep accurate times for potentially recursive class operations
 144   int           _perf_recursion_counts[PerfClassTraceTime::EVENT_TYPE_COUNT];
 145   elapsedTimer  _perf_timers[PerfClassTraceTime::EVENT_TYPE_COUNT];
 146 
 147   // utility functions
 148   void  check_and_reset_count()            {
 149                                              if (!_count_pending_reset) return;
 150                                              _contended_enter_count = 0;
 151                                              _monitor_wait_count = 0;
 152                                              _sleep_count = 0;
 153                                              _count_pending_reset = 0;
 154                                            }
 155   void  check_and_reset_timer()            {
 156                                              if (!_timer_pending_reset) return;
 157                                              _contended_enter_timer.reset();
 158                                              _monitor_wait_timer.reset();
 159                                              _sleep_timer.reset();
 160                                              _timer_pending_reset = 0;
 161                                            }
 162 
 163 public:
 164   ThreadStatistics();
 165 


< prev index next >