]> git.proxmox.com Git - mirror_qemu.git/blame - replay/replay.c
cpu-exec: allow temporary disabling icount
[mirror_qemu.git] / replay / replay.c
CommitLineData
d73abd6d
PD
1/*
2 * replay.c
3 *
4 * Copyright (c) 2010-2015 Institute for System Programming
5 * of the Russian Academy of Sciences.
6 *
7 * This work is licensed under the terms of the GNU GPL, version 2 or later.
8 * See the COPYING file in the top-level directory.
9 *
10 */
11
26bc60ac 12#include "qemu-common.h"
d73abd6d 13#include "sysemu/replay.h"
26bc60ac
PD
14#include "replay-internal.h"
15#include "qemu/timer.h"
d73abd6d
PD
16
17ReplayMode replay_mode = REPLAY_MODE_NONE;
26bc60ac
PD
18
19ReplayState replay_state;
20
21bool replay_next_event_is(int event)
22{
23 bool res = false;
24
25 /* nothing to skip - not all instructions used */
26 if (replay_state.instructions_count != 0) {
27 assert(replay_data_kind == EVENT_INSTRUCTION);
28 return event == EVENT_INSTRUCTION;
29 }
30
31 while (true) {
32 if (event == replay_data_kind) {
33 res = true;
34 }
35 switch (replay_data_kind) {
36 default:
37 /* clock, time_t, checkpoint and other events */
38 return res;
39 }
40 }
41 return res;
42}
43
44uint64_t replay_get_current_step(void)
45{
46 return cpu_get_icount_raw();
47}