Commit 6450d9d6 authored by Jingyi Wang's avatar Jingyi Wang Committed by Paolo Bonzini
Browse files

arm64: microbench: Add test->post() to further process test results

Under certain circumstances, we need to further process microbench
test results, so we add test->post() in the microbench framework,
later patch will use that.

Signed-off-by: default avatarJingyi Wang <>
[ Drop total_ns from post() input arguments. ]
Signed-off-by: Andrew Jones's avatarAndrew Jones <>
Signed-off-by: default avatarPaolo Bonzini <>
parent 4c77d77b
......@@ -293,19 +293,20 @@ struct exit_test {
const char *name;
bool (*prep)(void);
void (*exec)(void);
void (*post)(uint64_t ntimes, uint64_t *total_ticks);
u32 times;
bool run;
static struct exit_test tests[] = {
{"hvc", NULL, hvc_exec, 65536, true},
{"mmio_read_user", NULL, mmio_read_user_exec, 65536, true},
{"mmio_read_vgic", NULL, mmio_read_vgic_exec, 65536, true},
{"eoi", NULL, eoi_exec, 65536, true},
{"ipi", ipi_prep, ipi_exec, 65536, true},
{"ipi_hw", ipi_hw_prep, ipi_exec, 65536, true},
{"lpi", lpi_prep, lpi_exec, 65536, true},
{"timer_10ms", timer_prep, timer_exec, 256, true},
{"hvc", NULL, hvc_exec, NULL, 65536, true},
{"mmio_read_user", NULL, mmio_read_user_exec, NULL, 65536, true},
{"mmio_read_vgic", NULL, mmio_read_vgic_exec, NULL, 65536, true},
{"eoi", NULL, eoi_exec, NULL, 65536, true},
{"ipi", ipi_prep, ipi_exec, NULL, 65536, true},
{"ipi_hw", ipi_hw_prep, ipi_exec, NULL, 65536, true},
{"lpi", lpi_prep, lpi_exec, NULL, 65536, true},
{"timer_10ms", timer_prep, timer_exec, NULL, 256, true},
struct ns_time {
......@@ -349,6 +350,11 @@ static void loop_test(struct exit_test *test)
ticks_to_ns_time(total_ticks, &total_ns);
if (test->post) {
test->post(ntimes, &total_ticks);
ticks_to_ns_time(total_ticks, &total_ns);
avg_ns.ns = total_ns.ns / ntimes;
avg_ns.ns_frac = total_ns.ns_frac / ntimes;
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment