Commit 13f26713 authored by Pavel Dovgalyuk's avatar Pavel Dovgalyuk Committed by Paolo Bonzini
Browse files

replay: rename step-related variables and functions



This patch renames replay_get_current_step() and related variables
to make these names consistent with existing 'icount' command line
option and future record/replay hmp/qmp commands.

Signed-off-by: default avatarPavel Dovgalyuk <Pavel.Dovgaluk@ispras.ru>
Message-Id: <156404428377.18669.15476429889039912070.stgit@pasha-Precision-3630-Tower>
Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
parent 82f49156
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -75,7 +75,7 @@ void replay_add_blocker(Error *reason);
/* Processing the instructions */

/*! Returns number of executed instructions. */
uint64_t replay_get_current_step(void);
uint64_t replay_get_current_icount(void);
/*! Returns number of instructions to execute in replay mode. */
int replay_get_instructions(void);
/*! Updates instructions counter in replay mode. */
+1 −1
Original line number Diff line number Diff line
@@ -124,7 +124,7 @@ void replay_add_event(ReplayAsyncEventKind event_kind,
void replay_bh_schedule_event(QEMUBH *bh)
{
    if (events_enabled) {
        uint64_t id = replay_get_current_step();
        uint64_t id = replay_get_current_icount();
        replay_add_event(REPLAY_ASYNC_EVENT_BH, bh, NULL, id);
    } else {
        qemu_bh_schedule(bh);
+5 −5
Original line number Diff line number Diff line
@@ -173,7 +173,7 @@ void replay_fetch_data_kind(void)
        if (!replay_state.has_unread_data) {
            replay_state.data_kind = replay_get_byte();
            if (replay_state.data_kind == EVENT_INSTRUCTION) {
                replay_state.instructions_count = replay_get_dword();
                replay_state.instruction_count = replay_get_dword();
            }
            replay_check_error();
            replay_state.has_unread_data = 1;
@@ -227,9 +227,9 @@ void replay_mutex_unlock(void)
    }
}

void replay_advance_current_step(uint64_t current_step)
void replay_advance_current_icount(uint64_t current_icount)
{
    int diff = (int)(current_step - replay_state.current_step);
    int diff = (int)(current_icount - replay_state.current_icount);

    /* Time can only go forward */
    assert(diff >= 0);
@@ -237,7 +237,7 @@ void replay_advance_current_step(uint64_t current_step)
    if (diff > 0) {
        replay_put_event(EVENT_INSTRUCTION);
        replay_put_dword(diff);
        replay_state.current_step += diff;
        replay_state.current_icount += diff;
    }
}

@@ -246,6 +246,6 @@ void replay_save_instructions(void)
{
    if (replay_file && replay_mode == REPLAY_MODE_RECORD) {
        g_assert(replay_mutex_locked());
        replay_advance_current_step(replay_get_current_step());
        replay_advance_current_icount(replay_get_current_icount());
    }
}
+5 −5
Original line number Diff line number Diff line
@@ -64,10 +64,10 @@ typedef enum ReplayAsyncEventKind ReplayAsyncEventKind;
typedef struct ReplayState {
    /*! Cached clock values. */
    int64_t cached_clock[REPLAY_CLOCK_COUNT];
    /*! Current step - number of processed instructions and timer events. */
    uint64_t current_step;
    /*! Current icount - number of processed instructions. */
    uint64_t current_icount;
    /*! Number of instructions to be executed before other events happen. */
    int instructions_count;
    int instruction_count;
    /*! Type of the currently executed event. */
    unsigned int data_kind;
    /*! Flag which indicates that event is not processed yet. */
@@ -122,8 +122,8 @@ void replay_finish_event(void);
    data_kind variable. */
void replay_fetch_data_kind(void);

/*! Advance replay_state.current_step to the specified value. */
void replay_advance_current_step(uint64_t current_step);
/*! Advance replay_state.current_icount to the specified value. */
void replay_advance_current_icount(uint64_t current_icount);
/*! Saves queued events (like instructions and sound). */
void replay_save_instructions(void);

+3 −3
Original line number Diff line number Diff line
@@ -38,7 +38,7 @@ static int replay_post_load(void *opaque, int version_id)
    } else if (replay_mode == REPLAY_MODE_RECORD) {
        /* This is only useful for loading the initial state.
           Therefore reset all the counters. */
        state->instructions_count = 0;
        state->instruction_count = 0;
        state->block_request_id = 0;
    }

@@ -53,8 +53,8 @@ static const VMStateDescription vmstate_replay = {
    .post_load = replay_post_load,
    .fields = (VMStateField[]) {
        VMSTATE_INT64_ARRAY(cached_clock, ReplayState, REPLAY_CLOCK_COUNT),
        VMSTATE_UINT64(current_step, ReplayState),
        VMSTATE_INT32(instructions_count, ReplayState),
        VMSTATE_UINT64(current_icount, ReplayState),
        VMSTATE_INT32(instruction_count, ReplayState),
        VMSTATE_UINT32(data_kind, ReplayState),
        VMSTATE_UINT32(has_unread_data, ReplayState),
        VMSTATE_UINT64(file_offset, ReplayState),
Loading