Hello all,
Iam using esp-idf-v2.1 along with xtensa-esp32-elf
Is it possible to use valgrind profiling tool on this platform?
(http://valgrind.org/info/platforms.html)
The above link does not mention xtensa as a supported platform. Do i have any alternatives?
valgrind on esp32?
-
- Posts: 9708
- Joined: Thu Nov 26, 2015 4:08 am
Re: valgrind on esp32?
I fear not. While Valgrind on the outside seems like a very simple tool, it actually does some proper Deeper Magic (tm) to get the job done: it decompiles the binary file into its own internal instruction set, modifies this decompiled binary to add a whole bunch of measurements and other tricks, then recompiles it on the fly back to the target processor. It's a proper powerhouse masquerading as a small programmers tool. Adding ESP32-support to it would not only mean adding just the Xtensa instruction set, but also finding memory and CPU time to allow it to do the recompilation things.
To get a similar behaviour, it depends a bit on what you want to get out of Valgrind. For the memory problem detector, we nowadays have a fairly advanced set of debugging things you can turn on. For thread concurrency issues, we can export Segger SystemView data over JTAG that may be of help. As a final option, if the bit of program you're trying to debug is heavy on algorithms but light on hardware interactions, you can always try to stub the hardware interface and recompile it as a PC program, to use Valgrind on it that way.
To get a similar behaviour, it depends a bit on what you want to get out of Valgrind. For the memory problem detector, we nowadays have a fairly advanced set of debugging things you can turn on. For thread concurrency issues, we can export Segger SystemView data over JTAG that may be of help. As a final option, if the bit of program you're trying to debug is heavy on algorithms but light on hardware interactions, you can always try to stub the hardware interface and recompile it as a PC program, to use Valgrind on it that way.
-
- Posts: 1
- Joined: Sat Jul 29, 2023 12:33 pm
Re: valgrind on esp32?
Hi, what do you mean by "stub" the hardware interactions? Sorry for bringing this up after so much time, but just curious.
Who is online
Users browsing this forum: Baidu [Spider], sohaib.q and 70 guests