5 * This code is free software; you can redistribute it and/or modify it 6 * under the terms of the GNU General Public License version 2 only, as 7 * published by the Free Software Foundation. 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 # include "incls/_precompiled.incl" 26 # include "incls/_thread.cpp.incl" 27 28 #ifdef DTRACE_ENABLED 29 30 // Only bother with this argument setup if dtrace is available 31 32 HS_DTRACE_PROBE_DECL(hotspot, vm__init__begin); 33 HS_DTRACE_PROBE_DECL(hotspot, vm__init__end); 34 HS_DTRACE_PROBE_DECL5(hotspot, thread__start, char*, intptr_t, 35 intptr_t, intptr_t, bool); 36 HS_DTRACE_PROBE_DECL5(hotspot, thread__stop, char*, intptr_t, 37 intptr_t, intptr_t, bool); 38 39 #define DTRACE_THREAD_PROBE(probe, javathread) \ 40 { \ 41 ResourceMark rm(this); \ 42 int len = 0; \ 43 const char* name = (javathread)->get_thread_name(); \ 44 len = strlen(name); \ 45 HS_DTRACE_PROBE5(hotspot, thread__##probe, \ 46 name, len, \ | 5 * This code is free software; you can redistribute it and/or modify it 6 * under the terms of the GNU General Public License version 2 only, as 7 * published by the Free Software Foundation. 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 #include "precompiled.hpp" 26 #include "classfile/classLoader.hpp" 27 #include "classfile/javaClasses.hpp" 28 #include "classfile/systemDictionary.hpp" 29 #include "classfile/vmSymbols.hpp" 30 #include "code/scopeDesc.hpp" 31 #include "compiler/compileBroker.hpp" 32 #include "interpreter/interpreter.hpp" 33 #include "interpreter/linkResolver.hpp" 34 #include "memory/oopFactory.hpp" 35 #include "memory/universe.inline.hpp" 36 #include "oops/instanceKlass.hpp" 37 #include "oops/objArrayOop.hpp" 38 #include "oops/oop.inline.hpp" 39 #include "oops/symbolOop.hpp" 40 #include "prims/jvm_misc.hpp" 41 #include "prims/jvmtiExport.hpp" 42 #include "prims/jvmtiThreadState.hpp" 43 #include "prims/privilegedStack.hpp" 44 #include "runtime/aprofiler.hpp" 45 #include "runtime/arguments.hpp" 46 #include "runtime/biasedLocking.hpp" 47 #include "runtime/deoptimization.hpp" 48 #include "runtime/fprofiler.hpp" 49 #include "runtime/frame.inline.hpp" 50 #include "runtime/hpi.hpp" 51 #include "runtime/init.hpp" 52 #include "runtime/interfaceSupport.hpp" 53 #include "runtime/java.hpp" 54 #include "runtime/javaCalls.hpp" 55 #include "runtime/jniPeriodicChecker.hpp" 56 #include "runtime/memprofiler.hpp" 57 #include "runtime/mutexLocker.hpp" 58 #include "runtime/objectMonitor.hpp" 59 #include "runtime/osThread.hpp" 60 #include "runtime/safepoint.hpp" 61 #include "runtime/sharedRuntime.hpp" 62 #include "runtime/statSampler.hpp" 63 #include "runtime/stubRoutines.hpp" 64 #include "runtime/task.hpp" 65 #include "runtime/threadCritical.hpp" 66 #include "runtime/threadLocalStorage.hpp" 67 #include "runtime/vframe.hpp" 68 #include "runtime/vframeArray.hpp" 69 #include "runtime/vframe_hp.hpp" 70 #include "runtime/vmThread.hpp" 71 #include "runtime/vm_operations.hpp" 72 #include "services/attachListener.hpp" 73 #include "services/management.hpp" 74 #include "services/threadService.hpp" 75 #include "utilities/defaultStream.hpp" 76 #include "utilities/dtrace.hpp" 77 #include "utilities/events.hpp" 78 #include "utilities/preserveException.hpp" 79 #ifdef TARGET_OS_FAMILY_linux 80 # include "os_linux.inline.hpp" 81 # include "thread_linux.inline.hpp" 82 #endif 83 #ifdef TARGET_OS_FAMILY_solaris 84 # include "os_solaris.inline.hpp" 85 # include "thread_solaris.inline.hpp" 86 #endif 87 #ifdef TARGET_OS_FAMILY_windows 88 # include "os_windows.inline.hpp" 89 # include "thread_windows.inline.hpp" 90 #endif 91 #ifndef SERIALGC 92 #include "gc_implementation/concurrentMarkSweep/concurrentMarkSweepThread.hpp" 93 #include "gc_implementation/g1/concurrentMarkThread.inline.hpp" 94 #include "gc_implementation/parallelScavenge/pcTasks.hpp" 95 #endif 96 #ifdef COMPILER1 97 #include "c1/c1_Compiler.hpp" 98 #endif 99 #ifdef COMPILER2 100 #include "opto/c2compiler.hpp" 101 #include "opto/idealGraphPrinter.hpp" 102 #endif 103 104 #ifdef DTRACE_ENABLED 105 106 // Only bother with this argument setup if dtrace is available 107 108 HS_DTRACE_PROBE_DECL(hotspot, vm__init__begin); 109 HS_DTRACE_PROBE_DECL(hotspot, vm__init__end); 110 HS_DTRACE_PROBE_DECL5(hotspot, thread__start, char*, intptr_t, 111 intptr_t, intptr_t, bool); 112 HS_DTRACE_PROBE_DECL5(hotspot, thread__stop, char*, intptr_t, 113 intptr_t, intptr_t, bool); 114 115 #define DTRACE_THREAD_PROBE(probe, javathread) \ 116 { \ 117 ResourceMark rm(this); \ 118 int len = 0; \ 119 const char* name = (javathread)->get_thread_name(); \ 120 len = strlen(name); \ 121 HS_DTRACE_PROBE5(hotspot, thread__##probe, \ 122 name, len, \ |