mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-20 14:13:34 +08:00
worst case analysis of stack usage (#7883)
* Makefile target "check_stack"
This commit is contained in:
committed by
Daniel Agar
parent
24ed06156e
commit
ceeae7587e
@@ -363,6 +363,21 @@ cppcheck: posix_sitl_default
|
||||
@cppcheck -i$(SRC_DIR)/src/examples --std=c++11 --std=c99 --std=posix --project=build_posix_sitl_default/compile_commands.json --xml-version=2 2> cppcheck-result.xml
|
||||
@cppcheck-htmlreport --source-encoding=ascii --file=cppcheck-result.xml --report-dir=cppcheck --source-dir=$(SRC_DIR)/src/
|
||||
|
||||
check_stack: px4fmu-v3_default
|
||||
@echo "Checking worst case stack usage with avstack.pl ..."
|
||||
@echo " "
|
||||
@cd build_px4fmu-v3_default/ && mkdir -p stack_usage && $(SRC_DIR)/Tools/stack_usage/avstack.pl `find . -name *.obj` > stack_usage/avstack_output.txt 2> stack_usage/avstack_errors.txt
|
||||
@head -n 10 build_px4fmu-v3_default/stack_usage/avstack_output.txt | c++filt
|
||||
@echo " "
|
||||
@echo "Checking worst case stack usage with checkstack.pl ..."
|
||||
@echo " "
|
||||
@echo "Top 10:"
|
||||
@cd build_px4fmu-v3_default/ && mkdir -p stack_usage && arm-none-eabi-objdump -d src/firmware/nuttx/firmware_nuttx | $(SRC_DIR)/Tools/stack_usage/checkstack.pl arm 0 > stack_usage/checkstack_output.txt 2> stack_usage/checkstack_errors.txt
|
||||
@head -n 10 build_px4fmu-v3_default/stack_usage/checkstack_output.txt | c++filt
|
||||
@echo " "
|
||||
@echo "Symbols with 'main', 'thread' or 'task':"
|
||||
@cat build_px4fmu-v3_default/stack_usage/checkstack_output.txt | c++filt | grep -E 'thread|main|task'
|
||||
|
||||
# Cleanup
|
||||
# --------------------------------------------------------------------
|
||||
.PHONY: clean submodulesclean distclean
|
||||
|
||||
Reference in New Issue
Block a user