< prev index next >

src/hotspot/share/services/threadService.hpp

Print this page

230   void        set_next(ThreadSnapshot* n) { _next = n; }
231 
232   bool        is_suspended()              { return _is_suspended; }
233   bool        is_in_native()              { return _is_in_native; }
234 
235   jlong       contended_enter_count()     { return _contended_enter_count; }
236   jlong       contended_enter_ticks()     { return _contended_enter_ticks; }
237   jlong       monitor_wait_count()        { return _monitor_wait_count; }
238   jlong       monitor_wait_ticks()        { return _monitor_wait_ticks; }
239   jlong       sleep_count()               { return _sleep_count; }
240   jlong       sleep_ticks()               { return _sleep_ticks; }
241 
242 
243   oop         blocker_object() const;
244   oop         blocker_object_owner() const;
245 
246   ThreadSnapshot*   next() const          { return _next; }
247   ThreadStackTrace* get_stack_trace()     { return _stack_trace; }
248   ThreadConcurrentLocks* get_concurrent_locks()     { return _concurrent_locks; }
249 
250   void        dump_stack_at_safepoint(int max_depth, bool with_locked_monitors);
251   void        set_concurrent_locks(ThreadConcurrentLocks* l) { _concurrent_locks = l; }
252   void        metadata_do(void f(Metadata*));
253 };
254 
255 class ThreadStackTrace : public CHeapObj<mtInternal> {
256  private:
257   JavaThread*                     _thread;
258   int                             _depth;  // number of stack frames added
259   bool                            _with_locked_monitors;
260   GrowableArray<StackFrameInfo*>* _frames;
261   GrowableArray<OopHandle>*       _jni_locked_monitors;
262 
263  public:
264 
265   ThreadStackTrace(JavaThread* thread, bool with_locked_monitors);
266   ~ThreadStackTrace();
267 
268   JavaThread*     thread()              { return _thread; }
269   StackFrameInfo* stack_frame_at(int i) { return _frames->at(i); }
270   int             get_stack_depth()     { return _depth; }
271 
272   void            add_stack_frame(javaVFrame* jvf);
273   void            dump_stack_at_safepoint(int max_depth);
274   Handle          allocate_fill_stack_trace_element_array(TRAPS);
275   void            metadata_do(void f(Metadata*));
276   GrowableArray<OopHandle>* jni_locked_monitors() { return _jni_locked_monitors; }
277   int             num_jni_locked_monitors() { return (_jni_locked_monitors != NULL ? _jni_locked_monitors->length() : 0); }
278 
279   bool            is_owned_monitor_on_stack(oop object);
280   void            add_jni_locked_monitor(oop object);
281 };
282 
283 // StackFrameInfo for keeping Method* and bci during
284 // stack walking for later construction of StackTraceElement[]
285 // Java instances
286 class StackFrameInfo : public CHeapObj<mtInternal> {
287  private:
288   Method*             _method;
289   int                 _bci;

290   GrowableArray<OopHandle>* _locked_monitors; // list of object monitors locked by this frame
291   // We need to save the mirrors in the backtrace to keep the class
292   // from being unloaded while we still have this stack trace.
293   OopHandle           _class_holder;
294 
295  public:
296 
297   StackFrameInfo(javaVFrame* jvf, bool with_locked_monitors);
298   ~StackFrameInfo();
299   Method*   method() const       { return _method; }
300   int       bci()    const       { return _bci; }

301   void      metadata_do(void f(Metadata*));
302 
303   int       num_locked_monitors()       { return (_locked_monitors != NULL ? _locked_monitors->length() : 0); }
304   GrowableArray<OopHandle>* locked_monitors() { return _locked_monitors; }
305 
306   void      print_on(outputStream* st) const;
307 };
308 
309 class ThreadConcurrentLocks : public CHeapObj<mtInternal> {
310 private:
311   GrowableArray<OopHandle>*   _owned_locks;
312   ThreadConcurrentLocks*      _next;
313   // This JavaThread* is protected in one of two different ways
314   // depending on the usage of the ThreadConcurrentLocks object:
315   // 1) by being stored in objects that are only allocated and used at a
316   // safepoint (ConcurrentLocksDump), or 2) by being stored in objects
317   // that are protected by a ThreadsListSetter (ThreadSnapshot inside
318   // ThreadDumpResult).
319   JavaThread*                 _thread;
320  public:

230   void        set_next(ThreadSnapshot* n) { _next = n; }
231 
232   bool        is_suspended()              { return _is_suspended; }
233   bool        is_in_native()              { return _is_in_native; }
234 
235   jlong       contended_enter_count()     { return _contended_enter_count; }
236   jlong       contended_enter_ticks()     { return _contended_enter_ticks; }
237   jlong       monitor_wait_count()        { return _monitor_wait_count; }
238   jlong       monitor_wait_ticks()        { return _monitor_wait_ticks; }
239   jlong       sleep_count()               { return _sleep_count; }
240   jlong       sleep_ticks()               { return _sleep_ticks; }
241 
242 
243   oop         blocker_object() const;
244   oop         blocker_object_owner() const;
245 
246   ThreadSnapshot*   next() const          { return _next; }
247   ThreadStackTrace* get_stack_trace()     { return _stack_trace; }
248   ThreadConcurrentLocks* get_concurrent_locks()     { return _concurrent_locks; }
249 
250   void        dump_stack_at_safepoint(int max_depth, bool with_locked_monitors, bool full);
251   void        set_concurrent_locks(ThreadConcurrentLocks* l) { _concurrent_locks = l; }
252   void        metadata_do(void f(Metadata*));
253 };
254 
255 class ThreadStackTrace : public CHeapObj<mtInternal> {
256  private:
257   JavaThread*                     _thread;
258   int                             _depth;  // number of stack frames added
259   bool                            _with_locked_monitors;
260   GrowableArray<StackFrameInfo*>* _frames;
261   GrowableArray<OopHandle>*       _jni_locked_monitors;
262 
263  public:
264 
265   ThreadStackTrace(JavaThread* thread, bool with_locked_monitors);
266   ~ThreadStackTrace();
267 
268   JavaThread*     thread()              { return _thread; }
269   StackFrameInfo* stack_frame_at(int i) { return _frames->at(i); }
270   int             get_stack_depth()     { return _depth; }
271 
272   void            add_stack_frame(javaVFrame* jvf);
273   void            dump_stack_at_safepoint(int max_depth, bool full);
274   Handle          allocate_fill_stack_trace_element_array(TRAPS);
275   void            metadata_do(void f(Metadata*));
276   GrowableArray<OopHandle>* jni_locked_monitors() { return _jni_locked_monitors; }
277   int             num_jni_locked_monitors() { return (_jni_locked_monitors != NULL ? _jni_locked_monitors->length() : 0); }
278 
279   bool            is_owned_monitor_on_stack(oop object);
280   void            add_jni_locked_monitor(oop object);
281 };
282 
283 // StackFrameInfo for keeping Method* and bci during
284 // stack walking for later construction of StackTraceElement[]
285 // Java instances
286 class StackFrameInfo : public CHeapObj<mtInternal> {
287  private:
288   Method*             _method;
289   int                 _bci;
290   OopHandle           _cont_scope_name;
291   GrowableArray<OopHandle>* _locked_monitors; // list of object monitors locked by this frame
292   // We need to save the mirrors in the backtrace to keep the class
293   // from being unloaded while we still have this stack trace.
294   OopHandle           _class_holder;
295 
296  public:
297 
298   StackFrameInfo(javaVFrame* jvf, bool with_locked_monitors);
299   ~StackFrameInfo();
300   Method*   method() const       { return _method; }
301   int       bci()    const       { return _bci; }
302   OopHandle cont_scope_name() const { return _cont_scope_name; }
303   void      metadata_do(void f(Metadata*));
304 
305   int       num_locked_monitors()       { return (_locked_monitors != NULL ? _locked_monitors->length() : 0); }
306   GrowableArray<OopHandle>* locked_monitors() { return _locked_monitors; }
307 
308   void      print_on(outputStream* st) const;
309 };
310 
311 class ThreadConcurrentLocks : public CHeapObj<mtInternal> {
312 private:
313   GrowableArray<OopHandle>*   _owned_locks;
314   ThreadConcurrentLocks*      _next;
315   // This JavaThread* is protected in one of two different ways
316   // depending on the usage of the ThreadConcurrentLocks object:
317   // 1) by being stored in objects that are only allocated and used at a
318   // safepoint (ConcurrentLocksDump), or 2) by being stored in objects
319   // that are protected by a ThreadsListSetter (ThreadSnapshot inside
320   // ThreadDumpResult).
321   JavaThread*                 _thread;
322  public:
< prev index next >