CV-Bowen opened a new pull request, #22353:
URL: https://github.com/apache/nuttx/pull/22353
## Summary
Under BMP every CPU runs its own kernel instance, so when a panic hits
several
CPUs at once each of them runs `dump_core_info()`, and the coredumps they
write
to syslog or the storage device interleave.
Add `BOARD_COREDUMP_CPUID`, available only when BMP is enabled and the board
dumps a core at all. When it is set to a CPU index, only that CPU runs the
coredump; the other CPUs call `dump_core_info()` and return. The default,
`-1`, keeps the current behaviour.
BMP is already in the tree (`sched/Kconfig`, "Bound Multi-Processing"), so
the
option has a real dependency; no board enables BMP in its defconfig yet.
## Impact
- With `BOARD_COREDUMP_CPUID` unset (`-1`) the generated code is unchanged.
- With it set, the CPUs that are not chosen skip `board_crashdump()` and
`coredump_dump()`; their syslog output up to that point is still emitted.
- Kconfig only: the option does not exist unless BMP and a coredump method
are
both selected, so other configurations are unaffected.
## Testing
Host: Ubuntu 22.04.5 LTS x86_64; arm-none-eabi-gcc 10.3-2021.10;
`boards/arm/imx6/sabre-6quad`, `nsh` with `CONFIG_BMP=y`,
`CONFIG_SMP_NCPUS=2`, `CONFIG_COREDUMP=y`, `CONFIG_BOARD_COREDUMP_SYSLOG=y`.
No upstream board enables BMP, and `sim` cannot build `CONFIG_COREDUMP`
(`elf_gregset_t` does not exist there), so the check is on the generated
code.
`CONFIG_BOARD_COREDUMP_CPUID=1`, `_assert()`:
```
10801a00: mrc 15, 0, r3, cr0, cr0, {5} @ MPIDR
10801a04: and.w r3, r3, #7
10801a08: cmp r3, #1
10801a0a: bne.n 10801a18 <_assert+0x2b8> @ not CPU 1: no coredump
10801a0c: mov.w r0, #4294967295
10801a10: bl 10802238 <coredump_dump>
```
`CONFIG_BOARD_COREDUMP_CPUID=-1`, same configuration:
```
10801a00: mov.w r0, #4294967295
10801a04: bl 1080222c <coredump_dump>
```
No CPU check, the call is unconditional, and the section is 16 bytes larger
in
the guarded build.
Both builds finish with 0 errors (the one warning is the pre-existing
`arm_cache.c` "This is insufficient").
--
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]