src/share/vm/utilities/dtrace.hpp

Tue, 12 Feb 2013 12:19:28 -0500

author
zgu
date
Tue, 12 Feb 2013 12:19:28 -0500
changeset 4573
5ee2b330eacd
parent 4148
75982791ddb6
child 6876
710a3c8b516e
permissions
-rw-r--r--

8007950: Undo hs_file permission change
Summary: Reverse hs_err file permission back to 0666, as early push was premature
Reviewed-by: dsamersoff, dcubed, acorn

duke@435 1 /*
coleenp@4148 2 * Copyright (c) 2005, 2012, Oracle and/or its affiliates. All rights reserved.
coleenp@4148 3 * Copyright (c) 2009, 2012 Red Hat, Inc.
duke@435 4 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
duke@435 5 *
duke@435 6 * This code is free software; you can redistribute it and/or modify it
duke@435 7 * under the terms of the GNU General Public License version 2 only, as
duke@435 8 * published by the Free Software Foundation.
duke@435 9 *
duke@435 10 * This code is distributed in the hope that it will be useful, but WITHOUT
duke@435 11 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
duke@435 12 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
duke@435 13 * version 2 for more details (a copy is included in the LICENSE file that
duke@435 14 * accompanied this code).
duke@435 15 *
duke@435 16 * You should have received a copy of the GNU General Public License version
duke@435 17 * 2 along with this work; if not, write to the Free Software Foundation,
duke@435 18 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
duke@435 19 *
trims@1907 20 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
trims@1907 21 * or visit www.oracle.com if you need additional information or have any
trims@1907 22 * questions.
duke@435 23 *
duke@435 24 */
duke@435 25
stefank@2314 26 #ifndef SHARE_VM_UTILITIES_DTRACE_HPP
stefank@2314 27 #define SHARE_VM_UTILITIES_DTRACE_HPP
stefank@2314 28
dcubed@3202 29 #if defined(DTRACE_ENABLED)
duke@435 30
duke@435 31 #include <sys/sdt.h>
duke@435 32
duke@435 33 #define DTRACE_ONLY(x) x
duke@435 34 #define NOT_DTRACE(x)
duke@435 35
coleenp@4148 36 #if defined(SOLARIS)
jcoomes@1902 37 // Work around dtrace tail call bug 6672627 until it is fixed in solaris 10.
jcoomes@1902 38 #define HS_DTRACE_WORKAROUND_TAIL_CALL_BUG() \
jcoomes@1902 39 do { volatile size_t dtrace_workaround_tail_call_bug = 1; } while (0)
jcoomes@1902 40
coleenp@4148 41 #define USDT1 1
coleenp@4148 42 #elif defined(LINUX)
coleenp@4148 43 #define HS_DTRACE_WORKAROUND_TAIL_CALL_BUG()
dcubed@3202 44 #define USDT1 1
dcubed@3202 45 #elif defined(__APPLE__)
coleenp@4148 46 #define HS_DTRACE_WORKAROUND_TAIL_CALL_BUG()
dcubed@3202 47 #define USDT2 1
dcubed@3202 48 #include <sys/types.h>
dcubed@3202 49 #include "dtracefiles/hotspot.h"
dcubed@3202 50 #include "dtracefiles/hotspot_jni.h"
dcubed@3202 51 #include "dtracefiles/hs_private.h"
dcubed@3202 52 #else
dcubed@3202 53 #error "dtrace enabled for unknown os"
dcubed@3202 54 #endif /* defined(SOLARIS) */
dcubed@3202 55
dcubed@3202 56 #else /* defined(DTRACE_ENABLED) */
duke@435 57
duke@435 58 #define DTRACE_ONLY(x)
duke@435 59 #define NOT_DTRACE(x) x
duke@435 60
dcubed@3202 61 #define HS_DTRACE_WORKAROUND_TAIL_CALL_BUG()
dcubed@3202 62
dcubed@3202 63 #ifndef USDT2
dcubed@3202 64
duke@435 65 #define DTRACE_PROBE(a,b) {;}
duke@435 66 #define DTRACE_PROBE1(a,b,c) {;}
duke@435 67 #define DTRACE_PROBE2(a,b,c,d) {;}
duke@435 68 #define DTRACE_PROBE3(a,b,c,d,e) {;}
duke@435 69 #define DTRACE_PROBE4(a,b,c,d,e,f) {;}
duke@435 70 #define DTRACE_PROBE5(a,b,c,d,e,f,g) {;}
coleenp@4148 71 #define DTRACE_PROBE6(a,b,c,d,e,f,g,h) {;}
coleenp@4148 72 #define DTRACE_PROBE7(a,b,c,d,e,f,g,h,i) {;}
coleenp@4148 73 #define DTRACE_PROBE8(a,b,c,d,e,f,g,h,i,j) {;}
coleenp@4148 74 #define DTRACE_PROBE9(a,b,c,d,e,f,g,h,i,j,k) {;}
coleenp@4148 75 #define DTRACE_PROBE10(a,b,c,d,e,f,g,h,i,j,k,l) {;}
duke@435 76
dcubed@3202 77 #else /* USDT2 */
jcoomes@1902 78
dcubed@3202 79 #include "dtrace_usdt2_disabled.hpp"
dcubed@3202 80 #endif /* USDT2 */
dcubed@3202 81
dcubed@3202 82 #endif /* defined(DTRACE_ENABLED) */
dcubed@3202 83
dcubed@3202 84 #ifndef USDT2
duke@435 85
duke@435 86 #define HS_DTRACE_PROBE_FN(provider,name)\
duke@435 87 __dtrace_##provider##___##name
duke@435 88
coleenp@4148 89 #ifdef SOLARIS
coleenp@4148 90 // Solaris dtrace needs actual extern function decls.
duke@435 91 #define HS_DTRACE_PROBE_DECL_N(provider,name,args) \
duke@435 92 DTRACE_ONLY(extern "C" void HS_DTRACE_PROBE_FN(provider,name) args)
duke@435 93 #define HS_DTRACE_PROBE_CDECL_N(provider,name,args) \
duke@435 94 DTRACE_ONLY(extern void HS_DTRACE_PROBE_FN(provider,name) args)
coleenp@4148 95 #else
coleenp@4148 96 // Systemtap dtrace compatible probes on GNU/Linux don't.
coleenp@4148 97 // If dtrace is disabled this macro becomes NULL
coleenp@4148 98 #define HS_DTRACE_PROBE_DECL_N(provider,name,args)
coleenp@4148 99 #define HS_DTRACE_PROBE_CDECL_N(provider,name,args)
coleenp@4148 100 #endif
duke@435 101
duke@435 102 /* Dtrace probe declarations */
duke@435 103 #define HS_DTRACE_PROBE_DECL(provider,name) \
duke@435 104 HS_DTRACE_PROBE_DECL0(provider,name)
duke@435 105 #define HS_DTRACE_PROBE_DECL0(provider,name)\
duke@435 106 HS_DTRACE_PROBE_DECL_N(provider,name,(void))
duke@435 107 #define HS_DTRACE_PROBE_DECL1(provider,name,t0)\
duke@435 108 HS_DTRACE_PROBE_DECL_N(provider,name,(uintptr_t))
duke@435 109 #define HS_DTRACE_PROBE_DECL2(provider,name,t0,t1)\
duke@435 110 HS_DTRACE_PROBE_DECL_N(provider,name,(uintptr_t,uintptr_t))
duke@435 111 #define HS_DTRACE_PROBE_DECL3(provider,name,t0,t1,t2)\
duke@435 112 HS_DTRACE_PROBE_DECL_N(provider,name,(uintptr_t,uintptr_t,uintptr_t))
duke@435 113 #define HS_DTRACE_PROBE_DECL4(provider,name,t0,t1,t2,t3)\
duke@435 114 HS_DTRACE_PROBE_DECL_N(provider,name,(uintptr_t,uintptr_t,uintptr_t,\
duke@435 115 uintptr_t))
duke@435 116 #define HS_DTRACE_PROBE_DECL5(provider,name,t0,t1,t2,t3,t4)\
duke@435 117 HS_DTRACE_PROBE_DECL_N(provider,name,(\
duke@435 118 uintptr_t,uintptr_t,uintptr_t,uintptr_t,uintptr_t))
duke@435 119 #define HS_DTRACE_PROBE_DECL6(provider,name,t0,t1,t2,t3,t4,t5)\
duke@435 120 HS_DTRACE_PROBE_DECL_N(provider,name,(\
duke@435 121 uintptr_t,uintptr_t,uintptr_t,uintptr_t,uintptr_t,uintptr_t))
duke@435 122 #define HS_DTRACE_PROBE_DECL7(provider,name,t0,t1,t2,t3,t4,t5,t6)\
duke@435 123 HS_DTRACE_PROBE_DECL_N(provider,name,(\
duke@435 124 uintptr_t,uintptr_t,uintptr_t,uintptr_t,uintptr_t,uintptr_t,uintptr_t))
duke@435 125 #define HS_DTRACE_PROBE_DECL8(provider,name,t0,t1,t2,t3,t4,t5,t6,t7)\
duke@435 126 HS_DTRACE_PROBE_DECL_N(provider,name,(\
duke@435 127 uintptr_t,uintptr_t,uintptr_t,uintptr_t,uintptr_t,uintptr_t,uintptr_t,\
duke@435 128 uintptr_t))
duke@435 129 #define HS_DTRACE_PROBE_DECL9(provider,name,t0,t1,t2,t3,t4,t5,t6,t7,t8)\
duke@435 130 HS_DTRACE_PROBE_DECL_N(provider,name,(\
duke@435 131 uintptr_t,uintptr_t,uintptr_t,uintptr_t,uintptr_t,uintptr_t,uintptr_t,\
duke@435 132 uintptr_t,uintptr_t))
duke@435 133 #define HS_DTRACE_PROBE_DECL10(provider,name,t0,t1,t2,t3,t4,t5,t6,t7,t8,t9)\
duke@435 134 HS_DTRACE_PROBE_DECL_N(provider,name,(\
duke@435 135 uintptr_t,uintptr_t,uintptr_t,uintptr_t,uintptr_t,uintptr_t,uintptr_t,\
duke@435 136 uintptr_t,uintptr_t,uintptr_t))
duke@435 137
duke@435 138 /* Dtrace probe definitions */
coleenp@4148 139 #if defined(SOLARIS)
coleenp@4148 140 // Solaris dtrace uses actual function calls.
duke@435 141 #define HS_DTRACE_PROBE_N(provider,name, args) \
duke@435 142 DTRACE_ONLY(HS_DTRACE_PROBE_FN(provider,name) args)
duke@435 143
duke@435 144 #define HS_DTRACE_PROBE(provider,name) HS_DTRACE_PROBE0(provider,name)
duke@435 145 #define HS_DTRACE_PROBE0(provider,name)\
duke@435 146 HS_DTRACE_PROBE_N(provider,name,())
duke@435 147 #define HS_DTRACE_PROBE1(provider,name,a0)\
duke@435 148 HS_DTRACE_PROBE_N(provider,name,((uintptr_t)a0))
duke@435 149 #define HS_DTRACE_PROBE2(provider,name,a0,a1)\
duke@435 150 HS_DTRACE_PROBE_N(provider,name,((uintptr_t)a0,(uintptr_t)a1))
duke@435 151 #define HS_DTRACE_PROBE3(provider,name,a0,a1,a2)\
duke@435 152 HS_DTRACE_PROBE_N(provider,name,((uintptr_t)a0,(uintptr_t)a1,(uintptr_t)a2))
duke@435 153 #define HS_DTRACE_PROBE4(provider,name,a0,a1,a2,a3)\
duke@435 154 HS_DTRACE_PROBE_N(provider,name,((uintptr_t)a0,(uintptr_t)a1,(uintptr_t)a2,\
duke@435 155 (uintptr_t)a3))
duke@435 156 #define HS_DTRACE_PROBE5(provider,name,a0,a1,a2,a3,a4)\
duke@435 157 HS_DTRACE_PROBE_N(provider,name,((uintptr_t)a0,(uintptr_t)a1,(uintptr_t)a2,\
duke@435 158 (uintptr_t)a3,(uintptr_t)a4))
duke@435 159 #define HS_DTRACE_PROBE6(provider,name,a0,a1,a2,a3,a4,a5)\
duke@435 160 HS_DTRACE_PROBE_N(provider,name,((uintptr_t)a0,(uintptr_t)a1,(uintptr_t)a2,\
duke@435 161 (uintptr_t)a3,(uintptr_t)a4,(uintptr_t)a5))
duke@435 162 #define HS_DTRACE_PROBE7(provider,name,a0,a1,a2,a3,a4,a5,a6)\
duke@435 163 HS_DTRACE_PROBE_N(provider,name,((uintptr_t)a0,(uintptr_t)a1,(uintptr_t)a2,\
duke@435 164 (uintptr_t)a3,(uintptr_t)a4,(uintptr_t)a5,(uintptr_t)a6))
duke@435 165 #define HS_DTRACE_PROBE8(provider,name,a0,a1,a2,a3,a4,a5,a6,a7)\
duke@435 166 HS_DTRACE_PROBE_N(provider,name,((uintptr_t)a0,(uintptr_t)a1,(uintptr_t)a2,\
duke@435 167 (uintptr_t)a3,(uintptr_t)a4,(uintptr_t)a5,(uintptr_t)a6,(uintptr_t)a7))
duke@435 168 #define HS_DTRACE_PROBE9(provider,name,a0,a1,a2,a3,a4,a5,a6,a7,a8)\
duke@435 169 HS_DTRACE_PROBE_N(provider,name,((uintptr_t)a0,(uintptr_t)a1,(uintptr_t)a2,\
duke@435 170 (uintptr_t)a3,(uintptr_t)a4,(uintptr_t)a5,(uintptr_t)a6,(uintptr_t)a7,\
duke@435 171 (uintptr_t)a8))
duke@435 172 #define HS_DTRACE_PROBE10(provider,name,a0,a1,a2,a3,a4,a5,a6,a7,a8,a9)\
duke@435 173 HS_DTRACE_PROBE_N(provider,name,((uintptr_t)a0,(uintptr_t)a1,(uintptr_t)a2,\
duke@435 174 (uintptr_t)a3,(uintptr_t)a4,(uintptr_t)a5,(uintptr_t)a6,(uintptr_t)a7,\
duke@435 175 (uintptr_t)a8,(uintptr_t)a9))
coleenp@4148 176 #else
coleenp@4148 177 // Systemtap dtrace compatible probes on GNU/Linux use direct macros.
coleenp@4148 178 // If dtrace is disabled this macro becomes NULL
coleenp@4148 179 #define HS_DTRACE_PROBE(provider,name) HS_DTRACE_PROBE0(provider,name)
coleenp@4148 180 #define HS_DTRACE_PROBE0(provider,name)\
coleenp@4148 181 DTRACE_PROBE(provider,name)
coleenp@4148 182 #define HS_DTRACE_PROBE1(provider,name,a0)\
coleenp@4148 183 DTRACE_PROBE1(provider,name,a0)
coleenp@4148 184 #define HS_DTRACE_PROBE2(provider,name,a0,a1)\
coleenp@4148 185 DTRACE_PROBE2(provider,name,a0,a1)
coleenp@4148 186 #define HS_DTRACE_PROBE3(provider,name,a0,a1,a2)\
coleenp@4148 187 DTRACE_PROBE3(provider,name,a0,a1,a2)
coleenp@4148 188 #define HS_DTRACE_PROBE4(provider,name,a0,a1,a2,a3)\
coleenp@4148 189 DTRACE_PROBE4(provider,name,a0,a1,a2,a3)
coleenp@4148 190 #define HS_DTRACE_PROBE5(provider,name,a0,a1,a2,a3,a4)\
coleenp@4148 191 DTRACE_PROBE5(provider,name,a0,a1,a2,a3,a4)
coleenp@4148 192 #define HS_DTRACE_PROBE6(provider,name,a0,a1,a2,a3,a4,a5)\
coleenp@4148 193 DTRACE_PROBE6(provider,name,a0,a1,a2,a3,a4,a5)
coleenp@4148 194 #define HS_DTRACE_PROBE7(provider,name,a0,a1,a2,a3,a4,a5,a6)\
coleenp@4148 195 DTRACE_PROBE7(provider,name,a0,a1,a2,a3,a4,a5,a6)
coleenp@4148 196 #define HS_DTRACE_PROBE8(provider,name,a0,a1,a2,a3,a4,a5,a6,a7)\
coleenp@4148 197 DTRACE_PROBE8(provider,name,a0,a1,a2,a3,a4,a5,a6,a7)
coleenp@4148 198 #define HS_DTRACE_PROBE9(provider,name,a0,a1,a2,a3,a4,a5,a6,a7,a8)\
coleenp@4148 199 DTRACE_PROBE9(provider,name,a0,a1,a2,a3,a4,a5,a6,a7,a8)
coleenp@4148 200 #define HS_DTRACE_PROBE10(provider,name,a0,a1,a2,a3,a4,a5,a6,a7,a8,a9)\
coleenp@4148 201 DTRACE_PROBE10(provider,name,a0,a1,a2,a3,a4,a5,a6,a7,a8,a9)
coleenp@4148 202 #endif
stefank@2314 203
dcubed@3202 204 #endif /* !USDT2 */
dcubed@3202 205
stefank@2314 206 #endif // SHARE_VM_UTILITIES_DTRACE_HPP

mercurial