[dpdk-dev] DPDK (and rte_*alloc family) friendly Valgrind

Matthew Hall mhall at mhcomputing.net
Sat Feb 13 20:59:42 CET 2016


On Feb 13, 2016, at 4:30 AM, Luca Boccassi <lboccass at Brocade.com> wrote:
> I have not, however, implemented support for NUMA sockets. There is no
> such concept inside Valgrind's framework at the moment, so it would be a
> monumental task.

There is a way to mark the mallocs and frees from inside a custom allocator instead of remapping to valgrind's allocator. jemalloc uses this if you enable it. I use jemalloc with my DPDK code for all the variable-sized mallocs as I prefer it to librte_malloc, and valgrind works fine on all those allocs because jemalloc calls the hinter functions. 

include/jemalloc/internal/jemalloc_internal.h
look for #ifdef JEMALLOC_VALGRIND

> This might have an effect on cachegrind though, so it's worth noting and
> bearing it in mind when using cachegrind rather than memcheck.

I am not sure that's much of a limitation really, because nobody would use cachegrind on DPDK code I wouldn't think. Instead you would use freely available VTune for open-source or you would use the perf subsystem to monitor the cache performance counters. The only thing I am aware of that Valgrind does, that the performance hardware cannot also do, is memcheck. Unless I missed anything.

Either way this is very handy to have.

Matthew.


More information about the dev mailing list