hotspot/src/share/vm/runtime/thread.cpp
changeset 22796 bb0ea482a99e
parent 22556 a17351e8c2c2
child 22881 b16d7faa638d
equal deleted inserted replaced
22795:2b5380bc0926 22796:bb0ea482a99e
   110 
   110 
   111 #ifdef DTRACE_ENABLED
   111 #ifdef DTRACE_ENABLED
   112 
   112 
   113 // Only bother with this argument setup if dtrace is available
   113 // Only bother with this argument setup if dtrace is available
   114 
   114 
   115 #ifndef USDT2
       
   116 HS_DTRACE_PROBE_DECL(hotspot, vm__init__begin);
       
   117 HS_DTRACE_PROBE_DECL(hotspot, vm__init__end);
       
   118 HS_DTRACE_PROBE_DECL5(hotspot, thread__start, char*, intptr_t,
       
   119   intptr_t, intptr_t, bool);
       
   120 HS_DTRACE_PROBE_DECL5(hotspot, thread__stop, char*, intptr_t,
       
   121   intptr_t, intptr_t, bool);
       
   122 
       
   123 #define DTRACE_THREAD_PROBE(probe, javathread)                             \
       
   124   {                                                                        \
       
   125     ResourceMark rm(this);                                                 \
       
   126     int len = 0;                                                           \
       
   127     const char* name = (javathread)->get_thread_name();                    \
       
   128     len = strlen(name);                                                    \
       
   129     HS_DTRACE_PROBE5(hotspot, thread__##probe,                             \
       
   130       name, len,                                                           \
       
   131       java_lang_Thread::thread_id((javathread)->threadObj()),              \
       
   132       (javathread)->osthread()->thread_id(),                               \
       
   133       java_lang_Thread::is_daemon((javathread)->threadObj()));             \
       
   134   }
       
   135 
       
   136 #else /* USDT2 */
       
   137 
       
   138 #define HOTSPOT_THREAD_PROBE_start HOTSPOT_THREAD_START
   115 #define HOTSPOT_THREAD_PROBE_start HOTSPOT_THREAD_START
   139 #define HOTSPOT_THREAD_PROBE_stop HOTSPOT_THREAD_STOP
   116 #define HOTSPOT_THREAD_PROBE_stop HOTSPOT_THREAD_STOP
   140 
   117 
   141 #define DTRACE_THREAD_PROBE(probe, javathread)                             \
   118 #define DTRACE_THREAD_PROBE(probe, javathread)                             \
   142   {                                                                        \
   119   {                                                                        \
   148       (char *) name, len,                                                           \
   125       (char *) name, len,                                                           \
   149       java_lang_Thread::thread_id((javathread)->threadObj()),              \
   126       java_lang_Thread::thread_id((javathread)->threadObj()),              \
   150       (uintptr_t) (javathread)->osthread()->thread_id(),                               \
   127       (uintptr_t) (javathread)->osthread()->thread_id(),                               \
   151       java_lang_Thread::is_daemon((javathread)->threadObj()));             \
   128       java_lang_Thread::is_daemon((javathread)->threadObj()));             \
   152   }
   129   }
   153 
       
   154 #endif /* USDT2 */
       
   155 
   130 
   156 #else //  ndef DTRACE_ENABLED
   131 #else //  ndef DTRACE_ENABLED
   157 
   132 
   158 #define DTRACE_THREAD_PROBE(probe, javathread)
   133 #define DTRACE_THREAD_PROBE(probe, javathread)
   159 
   134 
  3389 
  3364 
  3390   if (PauseAtStartup) {
  3365   if (PauseAtStartup) {
  3391     os::pause();
  3366     os::pause();
  3392   }
  3367   }
  3393 
  3368 
  3394 #ifndef USDT2
       
  3395   HS_DTRACE_PROBE(hotspot, vm__init__begin);
       
  3396 #else /* USDT2 */
       
  3397   HOTSPOT_VM_INIT_BEGIN();
  3369   HOTSPOT_VM_INIT_BEGIN();
  3398 #endif /* USDT2 */
       
  3399 
  3370 
  3400   // Record VM creation timing statistics
  3371   // Record VM creation timing statistics
  3401   TraceVmCreationTime create_vm_timer;
  3372   TraceVmCreationTime create_vm_timer;
  3402   create_vm_timer.start();
  3373   create_vm_timer.start();
  3403 
  3374 
  3555 
  3526 
  3556   // Set flag that basic initialization has completed. Used by exceptions and various
  3527   // Set flag that basic initialization has completed. Used by exceptions and various
  3557   // debug stuff, that does not work until all basic classes have been initialized.
  3528   // debug stuff, that does not work until all basic classes have been initialized.
  3558   set_init_completed();
  3529   set_init_completed();
  3559 
  3530 
  3560 #ifndef USDT2
       
  3561   HS_DTRACE_PROBE(hotspot, vm__init__end);
       
  3562 #else /* USDT2 */
       
  3563   HOTSPOT_VM_INIT_END();
  3531   HOTSPOT_VM_INIT_END();
  3564 #endif /* USDT2 */
       
  3565 
  3532 
  3566   // record VM initialization completion time
  3533   // record VM initialization completion time
  3567 #if INCLUDE_MANAGEMENT
  3534 #if INCLUDE_MANAGEMENT
  3568   Management::record_vm_init_completed();
  3535   Management::record_vm_init_completed();
  3569 #endif // INCLUDE_MANAGEMENT
  3536 #endif // INCLUDE_MANAGEMENT