[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [RFC PATCH v3 22/49] cpu: invent instruction count for
From: |
Alex Bennée |
Subject: |
Re: [Qemu-devel] [RFC PATCH v3 22/49] cpu: invent instruction count for accurate replay |
Date: |
Thu, 31 Jul 2014 17:17:29 +0100 |
Pavel Dovgalyuk writes:
> This patch adds instructions count fields to cpu structure and
> invents several functions for increasing this counter while executing
> translation blocks.
>
<snip>
> @@ -1186,6 +1188,7 @@ void qemu_init_vcpu(CPUState *cpu)
> cpu->nr_cores = smp_cores;
> cpu->nr_threads = smp_threads;
> cpu->stopped = true;
> + cpu->instructions_count = 0;
<snip>
> + if (replay_file) {
> + if (replay_mode == REPLAY_MODE_RECORD) {
> + if (process_events && replay_has_events()) {
> + replay_save_instructions();
> + /* events will be after the last instruction */
> + replay_save_events(-1);
> + } else {
> + /* instruction - increase the step counter */
> + ++first_cpu->instructions_count;
> + }
> + } else if (replay_mode == REPLAY_MODE_PLAY) {
> + skip_async_events_until(EVENT_INSTRUCTION);
> + if (first_cpu->instructions_count >= 1) {
> + ++replay_state.current_step;
> + --first_cpu->instructions_count;
> + if (first_cpu->instructions_count == 0) {
> + replay_has_unread_data = 0;
> + }
> + } else {
> + replay_read_events(-1);
> + }
> + }
> + }
> +}
> +
> +void replay_undo_last_instruction(void)
> +{
> + if (replay_mode == REPLAY_MODE_RECORD) {
> + first_cpu->instructions_count--;
> + } else {
> + replay_state.skipping_instruction = 1;
> + }
I'm not quite following what instructions_count means here. Is it an
actual count of instructions executed? Can you add a comment to the
header where it's defined?
--
Alex Bennée
- [Qemu-devel] [RFC PATCH v3 15/49] softmmu: fixing usage of cpu_st/ld* from helpers, (continued)
- [Qemu-devel] [RFC PATCH v3 15/49] softmmu: fixing usage of cpu_st/ld* from helpers, Pavel Dovgalyuk, 2014/07/31
- [Qemu-devel] [RFC PATCH v3 16/49] target-i386: update fp status fix, Pavel Dovgalyuk, 2014/07/31
- [Qemu-devel] [RFC PATCH v3 17/49] migration: add vmstate for int8 and char arrays, Pavel Dovgalyuk, 2014/07/31
- [Qemu-devel] [RFC PATCH v3 18/49] replay: global variables and function stubs, Pavel Dovgalyuk, 2014/07/31
- [Qemu-devel] [RFC PATCH v3 19/49] block: add suffix parameter to bdrv_open functions, Pavel Dovgalyuk, 2014/07/31
- [Qemu-devel] [RFC PATCH v3 20/49] sysemu: system functions for replay, Pavel Dovgalyuk, 2014/07/31
- [Qemu-devel] [RFC PATCH v3 21/49] replay: internal functions for replay log, Pavel Dovgalyuk, 2014/07/31
- [Qemu-devel] [RFC PATCH v3 22/49] cpu: invent instruction count for accurate replay, Pavel Dovgalyuk, 2014/07/31
- Re: [Qemu-devel] [RFC PATCH v3 22/49] cpu: invent instruction count for accurate replay,
Alex Bennée <=
- [Qemu-devel] [RFC PATCH v3 23/49] target-arm: instructions counting code for replay, Pavel Dovgalyuk, 2014/07/31
- [Qemu-devel] [RFC PATCH v3 24/49] target-i386: instructions counting code for replay, Pavel Dovgalyuk, 2014/07/31
- [Qemu-devel] [RFC PATCH v3 25/49] replay: interrupts and exceptions, Pavel Dovgalyuk, 2014/07/31
- [Qemu-devel] [RFC PATCH v3 26/49] vga: do not use virtual clock for blinking cursor, Pavel Dovgalyuk, 2014/07/31
- [Qemu-devel] [RFC PATCH v3 27/49] replay: asynchronous events infrastructure, Pavel Dovgalyuk, 2014/07/31
- [Qemu-devel] [RFC PATCH v3 28/49] replay: recording and replaying clock ticks, Pavel Dovgalyuk, 2014/07/31
- [Qemu-devel] [RFC PATCH v3 29/49] replay: recording and replaying different timers, Pavel Dovgalyuk, 2014/07/31
- [Qemu-devel] [RFC PATCH v3 30/49] replay: shutdown event, Pavel Dovgalyuk, 2014/07/31
- [Qemu-devel] [RFC PATCH v3 31/49] replay: checkpoints, Pavel Dovgalyuk, 2014/07/31
- [Qemu-devel] [RFC PATCH v3 32/49] vmclock: add virtual clock based on replay icount, Pavel Dovgalyuk, 2014/07/31