annotate agent/doc/index.html @ 6972:bd7a7ce2e264

6830717: replay of compilations would help with debugging Summary: When java process crashed in compiler thread, repeat the compilation process will help finding root cause. This is done with using SA dump application class data and replay data from core dump, then use debug version of jvm to recompile the problematic java method. Reviewed-by: kvn, twisti, sspitsyn Contributed-by: yumin.qi@oracle.com
author minqi
date Mon, 12 Nov 2012 14:03:53 -0800
parents a61af66fc99e
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
a61af66fc99e Initial load
duke
parents:
diff changeset
1 <html>
a61af66fc99e Initial load
duke
parents:
diff changeset
2 <head>
a61af66fc99e Initial load
duke
parents:
diff changeset
3 <title>
a61af66fc99e Initial load
duke
parents:
diff changeset
4 Using HotSpot Serviceability Agent (SA)
a61af66fc99e Initial load
duke
parents:
diff changeset
5 </title>
a61af66fc99e Initial load
duke
parents:
diff changeset
6 </head>
a61af66fc99e Initial load
duke
parents:
diff changeset
7 <body>
a61af66fc99e Initial load
duke
parents:
diff changeset
8 <h1>Using HotSpot Serviceability Agent (SA)</h1>
a61af66fc99e Initial load
duke
parents:
diff changeset
9
a61af66fc99e Initial load
duke
parents:
diff changeset
10 <h3>HSDB GUI</h3>
a61af66fc99e Initial load
duke
parents:
diff changeset
11 <p>
a61af66fc99e Initial load
duke
parents:
diff changeset
12 The top-level GUI program using the HotSpot Serviceability Agent APIs is
a61af66fc99e Initial load
duke
parents:
diff changeset
13 called <b>HSDB</b>, the "HotSpot Debugger". To run it, type "hsdbproc.sh"
a61af66fc99e Initial load
duke
parents:
diff changeset
14 or "hsdbwindbg.bat" or 64-bit variants (on Unix, Windows platforms
a61af66fc99e Initial load
duke
parents:
diff changeset
15 respectively). More info. on HSDB GUI are in <a href="hsdb.html">hsdb.html</a>.
a61af66fc99e Initial load
duke
parents:
diff changeset
16 </p>
a61af66fc99e Initial load
duke
parents:
diff changeset
17
a61af66fc99e Initial load
duke
parents:
diff changeset
18 <h3>SA Modes</h3>
a61af66fc99e Initial load
duke
parents:
diff changeset
19 <p>
a61af66fc99e Initial load
duke
parents:
diff changeset
20 There are three modes for the SA debugger:
a61af66fc99e Initial load
duke
parents:
diff changeset
21 <ul>
a61af66fc99e Initial load
duke
parents:
diff changeset
22 <li>attaching to a local process,
a61af66fc99e Initial load
duke
parents:
diff changeset
23 <li>opening a core file, and
a61af66fc99e Initial load
duke
parents:
diff changeset
24 <li>attaching to a remote "debug server".
a61af66fc99e Initial load
duke
parents:
diff changeset
25 </ul>
a61af66fc99e Initial load
duke
parents:
diff changeset
26 <p>
a61af66fc99e Initial load
duke
parents:
diff changeset
27 The remote case requires two programs to be running on the remote machine:
a61af66fc99e Initial load
duke
parents:
diff changeset
28 the rmiregistry (see the script "start-rmiregistry.sh" in this directory;
a61af66fc99e Initial load
duke
parents:
diff changeset
29 run this in the background) and the debug server (see the script
a61af66fc99e Initial load
duke
parents:
diff changeset
30 "start-debug-server-proc.sh"), in that order. start-rmiregistry.sh takes no
a61af66fc99e Initial load
duke
parents:
diff changeset
31 arguments; start-debug-server-proc.sh (or -windbg.bat) takes as argument
a61af66fc99e Initial load
duke
parents:
diff changeset
32 the process ID or the executable and core file names to allow remote debugging
a61af66fc99e Initial load
duke
parents:
diff changeset
33 of.
a61af66fc99e Initial load
duke
parents:
diff changeset
34 </p>
a61af66fc99e Initial load
duke
parents:
diff changeset
35
a61af66fc99e Initial load
duke
parents:
diff changeset
36 <h3>Command line HSDB</h3>
a61af66fc99e Initial load
duke
parents:
diff changeset
37 <p>
a61af66fc99e Initial load
duke
parents:
diff changeset
38 There are also command line HSDB variants ("clhsdbproc.sh" or "clhsdbwindbg.bat"
a61af66fc99e Initial load
duke
parents:
diff changeset
39 or 64-bit variants). There is also a JavaScript based command line interface
a61af66fc99e Initial load
duke
parents:
diff changeset
40 called "jsdbproc.sh" [or "jsdbwindbg.bat" or 64-bit variants]. More details on
a61af66fc99e Initial load
duke
parents:
diff changeset
41 command line interfaces can be found in
a61af66fc99e Initial load
duke
parents:
diff changeset
42 <ul>
a61af66fc99e Initial load
duke
parents:
diff changeset
43 <li><a href="clhsdb.html">clhsdb.html</a>
a61af66fc99e Initial load
duke
parents:
diff changeset
44 <li><a href="jsdb.html">jsdb.html</a>
a61af66fc99e Initial load
duke
parents:
diff changeset
45 </ul>
a61af66fc99e Initial load
duke
parents:
diff changeset
46 </p>
a61af66fc99e Initial load
duke
parents:
diff changeset
47
a61af66fc99e Initial load
duke
parents:
diff changeset
48 <h3>Other command line tools</h3>
a61af66fc99e Initial load
duke
parents:
diff changeset
49 <p>
a61af66fc99e Initial load
duke
parents:
diff changeset
50 The following table lists all SA command line tools. &lt;xxx&gt;windbg.bat
a61af66fc99e Initial load
duke
parents:
diff changeset
51 files are for Windows. .sh files are for Solaris. &lt;xxx&gt;64.sh are for
a61af66fc99e Initial load
duke
parents:
diff changeset
52 64 bit debugees.
a61af66fc99e Initial load
duke
parents:
diff changeset
53 </p>
a61af66fc99e Initial load
duke
parents:
diff changeset
54
a61af66fc99e Initial load
duke
parents:
diff changeset
55 <table border="1">
a61af66fc99e Initial load
duke
parents:
diff changeset
56 <tr>
a61af66fc99e Initial load
duke
parents:
diff changeset
57 <th>
a61af66fc99e Initial load
duke
parents:
diff changeset
58 Tool
a61af66fc99e Initial load
duke
parents:
diff changeset
59 </th>
a61af66fc99e Initial load
duke
parents:
diff changeset
60 <th>
a61af66fc99e Initial load
duke
parents:
diff changeset
61 Description
a61af66fc99e Initial load
duke
parents:
diff changeset
62 </th>
a61af66fc99e Initial load
duke
parents:
diff changeset
63 </tr>
a61af66fc99e Initial load
duke
parents:
diff changeset
64
a61af66fc99e Initial load
duke
parents:
diff changeset
65 <tr>
a61af66fc99e Initial load
duke
parents:
diff changeset
66 <td>
a61af66fc99e Initial load
duke
parents:
diff changeset
67 dumpflagsproc.sh,
a61af66fc99e Initial load
duke
parents:
diff changeset
68 dumpflagsproc64.sh,
a61af66fc99e Initial load
duke
parents:
diff changeset
69 dumpflagswindbg.bat
a61af66fc99e Initial load
duke
parents:
diff changeset
70 dumpflagswindbg64.bat
a61af66fc99e Initial load
duke
parents:
diff changeset
71 </td>
a61af66fc99e Initial load
duke
parents:
diff changeset
72 <td>
a61af66fc99e Initial load
duke
parents:
diff changeset
73 dumps name and value of all -XX JVM command line arguments passed
a61af66fc99e Initial load
duke
parents:
diff changeset
74 to debuggee.
a61af66fc99e Initial load
duke
parents:
diff changeset
75 </td>
a61af66fc99e Initial load
duke
parents:
diff changeset
76 </tr>
a61af66fc99e Initial load
duke
parents:
diff changeset
77
a61af66fc99e Initial load
duke
parents:
diff changeset
78 <tr>
a61af66fc99e Initial load
duke
parents:
diff changeset
79 <td>
a61af66fc99e Initial load
duke
parents:
diff changeset
80 <a name="dumpsysprops"></a>
a61af66fc99e Initial load
duke
parents:
diff changeset
81 dumpsyspropsproc.sh,
a61af66fc99e Initial load
duke
parents:
diff changeset
82 dumpsyspropsproc64.sh,
a61af66fc99e Initial load
duke
parents:
diff changeset
83 dumpsyspropswindbg.bat
a61af66fc99e Initial load
duke
parents:
diff changeset
84 dumpsyspropswindbg64.bat
a61af66fc99e Initial load
duke
parents:
diff changeset
85 </td>
a61af66fc99e Initial load
duke
parents:
diff changeset
86 <td>
a61af66fc99e Initial load
duke
parents:
diff changeset
87 This prints name and value of Java level System properties.
a61af66fc99e Initial load
duke
parents:
diff changeset
88 </td>
a61af66fc99e Initial load
duke
parents:
diff changeset
89 </tr>
a61af66fc99e Initial load
duke
parents:
diff changeset
90
a61af66fc99e Initial load
duke
parents:
diff changeset
91 <tr>
a61af66fc99e Initial load
duke
parents:
diff changeset
92 <td>
a61af66fc99e Initial load
duke
parents:
diff changeset
93 <a name="heapdump"></a>
a61af66fc99e Initial load
duke
parents:
diff changeset
94 heapdumpproc.sh,
a61af66fc99e Initial load
duke
parents:
diff changeset
95 heapdumpproc64.sh,
a61af66fc99e Initial load
duke
parents:
diff changeset
96 heapdumpwindbg.bat
a61af66fc99e Initial load
duke
parents:
diff changeset
97 heapdumpwindbg64.bat
a61af66fc99e Initial load
duke
parents:
diff changeset
98 </td>
a61af66fc99e Initial load
duke
parents:
diff changeset
99 <td>
a61af66fc99e Initial load
duke
parents:
diff changeset
100 Dumps heap in a file in hprof binary format.
a61af66fc99e Initial load
duke
parents:
diff changeset
101 </td>
a61af66fc99e Initial load
duke
parents:
diff changeset
102 </tr>
a61af66fc99e Initial load
duke
parents:
diff changeset
103
a61af66fc99e Initial load
duke
parents:
diff changeset
104 <tr>
a61af66fc99e Initial load
duke
parents:
diff changeset
105 <td>
a61af66fc99e Initial load
duke
parents:
diff changeset
106 <a name="heapsum"></a>
a61af66fc99e Initial load
duke
parents:
diff changeset
107 heapsumproc.sh,
a61af66fc99e Initial load
duke
parents:
diff changeset
108 heapsumproc64.sh,
a61af66fc99e Initial load
duke
parents:
diff changeset
109 heapsumwindbg.bat
a61af66fc99e Initial load
duke
parents:
diff changeset
110 heapsumwindbg64.bat
a61af66fc99e Initial load
duke
parents:
diff changeset
111 </td>
a61af66fc99e Initial load
duke
parents:
diff changeset
112 <td>
a61af66fc99e Initial load
duke
parents:
diff changeset
113 Prints summary information on Java heap.
a61af66fc99e Initial load
duke
parents:
diff changeset
114 </td>
a61af66fc99e Initial load
duke
parents:
diff changeset
115 </tr>
a61af66fc99e Initial load
duke
parents:
diff changeset
116
a61af66fc99e Initial load
duke
parents:
diff changeset
117
a61af66fc99e Initial load
duke
parents:
diff changeset
118 <tr>
a61af66fc99e Initial load
duke
parents:
diff changeset
119 <td>
a61af66fc99e Initial load
duke
parents:
diff changeset
120 jcoreproc.sh,
a61af66fc99e Initial load
duke
parents:
diff changeset
121 jcoreproc64.sh,
a61af66fc99e Initial load
duke
parents:
diff changeset
122 jcorewindbg.bat
a61af66fc99e Initial load
duke
parents:
diff changeset
123 jcorewindbg64.bat
a61af66fc99e Initial load
duke
parents:
diff changeset
124 </td>
a61af66fc99e Initial load
duke
parents:
diff changeset
125 <td>
a61af66fc99e Initial load
duke
parents:
diff changeset
126 This can retrieve .class files from the debuggee.
a61af66fc99e Initial load
duke
parents:
diff changeset
127 set the environment variable <b>JCORE_PACKAGES</b> to comman separated list of
a61af66fc99e Initial load
duke
parents:
diff changeset
128 packages whose classes have to be retrieved from the core file.
a61af66fc99e Initial load
duke
parents:
diff changeset
129 </td>
a61af66fc99e Initial load
duke
parents:
diff changeset
130 </tr>
a61af66fc99e Initial load
duke
parents:
diff changeset
131
a61af66fc99e Initial load
duke
parents:
diff changeset
132 <tr>
a61af66fc99e Initial load
duke
parents:
diff changeset
133 <tr>
a61af66fc99e Initial load
duke
parents:
diff changeset
134 <td>
a61af66fc99e Initial load
duke
parents:
diff changeset
135 jstackproc.sh,
a61af66fc99e Initial load
duke
parents:
diff changeset
136 jstackproc64.sh,
a61af66fc99e Initial load
duke
parents:
diff changeset
137 jstackwindbg.bat
a61af66fc99e Initial load
duke
parents:
diff changeset
138 jstackwindbg64.bat
a61af66fc99e Initial load
duke
parents:
diff changeset
139 </td>
a61af66fc99e Initial load
duke
parents:
diff changeset
140 <td>
a61af66fc99e Initial load
duke
parents:
diff changeset
141 used to get java stack trace for all java threads.
a61af66fc99e Initial load
duke
parents:
diff changeset
142 </td>
a61af66fc99e Initial load
duke
parents:
diff changeset
143 </tr>
a61af66fc99e Initial load
duke
parents:
diff changeset
144
a61af66fc99e Initial load
duke
parents:
diff changeset
145 <tr>
a61af66fc99e Initial load
duke
parents:
diff changeset
146 <td>
a61af66fc99e Initial load
duke
parents:
diff changeset
147 jhistoproc.sh,
a61af66fc99e Initial load
duke
parents:
diff changeset
148 jhistoproc64.sh,
a61af66fc99e Initial load
duke
parents:
diff changeset
149 jhistowindbg.bat
a61af66fc99e Initial load
duke
parents:
diff changeset
150 jhistowindbg64.bat
a61af66fc99e Initial load
duke
parents:
diff changeset
151 </td>
a61af66fc99e Initial load
duke
parents:
diff changeset
152 <td>
a61af66fc99e Initial load
duke
parents:
diff changeset
153 used to get object histogram of java heap.
a61af66fc99e Initial load
duke
parents:
diff changeset
154 </td>
a61af66fc99e Initial load
duke
parents:
diff changeset
155 </tr>
a61af66fc99e Initial load
duke
parents:
diff changeset
156
a61af66fc99e Initial load
duke
parents:
diff changeset
157 <tr>
a61af66fc99e Initial load
duke
parents:
diff changeset
158 <td>
a61af66fc99e Initial load
duke
parents:
diff changeset
159 permstatproc.sh,
a61af66fc99e Initial load
duke
parents:
diff changeset
160 permstatproc64.sh,
a61af66fc99e Initial load
duke
parents:
diff changeset
161 permstatwindbg.bat
a61af66fc99e Initial load
duke
parents:
diff changeset
162 permstatwindbg64.bat
a61af66fc99e Initial load
duke
parents:
diff changeset
163 </td>
a61af66fc99e Initial load
duke
parents:
diff changeset
164 <td>
a61af66fc99e Initial load
duke
parents:
diff changeset
165 To gather statistics on perm. generation.
a61af66fc99e Initial load
duke
parents:
diff changeset
166 </td>
a61af66fc99e Initial load
duke
parents:
diff changeset
167 </tr>
a61af66fc99e Initial load
duke
parents:
diff changeset
168
a61af66fc99e Initial load
duke
parents:
diff changeset
169 <a name="mixed_pstack"></a>
a61af66fc99e Initial load
duke
parents:
diff changeset
170 <tr>
a61af66fc99e Initial load
duke
parents:
diff changeset
171 <tr>
a61af66fc99e Initial load
duke
parents:
diff changeset
172 <td>
a61af66fc99e Initial load
duke
parents:
diff changeset
173 pstackproc.sh,
a61af66fc99e Initial load
duke
parents:
diff changeset
174 pstackproc64.sh,
a61af66fc99e Initial load
duke
parents:
diff changeset
175 pstackwindbg.bat
a61af66fc99e Initial load
duke
parents:
diff changeset
176 pstackwindbg64.bat
a61af66fc99e Initial load
duke
parents:
diff changeset
177 </td>
a61af66fc99e Initial load
duke
parents:
diff changeset
178 <td>
a61af66fc99e Initial load
duke
parents:
diff changeset
179 This is cross platform mixed mode pstack utility. This works on any (non-java as well) process, core dump. For java process and core dumps, this prints both java and C/C++ frames.
a61af66fc99e Initial load
duke
parents:
diff changeset
180 </td>
a61af66fc99e Initial load
duke
parents:
diff changeset
181 </tr>
a61af66fc99e Initial load
duke
parents:
diff changeset
182
a61af66fc99e Initial load
duke
parents:
diff changeset
183 <tr>
a61af66fc99e Initial load
duke
parents:
diff changeset
184 <td>
a61af66fc99e Initial load
duke
parents:
diff changeset
185 pmapproc.sh,
a61af66fc99e Initial load
duke
parents:
diff changeset
186 pmapproc64.sh,
a61af66fc99e Initial load
duke
parents:
diff changeset
187 pmapwindbg.bat
a61af66fc99e Initial load
duke
parents:
diff changeset
188 pmapwindbg64.bat
a61af66fc99e Initial load
duke
parents:
diff changeset
189 </td>
a61af66fc99e Initial load
duke
parents:
diff changeset
190 <td>
a61af66fc99e Initial load
duke
parents:
diff changeset
191 This is cross platform Solaris pmap-like utility.
a61af66fc99e Initial load
duke
parents:
diff changeset
192 </td>
a61af66fc99e Initial load
duke
parents:
diff changeset
193 </tr>
a61af66fc99e Initial load
duke
parents:
diff changeset
194
a61af66fc99e Initial load
duke
parents:
diff changeset
195 <tr>
a61af66fc99e Initial load
duke
parents:
diff changeset
196 <td>
a61af66fc99e Initial load
duke
parents:
diff changeset
197 soqlproc.sh,
a61af66fc99e Initial load
duke
parents:
diff changeset
198 soqlproc64.sh,
a61af66fc99e Initial load
duke
parents:
diff changeset
199 soqlwindbg.bat
a61af66fc99e Initial load
duke
parents:
diff changeset
200 soqlwindbg64.bat
a61af66fc99e Initial load
duke
parents:
diff changeset
201 </td>
a61af66fc99e Initial load
duke
parents:
diff changeset
202 <td>
a61af66fc99e Initial load
duke
parents:
diff changeset
203 This is command line SOQL - Simple Object Query Language tool.
a61af66fc99e Initial load
duke
parents:
diff changeset
204 SOQL is SQL-like query language to query Java heap.
a61af66fc99e Initial load
duke
parents:
diff changeset
205 </td>
a61af66fc99e Initial load
duke
parents:
diff changeset
206 <tr>
a61af66fc99e Initial load
duke
parents:
diff changeset
207 <td>
a61af66fc99e Initial load
duke
parents:
diff changeset
208 start-debug-server-proc.sh,
a61af66fc99e Initial load
duke
parents:
diff changeset
209 start-debug-server-proc64.sh,
a61af66fc99e Initial load
duke
parents:
diff changeset
210 start-debug-server-windbg.bat,
a61af66fc99e Initial load
duke
parents:
diff changeset
211 start-debug-server-windbg64.bat,
a61af66fc99e Initial load
duke
parents:
diff changeset
212 start-rmiregistry.bat,
a61af66fc99e Initial load
duke
parents:
diff changeset
213 start-rmiregistry64.bat,
a61af66fc99e Initial load
duke
parents:
diff changeset
214 start-rmiregistry.sh
a61af66fc99e Initial load
duke
parents:
diff changeset
215 start-rmiregistry64.sh
a61af66fc99e Initial load
duke
parents:
diff changeset
216 </td>
a61af66fc99e Initial load
duke
parents:
diff changeset
217 <td>
a61af66fc99e Initial load
duke
parents:
diff changeset
218 These scripts are used to run SA remotely.
a61af66fc99e Initial load
duke
parents:
diff changeset
219 </td>
a61af66fc99e Initial load
duke
parents:
diff changeset
220 </tr>
a61af66fc99e Initial load
duke
parents:
diff changeset
221 </table>
a61af66fc99e Initial load
duke
parents:
diff changeset
222
6972
bd7a7ce2e264 6830717: replay of compilations would help with debugging
minqi
parents: 0
diff changeset
223 <h3>C2 Compilation Replay</h3>
bd7a7ce2e264 6830717: replay of compilations would help with debugging
minqi
parents: 0
diff changeset
224 <p>
bd7a7ce2e264 6830717: replay of compilations would help with debugging
minqi
parents: 0
diff changeset
225 When a java process crashes in compiled method, usually a core file is saved.
bd7a7ce2e264 6830717: replay of compilations would help with debugging
minqi
parents: 0
diff changeset
226 The C2 replay function can reproduce the compiling process in the core.
bd7a7ce2e264 6830717: replay of compilations would help with debugging
minqi
parents: 0
diff changeset
227 <a href="c2replay.html">c2replay.html</a>
bd7a7ce2e264 6830717: replay of compilations would help with debugging
minqi
parents: 0
diff changeset
228
0
a61af66fc99e Initial load
duke
parents:
diff changeset
229 <h3>Debugging transported core dumps</h3>
a61af66fc99e Initial load
duke
parents:
diff changeset
230 <p>
a61af66fc99e Initial load
duke
parents:
diff changeset
231 When a core dump is moved from the machine where it was produced to a
a61af66fc99e Initial load
duke
parents:
diff changeset
232 difference machine, it may not always be possible for SA to debug the same.
a61af66fc99e Initial load
duke
parents:
diff changeset
233 More info. on debugging on transported core dumps is in
a61af66fc99e Initial load
duke
parents:
diff changeset
234 <a href="transported_core.html">transported_core.html</a>.
a61af66fc99e Initial load
duke
parents:
diff changeset
235 </p>
a61af66fc99e Initial load
duke
parents:
diff changeset
236
a61af66fc99e Initial load
duke
parents:
diff changeset
237 <h3>SA Bugs</h3>
a61af66fc99e Initial load
duke
parents:
diff changeset
238 <p>
a61af66fc99e Initial load
duke
parents:
diff changeset
239 Not all of the possible states of target VMs have been tested (or
a61af66fc99e Initial load
duke
parents:
diff changeset
240 supportable) with SA. For example, the SA will probably not work at all
a61af66fc99e Initial load
duke
parents:
diff changeset
241 if it freezes the target VM during certain phases of GC. When filing bugs
a61af66fc99e Initial load
duke
parents:
diff changeset
242 a pointer to a core file (see gcore(1)) which the SA can not handle well
a61af66fc99e Initial load
duke
parents:
diff changeset
243 is best.
a61af66fc99e Initial load
duke
parents:
diff changeset
244 </p>
a61af66fc99e Initial load
duke
parents:
diff changeset
245
a61af66fc99e Initial load
duke
parents:
diff changeset
246 </body>
a61af66fc99e Initial load
duke
parents:
diff changeset
247 </html>