This patch adds module for saving and replaying asynchronous events. These events include network packets, keyboard and mouse input, USB packets, thread pool and bottom halves callbacks. All events are stored in the queue to be processed at synchronization points such as beginning of TB execution, or checkpoint in the iothread. Signed-off-by: Pavel Dovgalyuk <pavel.dovgaluk@ispras.ru> Message-Id: <20150917162422.8676.88696.stgit@PASHA-ISP.def.inno> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Pavel Dovgalyuk <Pavel.Dovgaluk@ispras.ru>
54 lines
1.5 KiB
C
54 lines
1.5 KiB
C
#ifndef REPLAY_H
|
|
#define REPLAY_H
|
|
|
|
/*
|
|
* replay.h
|
|
*
|
|
* Copyright (c) 2010-2015 Institute for System Programming
|
|
* of the Russian Academy of Sciences.
|
|
*
|
|
* This work is licensed under the terms of the GNU GPL, version 2 or later.
|
|
* See the COPYING file in the top-level directory.
|
|
*
|
|
*/
|
|
|
|
#include <stdbool.h>
|
|
#include <stdint.h>
|
|
#include "qapi-types.h"
|
|
|
|
extern ReplayMode replay_mode;
|
|
|
|
/* Processing the instructions */
|
|
|
|
/*! Returns number of executed instructions. */
|
|
uint64_t replay_get_current_step(void);
|
|
/*! Returns number of instructions to execute in replay mode. */
|
|
int replay_get_instructions(void);
|
|
/*! Updates instructions counter in replay mode. */
|
|
void replay_account_executed_instructions(void);
|
|
|
|
/* Interrupts and exceptions */
|
|
|
|
/*! Called by exception handler to write or read
|
|
exception processing events. */
|
|
bool replay_exception(void);
|
|
/*! Used to determine that exception is pending.
|
|
Does not proceed to the next event in the log. */
|
|
bool replay_has_exception(void);
|
|
/*! Called by interrupt handlers to write or read
|
|
interrupt processing events.
|
|
\return true if interrupt should be processed */
|
|
bool replay_interrupt(void);
|
|
/*! Tries to read interrupt event from the file.
|
|
Returns true, when interrupt request is pending */
|
|
bool replay_has_interrupt(void);
|
|
|
|
/* Asynchronous events queue */
|
|
|
|
/*! Disables storing events in the queue */
|
|
void replay_disable_events(void);
|
|
/*! Returns true when saving events is enabled */
|
|
bool replay_events_enabled(void);
|
|
|
|
#endif
|