aboutsummaryrefslogtreecommitdiff
path: root/replay/replay-internal.h
diff options
context:
space:
mode:
authorPavel Dovgalyuk <pavel.dovgalyuk@ispras.ru>2022-05-27 13:46:23 +0300
committerPaolo Bonzini <pbonzini@redhat.com>2022-06-06 09:26:53 +0200
commit3e21408b0596aa2babe1e26996a15e7ad5eee71a (patch)
treebf75b38196d4954205aecba7bd279abe7d484ce7 /replay/replay-internal.h
parent60618e2d77691e44bb78e23b2b0cf07b5c405e56 (diff)
replay: simplify async event processing
This patch joins replay event id and async event id into single byte in the log. It makes processing a bit faster and log a bit smaller. Signed-off-by: Pavel Dovgalyuk <Pavel.Dovgalyuk@ispras.ru> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> -- v2: minor enum fixes (suggested by Richard Henderson) Message-Id: <165364838393.688121.8191379555130516329.stgit@pasha-ThinkPad-X280> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'replay/replay-internal.h')
-rw-r--r--replay/replay-internal.h31
1 files changed, 14 insertions, 17 deletions
diff --git a/replay/replay-internal.h b/replay/replay-internal.h
index d6e631a394..89e377be90 100644
--- a/replay/replay-internal.h
+++ b/replay/replay-internal.h
@@ -12,6 +12,19 @@
*
*/
+/* Asynchronous events IDs */
+
+typedef enum ReplayAsyncEventKind {
+ REPLAY_ASYNC_EVENT_BH,
+ REPLAY_ASYNC_EVENT_BH_ONESHOT,
+ REPLAY_ASYNC_EVENT_INPUT,
+ REPLAY_ASYNC_EVENT_INPUT_SYNC,
+ REPLAY_ASYNC_EVENT_CHAR_READ,
+ REPLAY_ASYNC_EVENT_BLOCK,
+ REPLAY_ASYNC_EVENT_NET,
+ REPLAY_ASYNC_COUNT
+} ReplayAsyncEventKind;
+
/* Any changes to order/number of events will need to bump REPLAY_VERSION */
enum ReplayEvents {
/* for instruction event */
@@ -22,6 +35,7 @@ enum ReplayEvents {
EVENT_EXCEPTION,
/* for async events */
EVENT_ASYNC,
+ EVENT_ASYNC_LAST = EVENT_ASYNC + REPLAY_ASYNC_COUNT - 1,
/* for shutdown requests, range allows recovery of ShutdownCause */
EVENT_SHUTDOWN,
EVENT_SHUTDOWN_LAST = EVENT_SHUTDOWN + SHUTDOWN_CAUSE__MAX,
@@ -49,21 +63,6 @@ enum ReplayEvents {
EVENT_COUNT
};
-/* Asynchronous events IDs */
-
-enum ReplayAsyncEventKind {
- REPLAY_ASYNC_EVENT_BH,
- REPLAY_ASYNC_EVENT_BH_ONESHOT,
- REPLAY_ASYNC_EVENT_INPUT,
- REPLAY_ASYNC_EVENT_INPUT_SYNC,
- REPLAY_ASYNC_EVENT_CHAR_READ,
- REPLAY_ASYNC_EVENT_BLOCK,
- REPLAY_ASYNC_EVENT_NET,
- REPLAY_ASYNC_COUNT
-};
-
-typedef enum ReplayAsyncEventKind ReplayAsyncEventKind;
-
typedef struct ReplayState {
/*! Cached clock values. */
int64_t cached_clock[REPLAY_CLOCK_COUNT];
@@ -83,8 +82,6 @@ typedef struct ReplayState {
uint64_t block_request_id;
/*! Prior value of the host clock */
uint64_t host_clock_last;
- /*! Asynchronous event type read from the log */
- int32_t read_event_kind;
/*! Asynchronous event id read from the log */
uint64_t read_event_id;
} ReplayState;