Gary-Hobson opened a new pull request, #18150: URL: https://github.com/apache/nuttx/pull/18150
## Summary This PR adds comprehensive GNU gprof profiling support to NuttX, including documentation, tooling, and example configurations. ### Changes: - **Documentation**: Add complete gprof usage guide covering flat profile, call graph analysis, and configuration options - **Tooling**: Add hexdump2bin.py utility to extract binary profiling data from serial console hexdump output - **Architecture Support**: Add Cortex-M0/M23 support to arch_mcount for ARMv6-M and ARMv8-M Baseline architectures - **Compiler Support**: Add no_profile_instrument_function attribute to inline functions to prevent recursion issues - **Board Examples**: Enable gprof in mps2-an500/nsh and qemu-armv7a/nsh configurations with CoreMark benchmark The documentation provides step-by-step examples for: - Profiling CoreMark benchmark with flat profile analysis - System call graph analysis with CONFIG_PROFILE_ALL - Per-module profiling with selective -pg compiler flags - Recovering profiling data from serial console when file export is unavailable ## Impact - **Features**: Adds GNU gprof performance profiling capability to NuttX, enabling developers to identify performance hotspots and analyze function call relationships - **User Experience**: Provides comprehensive documentation and working examples, making it easy for developers to profile their applications - **Build**: No impact on default builds; gprof support is opt-in via CONFIG_PROFILE_MINI/CONFIG_PROFILE_ALL - **Hardware**: Extends ARM Cortex-M support to include M0/M0+/M23 cores; tested on QEMU ARMv7-A and MPS2-AN500 - **Documentation**: Adds new Documentation/debugging/gprof.rst with complete usage guide - **Security**: No security implications - **Compatibility**: Fully backward compatible; no changes to existing APIs or default behavior ## Testing - Tested on qemu-armv7a with CoreMark benchmark, successfully generated flat profile showing function execution time distribution - Tested on mps2-an500 (Cortex-M7) with system profiling, verified call graph analysis with CONFIG_PROFILE_ALL - Verified hexdump2bin.py tool successfully converts serial console hexdump output to gmon.out format - All commits pass ./tools/checkpatch.sh validation -- 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]
