1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/agent/doc/cireplay.html Wed Apr 27 01:25:04 2016 +0800 1.3 @@ -0,0 +1,41 @@ 1.4 +<html> 1.5 +<head> 1.6 +<title> 1.7 +Replay 1.8 +</title> 1.9 +</head> 1.10 +<body> 1.11 + 1.12 +<h1>Compiler replay</h1> 1.13 +<p> 1.14 +The compiler replay is a function to repeat the compiling process from a crashed java process in compiled method<br> 1.15 +This function only exists in debug version of VM 1.16 +</p> 1.17 +<h2>Usage</h2> 1.18 +<pre> 1.19 +First, use SA to attach to the core file, if succeeded, do 1.20 + hsdb> dumpreplaydata <address> | -a | <thread_id> [> replay.txt] 1.21 + create file replay.txt, address is address of Method, or nmethod(CodeBlob) 1.22 + hsdb> buildreplayjars [all | boot | app] 1.23 + create files: 1.24 + all: 1.25 + app.jar, boot.jar 1.26 + boot: 1.27 + boot.jar 1.28 + app: 1.29 + app.jar 1.30 + exit SA now. 1.31 +Second, use the obtained replay text file, replay.txt and jar files, app.jar and boot.jar, using debug version of java 1.32 + java -Xbootclasspath/p:boot.jar -cp app.jar -XX:ReplayDataFile=<datafile> -XX:+ReplayCompiles .... 1.33 + This will replay the compiling process. 1.34 + 1.35 + With ReplayCompiles, the replay will recompile all the methods in app.jar, and in boot.jar to emulate the process in java app. 1.36 + 1.37 +notes: 1.38 + 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. 1.39 + 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> 1.40 + 1.41 + Use this tool to dump VM type library: 1.42 + vmstructsdump libjvm.so > <type_name>.db 1.43 + 1.44 + set env SA_TYPEDB=<type_name>.db (refer different shell for set envs)