aboutsummaryrefslogtreecommitdiff
path: root/replay/replay.c
diff options
context:
space:
mode:
authorPavel Dovgalyuk <Pavel.Dovgaluk@ispras.ru>2019-07-25 11:44:43 +0300
committerPaolo Bonzini <pbonzini@redhat.com>2019-08-20 17:26:22 +0200
commit13f267133f349f8a322b5385a58688f0dcdf9ed2 (patch)
tree2baebecd68234ab002c1e79f9c28d9cafa1c4f48 /replay/replay.c
parent82f49156531b3345fe03a74ca449147db5828238 (diff)
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>
Diffstat (limited to 'replay/replay.c')
-rw-r--r--replay/replay.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/replay/replay.c b/replay/replay.c
index 69f973cd21..e540d795a8 100644
--- a/replay/replay.c
+++ b/replay/replay.c
@@ -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 */