hotspot/agent/doc/c2replay.html
changeset 17553 4ea383c26563
parent 17552 241d13ccb08b
parent 17289 4dec41b3c5e3
child 17554 eca763ef7c5e
equal deleted inserted replaced
17552:241d13ccb08b 17553:4ea383c26563
     1 <html>
       
     2 <head>
       
     3 <title>
       
     4 C2 Replay
       
     5 </title>
       
     6 </head>
       
     7 <body>
       
     8 
       
     9 <h1>C2 compiler replay</h1>
       
    10 <p>
       
    11 The C2 compiler replay is a function to repeat the compiling process from a crashed java process in compiled method<br>
       
    12 This function only exists in debug version of VM
       
    13 </p>
       
    14 <h2>Usage</h2>
       
    15 <pre> 
       
    16 First, use SA to attach to the core file, if suceeded, do
       
    17        clhsdb>dumpreplaydata <address> | -a | <thread_id> [> replay.txt]
       
    18        create file replay.txt, address is address of Method, or nmethod(CodeBlob)
       
    19        clhsdb>buildreplayjars [all | boot | app]
       
    20        create files:
       
    21          all:
       
    22            app.jar, boot.jar
       
    23          boot:
       
    24            boot.jar
       
    25          app:
       
    26            app.jar
       
    27        exit SA now.
       
    28 Second, use the obtained replay text file, replay.txt and jar files, app.jar and boot.jar, using debug version of java
       
    29        java -Xbootclasspath/p:boot.jar -cp app.jar -XX:ReplayDataFile=<datafile> -XX:+ReplayCompiles ....
       
    30        This will replay the compiling process.
       
    31 
       
    32        With ReplayCompiles, the replay will recompile all the methods in app.jar, and in boot.jar to emulate the process in java app.
       
    33 
       
    34 notes:
       
    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.
       
    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>
       
    37 
       
    38        Use this tool to dump VM type library:
       
    39        vmstructsdump libjvm.so > <type_name>.db
       
    40 
       
    41        set env SA_TYPEDB=<type_name>.db (refer different shell for set envs)