I want to use callgrind to obtain the method call graph of arduopter. Originally, running the following command could start the copter, and callgrind could monitor the method call graph when the binary file is running.
valgrind --tool=callgrind ./arducopter -S --model + --speedup 1 --defaults …/…/…/Tools/autotest/default_params/copter.parm -IO
Considering autotest.py can cover all the codes. I want to combine callgrind with autotest. However, if you run the autotest.py directly, callgrind cannot monitor the Copter. So I want to add callgrind before the command to start the copter binary file in autotest.py, but I don’t know how to modify the python code.
Can someone guide me,thank you very much!