Pausing tool - endplay/omniplay GitHub Wiki

Table of Contents

Buiding

The pausing tool is in omniplay/test and it will be compiled along with parseklog etc.

Setup

Compile your kernel with the right configuration

Make sure

    #define REPLAY_PAUSE

is on in kernel/replay.c

Turn replay_pause_tool on

    echo 1 > /proc/sys/kernel/pause_tool

How to use

The pausing tool has similar usage and commands with gdb.

Start to replay a process first,

    ./resume rec_XXXX

The process will wait for the pausing tool to be attached.

Then run our tool.

    ./replay_pause <pid>

This command will attach pausing tool to a replay process (The pid of the replay process will be displayed as soon as you resume it.)

Now use the following commands (basically the same meaning with gdb) to pause or resume a replaying process at any clock

    r (or run)           :run the process. The process will be fully replayed unless you set up a break clock by break command;
    c (or continue)      :continue to run the process after a break clock
    b (or break) [clock] :set up a clock at which the replay process will pause
    n (or next)   	     :the process will continue to run until {step_clock} clocks have passed. step_clock is a variable that can be set by set command;
    s (or set) [step]    :Change the step_clock to be the new value
    h (or help)   	     :Print help information
    q (or quit)          :quit replay pausing tool

Set step command

The only different command with gdb is the set step command. Normally, if you use n command (next command) in this tool, it will let the process run until the next clock is hit. However, if you set a step_clock value by s command (set command), the n command will let the process run and pause after step_clock clocks.

Screen output

When the pause tool finds that the replay process reaches a clock that an user set previously, it will display:

    Break at clock 100011 (scheduled to break at 100000)

Then you can continue to type new commands to the pausing tool.

Note: The replay process will likely pause at a different clock (greater than the clock value we want to pause), as the break clock we set may be a clock in user-level.

If you check dmesg now, there will be a message when the replay process pauses:

    Pid 3529 replay will pause here, clock is 9024818 now
⚠️ **GitHub.com Fallback** ⚠️