author | weijun |
Tue, 29 Oct 2019 09:34:21 +0800 | |
changeset 58830 | fa0b9f9c597a |
parent 47216 | 71c04702a3d5 |
permissions | -rw-r--r-- |
14477
95e66ea71f71
6830717: replay of compilations would help with debugging
minqi
parents:
diff
changeset
|
1 |
<html> |
95e66ea71f71
6830717: replay of compilations would help with debugging
minqi
parents:
diff
changeset
|
2 |
<head> |
95e66ea71f71
6830717: replay of compilations would help with debugging
minqi
parents:
diff
changeset
|
3 |
<title> |
17123
a8e62eed2e3e
8011675: adding compilation level to replay data
iignatyev
parents:
14477
diff
changeset
|
4 |
Replay |
14477
95e66ea71f71
6830717: replay of compilations would help with debugging
minqi
parents:
diff
changeset
|
5 |
</title> |
95e66ea71f71
6830717: replay of compilations would help with debugging
minqi
parents:
diff
changeset
|
6 |
</head> |
95e66ea71f71
6830717: replay of compilations would help with debugging
minqi
parents:
diff
changeset
|
7 |
<body> |
95e66ea71f71
6830717: replay of compilations would help with debugging
minqi
parents:
diff
changeset
|
8 |
|
17123
a8e62eed2e3e
8011675: adding compilation level to replay data
iignatyev
parents:
14477
diff
changeset
|
9 |
<h1>Compiler replay</h1> |
14477
95e66ea71f71
6830717: replay of compilations would help with debugging
minqi
parents:
diff
changeset
|
10 |
<p> |
17123
a8e62eed2e3e
8011675: adding compilation level to replay data
iignatyev
parents:
14477
diff
changeset
|
11 |
The compiler replay is a function to repeat the compiling process from a crashed java process in compiled method<br> |
14477
95e66ea71f71
6830717: replay of compilations would help with debugging
minqi
parents:
diff
changeset
|
12 |
This function only exists in debug version of VM |
95e66ea71f71
6830717: replay of compilations would help with debugging
minqi
parents:
diff
changeset
|
13 |
</p> |
95e66ea71f71
6830717: replay of compilations would help with debugging
minqi
parents:
diff
changeset
|
14 |
<h2>Usage</h2> |
17123
a8e62eed2e3e
8011675: adding compilation level to replay data
iignatyev
parents:
14477
diff
changeset
|
15 |
<pre> |
a8e62eed2e3e
8011675: adding compilation level to replay data
iignatyev
parents:
14477
diff
changeset
|
16 |
First, use SA to attach to the core file, if succeeded, do |
a8e62eed2e3e
8011675: adding compilation level to replay data
iignatyev
parents:
14477
diff
changeset
|
17 |
hsdb> dumpreplaydata <address> | -a | <thread_id> [> replay.txt] |
14477
95e66ea71f71
6830717: replay of compilations would help with debugging
minqi
parents:
diff
changeset
|
18 |
create file replay.txt, address is address of Method, or nmethod(CodeBlob) |
17123
a8e62eed2e3e
8011675: adding compilation level to replay data
iignatyev
parents:
14477
diff
changeset
|
19 |
hsdb> buildreplayjars [all | boot | app] |
14477
95e66ea71f71
6830717: replay of compilations would help with debugging
minqi
parents:
diff
changeset
|
20 |
create files: |
95e66ea71f71
6830717: replay of compilations would help with debugging
minqi
parents:
diff
changeset
|
21 |
all: |
95e66ea71f71
6830717: replay of compilations would help with debugging
minqi
parents:
diff
changeset
|
22 |
app.jar, boot.jar |
95e66ea71f71
6830717: replay of compilations would help with debugging
minqi
parents:
diff
changeset
|
23 |
boot: |
95e66ea71f71
6830717: replay of compilations would help with debugging
minqi
parents:
diff
changeset
|
24 |
boot.jar |
95e66ea71f71
6830717: replay of compilations would help with debugging
minqi
parents:
diff
changeset
|
25 |
app: |
95e66ea71f71
6830717: replay of compilations would help with debugging
minqi
parents:
diff
changeset
|
26 |
app.jar |
95e66ea71f71
6830717: replay of compilations would help with debugging
minqi
parents:
diff
changeset
|
27 |
exit SA now. |
95e66ea71f71
6830717: replay of compilations would help with debugging
minqi
parents:
diff
changeset
|
28 |
Second, use the obtained replay text file, replay.txt and jar files, app.jar and boot.jar, using debug version of java |
17123
a8e62eed2e3e
8011675: adding compilation level to replay data
iignatyev
parents:
14477
diff
changeset
|
29 |
java -Xbootclasspath/p:boot.jar -cp app.jar -XX:ReplayDataFile=<datafile> -XX:+ReplayCompiles .... |
14477
95e66ea71f71
6830717: replay of compilations would help with debugging
minqi
parents:
diff
changeset
|
30 |
This will replay the compiling process. |
95e66ea71f71
6830717: replay of compilations would help with debugging
minqi
parents:
diff
changeset
|
31 |
|
95e66ea71f71
6830717: replay of compilations would help with debugging
minqi
parents:
diff
changeset
|
32 |
With ReplayCompiles, the replay will recompile all the methods in app.jar, and in boot.jar to emulate the process in java app. |
95e66ea71f71
6830717: replay of compilations would help with debugging
minqi
parents:
diff
changeset
|
33 |
|
95e66ea71f71
6830717: replay of compilations would help with debugging
minqi
parents:
diff
changeset
|
34 |
notes: |
95e66ea71f71
6830717: replay of compilations would help with debugging
minqi
parents:
diff
changeset
|
35 |
1) Most time, we don't need the boot.jar which is the classes loaded from JDK. It will be only modified when an agent(JVMDI) is running and modifies the classes. |
17123
a8e62eed2e3e
8011675: adding compilation level to replay data
iignatyev
parents:
14477
diff
changeset
|
36 |
2) If encounter error as "<flag>" not found, that means the SA is using a VMStructs which is different from the one with corefile. In this case, SA has a utility tool vmstructsdump which is located at agent/src/os/<os>/proc/<os_platform> |
14477
95e66ea71f71
6830717: replay of compilations would help with debugging
minqi
parents:
diff
changeset
|
37 |
|
95e66ea71f71
6830717: replay of compilations would help with debugging
minqi
parents:
diff
changeset
|
38 |
Use this tool to dump VM type library: |
17123
a8e62eed2e3e
8011675: adding compilation level to replay data
iignatyev
parents:
14477
diff
changeset
|
39 |
vmstructsdump libjvm.so > <type_name>.db |
14477
95e66ea71f71
6830717: replay of compilations would help with debugging
minqi
parents:
diff
changeset
|
40 |
|
17123
a8e62eed2e3e
8011675: adding compilation level to replay data
iignatyev
parents:
14477
diff
changeset
|
41 |
set env SA_TYPEDB=<type_name>.db (refer different shell for set envs) |