minqi@4267: minqi@4267: minqi@4267: minqi@4267: C2 Replay minqi@4267: minqi@4267: minqi@4267: minqi@4267: minqi@4267:

C2 compiler replay

minqi@4267:

minqi@4267: The C2 compiler replay is a function to repeat the compiling process from a crashed java process in compiled method
minqi@4267: This function only exists in debug version of VM minqi@4267:

minqi@4267:

Usage

minqi@4267:
 
minqi@4267: First, use SA to attach to the core file, if suceeded, do
minqi@4267:        clhsdb>dumpreplaydata 
| -a | [> replay.txt] minqi@4267: create file replay.txt, address is address of Method, or nmethod(CodeBlob) minqi@4267: clhsdb>buildreplayjars [all | boot | app] minqi@4267: create files: minqi@4267: all: minqi@4267: app.jar, boot.jar minqi@4267: boot: minqi@4267: boot.jar minqi@4267: app: minqi@4267: app.jar minqi@4267: exit SA now. minqi@4267: Second, use the obtained replay text file, replay.txt and jar files, app.jar and boot.jar, using debug version of java minqi@4267: java -Xbootclasspath/p:boot.jar -cp app.jar -XX:ReplayDataFile= -XX:+ReplayCompiles .... minqi@4267: This will replay the compiling process. minqi@4267: minqi@4267: With ReplayCompiles, the replay will recompile all the methods in app.jar, and in boot.jar to emulate the process in java app. minqi@4267: minqi@4267: notes: minqi@4267: 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. minqi@4267: 2) If encounter error as "" 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//proc/ minqi@4267: minqi@4267: Use this tool to dump VM type library: minqi@4267: vmstructsdump libjvm.so > .db minqi@4267: minqi@4267: set env SA_TYPEDB=.db (refer different shell for set envs)