valgrind on esp32?

phanikarthik
Posts: 4
Joined: Wed Oct 04, 2017 3:53 am

valgrind on esp32?

Postby phanikarthik » Wed Oct 04, 2017 4:04 am

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?

ESP_Sprite
Posts: 9761
Joined: Thu Nov 26, 2015 4:08 am

Re: valgrind on esp32?

Postby ESP_Sprite » Wed Oct 04, 2017 4:31 am

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.

phanikarthik
Posts: 4
Joined: Wed Oct 04, 2017 3:53 am

Re: valgrind on esp32?

Postby phanikarthik » Thu Oct 05, 2017 3:40 am

Thank you!

sohamc1909
Posts: 1
Joined: Sat Jul 29, 2023 12:33 pm

Re: valgrind on esp32?

Postby sohamc1909 » Sat Jul 29, 2023 12:35 pm

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: No registered users and 87 guests