maxikrie opened a new pull request, #3929:
URL: https://github.com/apache/nuttx-apps/pull/3929

   ## Summary
   
   Fixes points 1 and 3 of apache/nuttx-apps#3634:
   
   - With `USEC_PER_TICK` above 1000 (e.g. the Kconfig default 10000), 
`DEFAULT_INTERVAL` (1000 ticks) is longer than a second, so `DEFAULT_ITERATION` 
= `USEC_PER_SEC / DEFAULT_INTERVAL` = 0. `timerjitter` without arguments took 
no samples, divided 0 by 0 for the average (`nan`) and printed `min` at its 
start value (4294967295). It now runs at least one iteration, divides only when 
there are samples, and prints "no samples" otherwise.
   - `min`/`max` were `unsigned long` while the latency is a signed `int64_t`, 
so a negative latency (wakeup before the deadline) was stored and printed as a 
huge number. They are `int64_t` now, printed with `PRId64`.
   
   Point 2 of the issue (many missed frames with a 100 us interval) is the 
interval being shorter than a tick, not a bug in the test.
   
   ## Impact
   
   `testing/sched/timerjitter` only.
   
   ## Testing
   
   nRF52840-DK, `nrf52840-dk:nsh` (`USEC_PER_TICK=10000`) + 
`TESTING_TIMERJITTER`, nuttx b9d1d6a834, nuttx-apps e2d9f5cf1; 
`tools/checkpatch.sh -f` passes.
   
   ## Logs
   
   <details><summary>Before</summary>
   
   ```
   nsh> timerjitter
   timer jitter in 0 run:
   (latency/us) min: 4294967295, avg: *float*, max 0
   nsh> timerjitter 10000 200
   timer jitter in 200 run:
   (latency/us) min: 6409, avg: *float*, max 6409
   ```
   (`*float*`: that build had no `LIBC_FLOATINGPOINT`. The average there is 
0/0, which the issue shows printed as `nan`.)
   </details>
   
   <details><summary>After (with LIBC_FLOATINGPOINT)</summary>
   
   ```
   nsh> timerjitter
   timer jitter in 1 run:
   (latency/us) min: 4463, avg: 4463, max 4463
   nsh> timerjitter 10000 200
   timer jitter in 200 run:
   (latency/us) min: 9863, avg: 9863, max 9863
   nsh> timerjitter 20000 50
   timer jitter in 50 run:
   (latency/us) min: 6604, avg: 6604, max 6605
   ```
   </details>


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to