Re: [PATCH v6 02/16] icount: rename functions to be consistent with the module name

2020-09-01 Thread Richard Henderson
On 9/1/20 12:21 AM, Claudio Fontana wrote:
> Signed-off-by: Claudio Fontana 
> ---
>  accel/tcg/cpu-exec.c|  4 ++--
>  docs/replay.txt |  6 +++---
>  include/sysemu/cpu-timers.h | 16 +++---
>  include/sysemu/replay.h |  4 ++--
>  replay/replay.c |  2 +-
>  softmmu/cpu-timers.c|  4 ++--
>  softmmu/cpus.c  |  6 +++---
>  softmmu/icount.c| 42 ++---
>  softmmu/vl.c|  2 +-
>  stubs/icount.c  | 16 +++---
>  target/arm/helper.c |  4 ++--
>  target/riscv/csr.c  |  4 ++--
>  util/main-loop.c|  2 +-
>  util/qemu-timer.c   |  4 ++--
>  14 files changed, 58 insertions(+), 58 deletions(-)

Reviewed-by: Richard Henderson 

r~



Re: [PATCH v6 02/16] icount: rename functions to be consistent with the module name

2020-09-01 Thread Alex Bennée


Claudio Fontana  writes:

> Signed-off-by: Claudio Fontana 

Reviewed-by: Alex Bennée 

-- 
Alex Bennée



[PATCH v6 02/16] icount: rename functions to be consistent with the module name

2020-09-01 Thread Claudio Fontana
Signed-off-by: Claudio Fontana 
---
 accel/tcg/cpu-exec.c|  4 ++--
 docs/replay.txt |  6 +++---
 include/sysemu/cpu-timers.h | 16 +++---
 include/sysemu/replay.h |  4 ++--
 replay/replay.c |  2 +-
 softmmu/cpu-timers.c|  4 ++--
 softmmu/cpus.c  |  6 +++---
 softmmu/icount.c| 42 ++---
 softmmu/vl.c|  2 +-
 stubs/icount.c  | 16 +++---
 target/arm/helper.c |  4 ++--
 target/riscv/csr.c  |  4 ++--
 util/main-loop.c|  2 +-
 util/qemu-timer.c   |  4 ++--
 14 files changed, 58 insertions(+), 58 deletions(-)

diff --git a/accel/tcg/cpu-exec.c b/accel/tcg/cpu-exec.c
index 279169d47d..b44e92b753 100644
--- a/accel/tcg/cpu-exec.c
+++ b/accel/tcg/cpu-exec.c
@@ -71,7 +71,7 @@ static void align_clocks(SyncClocks *sc, CPUState *cpu)
 }
 
 cpu_icount = cpu->icount_extra + cpu_neg(cpu)->icount_decr.u16.low;
-sc->diff_clk += cpu_icount_to_ns(sc->last_cpu_icount - cpu_icount);
+sc->diff_clk += icount_to_ns(sc->last_cpu_icount - cpu_icount);
 sc->last_cpu_icount = cpu_icount;
 
 if (sc->diff_clk > VM_CLOCK_ADVANCE) {
@@ -664,7 +664,7 @@ static inline void cpu_loop_exec_tb(CPUState *cpu, 
TranslationBlock *tb,
 assert(icount_enabled());
 #ifndef CONFIG_USER_ONLY
 /* Ensure global icount has gone forward */
-cpu_update_icount(cpu);
+icount_update(cpu);
 /* Refill decrementer and continue execution.  */
 insns_left = MIN(0x, cpu->icount_budget);
 cpu_neg(cpu)->icount_decr.u16.low = insns_left;
diff --git a/docs/replay.txt b/docs/replay.txt
index 70c27edb36..8952e6d852 100644
--- a/docs/replay.txt
+++ b/docs/replay.txt
@@ -184,11 +184,11 @@ is then incremented (which is called "warping" the 
virtual clock) as
 soon as the timer fires or the CPUs need to go out of the idle state.
 Two functions are used for this purpose; because these actions change
 virtual machine state and must be deterministic, each of them creates a
-checkpoint.  qemu_start_warp_timer checks if the CPUs are idle and if so
-starts accounting real time to virtual clock.  qemu_account_warp_timer
+checkpoint.  icount_start_warp_timer checks if the CPUs are idle and if so
+starts accounting real time to virtual clock.  icount_account_warp_timer
 is called when the CPUs get an interrupt or when the warp timer fires,
 and it warps the virtual clock by the amount of real time that has passed
-since qemu_start_warp_timer.
+since icount_start_warp_timer.
 
 Bottom halves
 -
diff --git a/include/sysemu/cpu-timers.h b/include/sysemu/cpu-timers.h
index 4b621fea51..7726e005cd 100644
--- a/include/sysemu/cpu-timers.h
+++ b/include/sysemu/cpu-timers.h
@@ -35,30 +35,30 @@ extern int use_icount;
  * Update the icount with the executed instructions. Called by
  * cpus-tcg vCPU thread so the main-loop can see time has moved forward.
  */
-void cpu_update_icount(CPUState *cpu);
+void icount_update(CPUState *cpu);
 
 /* get raw icount value */
-int64_t cpu_get_icount_raw(void);
+int64_t icount_get_raw(void);
 
 /* return the virtual CPU time in ns, based on the instruction counter. */
-int64_t cpu_get_icount(void);
+int64_t icount_get(void);
 /*
  * convert an instruction counter value to ns, based on the icount shift.
  * This shift is set as a fixed value with the icount "shift" option
  * (precise mode), or it is constantly approximated and corrected at
  * runtime in adaptive mode.
  */
-int64_t cpu_icount_to_ns(int64_t icount);
+int64_t icount_to_ns(int64_t icount);
 
 /* configure the icount options, including "shift" */
-void configure_icount(QemuOpts *opts, Error **errp);
+void icount_configure(QemuOpts *opts, Error **errp);
 
 /* used by tcg vcpu thread to calc icount budget */
-int64_t qemu_icount_round(int64_t count);
+int64_t icount_round(int64_t count);
 
 /* if the CPUs are idle, start accounting real time to virtual clock. */
-void qemu_start_warp_timer(void);
-void qemu_account_warp_timer(void);
+void icount_start_warp_timer(void);
+void icount_account_warp_timer(void);
 
 /*
  * CPU Ticks and Clock
diff --git a/include/sysemu/replay.h b/include/sysemu/replay.h
index 5471bb514d..a140d69a73 100644
--- a/include/sysemu/replay.h
+++ b/include/sysemu/replay.h
@@ -109,12 +109,12 @@ int64_t replay_read_clock(ReplayClockKind kind);
 #define REPLAY_CLOCK(clock, value)  \
 (replay_mode == REPLAY_MODE_PLAY ? replay_read_clock((clock))   \
 : replay_mode == REPLAY_MODE_RECORD \
-? replay_save_clock((clock), (value), cpu_get_icount_raw()) \
+? replay_save_clock((clock), (value), icount_get_raw()) \
 : (value))
 #define REPLAY_CLOCK_LOCKED(clock, value)   \
 (replay_mode == REPLAY_MODE_PLAY ? replay_read_clock((clock))   \
 : replay_mode == REPLAY_MODE_RECORD