methodmissing opened a new pull request, #20522:
URL: https://github.com/apache/nuttx/pull/20522
## Summary
`CONFIG_ARCH_PERF_EVENTS` defaults to on for ARMv7-M, but the imxrt port
never calls
`up_perf_init()`, so the DWT cycle counter is never enabled and
`perf_gettime()` returns zero.
Anything timed with it reports nothing: `rpmsg ping` prints 0 ns for min,
average and maximum and a
rate of 4294.967295 Mbits/s. Call `up_perf_init()` with
`BOARD_CPU_FREQUENCY` in `imxrt_start.c`
after the MPU is set up, as samv7 and stm32h7 do. Every imxrt board defines
that macro.
Found while bringing up the RT1170 CM4 RPTUN backend (apache/nuttx#TBD);
independent of it.
## Impact
* New feature: NO. Existing feature changed: YES, perf counters on imxrt now
count.
* User: perf-timed output becomes meaningful. Build: NO. Hardware: imxrt,
all parts.
* Documentation: NO. Security: NO. Compatibility: NO.
## Testing
* Host: macOS, GNU Arm Embedded 9-2020-q2 (gcc 9.3.1), standalone
`fmu-v6xrt:rptun` on
apache/nuttx master with apache/nuttx-apps master.
* Target: Pixhawk 6X-RT (i.MX RT1176 rB0), stock nsh over USB CDC/ACM, with
the RT1170 RPTUN
backend and a CM4 remote to ping.
Logs before change:
```
nsh> rpmsg ping /dev/rpmsg/cm4 100 64 3 0
nsh> dmesg
ping times: 100
buffer_len: 1008, send_len: 64
avg: 0 s, 0 ns
min: 0 s, 0 ns
max: 0 s, 0 ns
rate: 4294.967295 Mbits/sec
```
Logs after change:
```
nsh> rpmsg ping /dev/rpmsg/cm4 100 64 3 0
nsh> dmesg
ping times: 100
buffer_len: 1008, send_len: 64
avg: 0 s, 18208 ns
min: 0 s, 16215 ns
max: 0 s, 47375 ns
rate: 28.119507 Mbits/sec
```
## PR verification Self-Check
* [x] This PR introduces only one functional change.
* [x] I have updated all required description fields above.
* [x] My PR adheres to Contributing Guidelines and Documentation.
* [ ] My PR is still work in progress (not ready for review).
* [x] My PR is ready for review and can be safely merged into a codebase.
--
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]