Commit b50c987
fix(benchmarks): use nsi_host_clock_gettime to bypass all native_sim time interception
native_sim intercepts both clock_gettime() AND the syscall() C function to
return simulated Zephyr time. The raw syscall approach also failed because
native_sim overrides the syscall() C function itself.
nsi_host_clock_gettime() is native_sim's own built-in escape hatch: it calls
the real host OS clock_gettime() via the original libc function that was saved
before any intercept. This is the correct and documented way to get real host
time from within native_sim firmware code.
Co-Authored-By: Oz <oz-agent@warp.dev>1 parent 69ac0dc commit b50c987
2 files changed
Lines changed: 8 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
22 | | - | |
23 | | - | |
24 | | - | |
25 | | - | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
26 | 26 | | |
27 | 27 | | |
28 | | - | |
| 28 | + | |
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
32 | | - | |
| 32 | + | |
33 | 33 | | |
34 | 34 | | |
35 | 35 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
26 | | - | |
| 26 | + | |
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
30 | | - | |
| 30 | + | |
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
| |||
0 commit comments