Version: 3.1.0 (using KDE Devel) Installed from: Compiled sources When profiling large applications with numerous dependancies and ancillaries, it's very tedious to list out --alloc-fn entries one by one, even in the cases where they can simply be written once to .valgrindrc. For example, the only time I ever care about glib functions in any sense other than as allocs is when I'm profiling glib itself. Otherwise, I'd much rather use --alloc-fn="^g_" than write out scores of g_* functions, the other g_* functions they call, the other g_* functions that those call, and eventually in turn the base allocators like g_malloc. As another example, when multiple non-utility function libraries are in use (like, say, freetype and glib) as dependancies of the application of interest, with regex matching turned on I could just use --alloc-fn='alloc' or with wildcard matching --alloc-fn='*alloc*' to match g_malloc0 and ft_malloc alike.
Created attachment 18187 [details] Patch adding --alloc-pattern
Patch attached to accomplish this. The harcoded limit of 32 alloc functions is inadequate for many C++ programs using STL containers, besides the considerable nuisance of having to find and list them all by trial and error.
Created attachment 18188 [details] Patch adding --alloc-pattern (revised) Slight fix to previous patch, removes a deliberate break of the operator new pattern I had put in for debugging
Firstly the code now uses XArrays so the size is no longer fixed. Secondly the “new*” wildcard is a really bad idea. It will match placement new which most definitely is not an allocating function. Having said that there are clearly many missing allocators in the list.