Fix check_stack target (#8050)

This commit is contained in:
Julien Lecoeur 2017-10-04 16:02:23 +02:00 committed by Daniel Agar
parent 93c1ad3103
commit 5d01eac5de
1 changed files with 3 additions and 8 deletions

View File

@ -357,19 +357,14 @@ cppcheck: posix_sitl_default
@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
@cd build/px4fmu-v3_default/ && mkdir -p stack_usage && arm-none-eabi-objdump -d nuttx_px4fmu-v3_default.elf | $(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'
@cat build/px4fmu-v3_default/stack_usage/checkstack_output.txt | c++filt | grep -E 'thread|main|task'
# Cleanup
# --------------------------------------------------------------------