Modify the command to start Copter in

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 can cover all the codes. I want to combine callgrind with autotest. However, if you run the directly, callgrind cannot monitor the Copter. So I want to add callgrind before the command to start the copter binary file in, but I don’t know how to modify the python code.
Can someone guide me,thank you very much!


We already have an option on to run valgrind or callgrind : see ardupilot/ at master · ArduPilot/ardupilot · GitHub and Autotest Framework — Dev documentation

Say us if more info is needed to make it run !


Thank you very much! It helped me a lot

Sorry to bother you again. I tried to run --callgrind test. Copter
[Errno2] No such file or directory: ‘arducopter-±valgrind.log’