Wed, 27 Apr 2016 01:25:04 +0800
Initial load
http://hg.openjdk.java.net/jdk8u/jdk8u/hotspot/
changeset: 6782:28b50d07f6f8
tag: jdk8u25-b17
aoqi@0 | 1 | <html> |
aoqi@0 | 2 | <head> |
aoqi@0 | 3 | <title> |
aoqi@0 | 4 | Replay |
aoqi@0 | 5 | </title> |
aoqi@0 | 6 | </head> |
aoqi@0 | 7 | <body> |
aoqi@0 | 8 | |
aoqi@0 | 9 | <h1>Compiler replay</h1> |
aoqi@0 | 10 | <p> |
aoqi@0 | 11 | The compiler replay is a function to repeat the compiling process from a crashed java process in compiled method<br> |
aoqi@0 | 12 | This function only exists in debug version of VM |
aoqi@0 | 13 | </p> |
aoqi@0 | 14 | <h2>Usage</h2> |
aoqi@0 | 15 | <pre> |
aoqi@0 | 16 | First, use SA to attach to the core file, if succeeded, do |
aoqi@0 | 17 | hsdb> dumpreplaydata <address> | -a | <thread_id> [> replay.txt] |
aoqi@0 | 18 | create file replay.txt, address is address of Method, or nmethod(CodeBlob) |
aoqi@0 | 19 | hsdb> buildreplayjars [all | boot | app] |
aoqi@0 | 20 | create files: |
aoqi@0 | 21 | all: |
aoqi@0 | 22 | app.jar, boot.jar |
aoqi@0 | 23 | boot: |
aoqi@0 | 24 | boot.jar |
aoqi@0 | 25 | app: |
aoqi@0 | 26 | app.jar |
aoqi@0 | 27 | exit SA now. |
aoqi@0 | 28 | Second, use the obtained replay text file, replay.txt and jar files, app.jar and boot.jar, using debug version of java |
aoqi@0 | 29 | java -Xbootclasspath/p:boot.jar -cp app.jar -XX:ReplayDataFile=<datafile> -XX:+ReplayCompiles .... |
aoqi@0 | 30 | This will replay the compiling process. |
aoqi@0 | 31 | |
aoqi@0 | 32 | With ReplayCompiles, the replay will recompile all the methods in app.jar, and in boot.jar to emulate the process in java app. |
aoqi@0 | 33 | |
aoqi@0 | 34 | notes: |
aoqi@0 | 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. |
aoqi@0 | 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> |
aoqi@0 | 37 | |
aoqi@0 | 38 | Use this tool to dump VM type library: |
aoqi@0 | 39 | vmstructsdump libjvm.so > <type_name>.db |
aoqi@0 | 40 | |
aoqi@0 | 41 | set env SA_TYPEDB=<type_name>.db (refer different shell for set envs) |