@@ -51,5 +51,6 @@ run-memory-replay: memory-replay run-memory-record
-icount shift=5$(COMMA)rr=replay$(COMMA)rrfile=record.bin \
$(QEMU_OPTS) memory, \
"$< on $(TARGET_NAME)")
+ $(call diff-out,memory-record,memory-replay.out)
TESTS+=memory-record memory-replay
@@ -220,6 +220,12 @@ __sys_outc:
ldp x0, x1, [sp], #16
ret
+ /* return some sort of counter value */
+ .global __sys_counter
+__sys_counter:
+ mrs x0, CNTV_TVAL_EL0
+ ret
+
.data
.align 12
@@ -12,10 +12,13 @@
#ifndef _MINILIB_H_
#define _MINILIB_H_
+#include <inttypes.h>
+
/*
* Provided by the individual arch
*/
extern void __sys_outc(char c);
+extern uint64_t __sys_counter(void);
/*
* Provided by the common minilib
@@ -454,6 +454,8 @@ int main(void)
{
int i;
bool ok = true;
+ uint64_t start = __sys_counter();
+ uint64_t end;
/* Run through the unsigned tests first */
for (i = 0; i < ARRAY_SIZE(init_ufns) && ok; i++) {
@@ -470,6 +472,8 @@ int main(void)
ok = do_signed_reads(true);
}
- ml_printf("Test complete: %s\n", ok ? "PASSED" : "FAILED");
+ end = __sys_counter();
+
+ ml_printf("Test complete in %" PRId64 ": %s\n", start - end, ok ? "PASSED" : "FAILED");
return ok ? 0 : -1;
}
To better support testing record/replay we should output something that would otherwise be variable had it not been pegged to icount. [AJB: needs a bit of work to nicely work across architectures although most have some sort of counter]. Signed-off-by: Alex Bennée <alex.bennee@linaro.org> Cc: Pavel Dovgalyuk <dovgaluk@ispras.ru> --- tests/tcg/aarch64/Makefile.softmmu-target | 1 + tests/tcg/aarch64/system/boot.S | 6 ++++++ tests/tcg/minilib/minilib.h | 3 +++ tests/tcg/multiarch/system/memory.c | 6 +++++- 4 files changed, 15 insertions(+), 1 deletion(-) -- 2.20.1