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: Pavel Dovgalyuk <Pavel.Dovgaluk@ispras.ru>
Message-Id: <156404428377.18669.15476429889039912070.stgit@pasha-Precision-3630-Tower>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
This commit is contained in:
Pavel Dovgalyuk 2019-07-25 11:44:43 +03:00 committed by Paolo Bonzini
parent 82f4915653
commit 13f267133f
7 changed files with 27 additions and 27 deletions

View file

@ -39,7 +39,7 @@ bool replay_next_event_is(int event)
bool res = false;
/* nothing to skip - not all instructions used */
if (replay_state.instructions_count != 0) {
if (replay_state.instruction_count != 0) {
assert(replay_state.data_kind == EVENT_INSTRUCTION);
return event == EVENT_INSTRUCTION;
}
@ -62,7 +62,7 @@ bool replay_next_event_is(int event)
return res;
}
uint64_t replay_get_current_step(void)
uint64_t replay_get_current_icount(void)
{
return cpu_get_icount_raw();
}
@ -72,7 +72,7 @@ int replay_get_instructions(void)
int res = 0;
replay_mutex_lock();
if (replay_next_event_is(EVENT_INSTRUCTION)) {
res = replay_state.instructions_count;
res = replay_state.instruction_count;
}
replay_mutex_unlock();
return res;
@ -82,16 +82,16 @@ void replay_account_executed_instructions(void)
{
if (replay_mode == REPLAY_MODE_PLAY) {
g_assert(replay_mutex_locked());
if (replay_state.instructions_count > 0) {
int count = (int)(replay_get_current_step()
- replay_state.current_step);
if (replay_state.instruction_count > 0) {
int count = (int)(replay_get_current_icount()
- replay_state.current_icount);
/* Time can only go forward */
assert(count >= 0);
replay_state.instructions_count -= count;
replay_state.current_step += count;
if (replay_state.instructions_count == 0) {
replay_state.instruction_count -= count;
replay_state.current_icount += count;
if (replay_state.instruction_count == 0) {
assert(replay_state.data_kind == EVENT_INSTRUCTION);
replay_finish_event();
/* Wake up iothread. This is required because
@ -273,8 +273,8 @@ static void replay_enable(const char *fname, int mode)
replay_mutex_init();
replay_state.data_kind = -1;
replay_state.instructions_count = 0;
replay_state.current_step = 0;
replay_state.instruction_count = 0;
replay_state.current_icount = 0;
replay_state.has_unread_data = 0;
/* skip file header for RECORD and check it for PLAY */