From 4148aaba5cf26eb43aac42a4b1aef39f4f2ee1d7 Mon Sep 17 00:00:00 2001 From: Philippe Gerum Date: Sun, 14 Jun 2020 22:13:39 +0200 Subject: [PATCH] benchmark/latmus: latmon: re-instate warm-up time Add back a 1s warm-up time, making sure not to include the delta values collected during this period in the histogram distribution this time. Signed-off-by: Philippe Gerum --- benchmarks/zephyr/latmon/src/main.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/benchmarks/zephyr/latmon/src/main.c b/benchmarks/zephyr/latmon/src/main.c index 111e750..d273078 100644 --- a/benchmarks/zephyr/latmon/src/main.c +++ b/benchmarks/zephyr/latmon/src/main.c @@ -244,7 +244,7 @@ static void gpio_ack_handler(struct device *port, static int monitor(void) { - u32_t pulse_date, delta, delta_ns, delta_usecs; + u32_t pulse_date, delta, delta_ns, delta_usecs, warmup_count = 0; unsigned int key; int cell; @@ -277,6 +277,11 @@ static int monitor(void) continue; } + if (warmup_count < max_samples_per_bulk) { + warmup_count++; + continue; + } + delta = ack_date < pulse_date ? ~pulse_date + 1 + ack_date : ack_date - pulse_date; delta_ns = (u32_t)k_cyc_to_ns_floor64(delta);