Skip to content

Commit 10c73a4

Browse files
tbitcsoz-agent
andcommitted
debug: add raw bench_ns() debug print to diagnose zero timing
Co-Authored-By: Oz <oz-agent@warp.dev>
1 parent 7d8ea99 commit 10c73a4

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

  • tests/benchmarks/kalman_benchmark/src

tests/benchmarks/kalman_benchmark/src/main.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,15 @@ int main(void)
142142
LOG_INF("Iterations: %d (warmup: %d)", BENCH_ITERATIONS,
143143
WARMUP_ITERATIONS);
144144

145+
#ifdef CONFIG_NATIVE_SIMULATOR
146+
/* Debug: verify get_host_us_time() returns a non-zero advancing value */
147+
uint64_t dbg0 = bench_ns();
148+
uint64_t dbg1 = bench_ns();
149+
LOG_INF("bench_ns debug: t0_hi=%u t0_lo=%u dt_ns=%llu",
150+
(uint32_t)(dbg0 >> 32), (uint32_t)(dbg0 & 0xFFFFFFFF),
151+
dbg1 - dbg0);
152+
#endif
153+
145154
/* ----- Hand-coded Kalman benchmark ----- */
146155
struct hand_kf hkf;
147156
int32_t true_val = 0;

0 commit comments

Comments
 (0)