track program execution
- ardthusiast
- Posts: 25
- Joined: Tue Feb 08, 2022 4:13 pm
track program execution
Hello, I was wondering if there's a way to track the execution of Micropython code. Similar to this CPython library.
Re: track program execution
Thonny has some built it program tracking but I find it's hard to beat a few well placed print statements. See also viewtopic.php?f=2&t=12411
Re: track program execution
If you build with MICROPY_PY_SYS_SETTRACE defined (e.g. make CFLAGS_EXTRA="-DMICROPY_PY_SYS_SETTRACE=1") the sys.settrace (https://docs.python.org/3/library/sys.html#sys.settrace) functionality becomes available. Not completely the same as the trace module, but does track all calls. You can use the test to get an idea what the output is: https://github.com/micropython/micropyt ... eatures.py