minqi@4267: minqi@4267: minqi@4267: iignatyev@5029: Replay minqi@4267: minqi@4267: minqi@4267: minqi@4267: iignatyev@5029:

Compiler replay

minqi@4267:

iignatyev@5029: The 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

iignatyev@5029:
iignatyev@5029: First, use SA to attach to the core file, if succeeded, do
iignatyev@5029:        hsdb> dumpreplaydata <address> | -a | <thread_id> [> replay.txt]
minqi@4267:        create file replay.txt, address is address of Method, or nmethod(CodeBlob)
iignatyev@5029:        hsdb> 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
iignatyev@5029:        java -Xbootclasspath/p:boot.jar -cp app.jar -XX:ReplayDataFile=<datafile> -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.
iignatyev@5029:        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>
minqi@4267: 
minqi@4267:        Use this tool to dump VM type library:
iignatyev@5029:        vmstructsdump libjvm.so > <type_name>.db
minqi@4267: 
iignatyev@5029:        set env SA_TYPEDB=<type_name>.db (refer different shell for set envs)