I have ran the C example provided in massif docs https://valgrind.org/docs/manual/ms-manual.html and it works as expected. However it shows??? for this simple c++ program.
main.cc
#include <string>
int main() { std::string s{"hi i am a long string do not optimize me"}; }
command line
g++ -g -std=c++17 -o main main.cc
valgrind --tool=massif ./main
relevant massif output
#-----------
snapshot=3
#-----------
time=2348873
mem_heap_B=72745
mem_heap_extra_B=23
mem_stacks_B=0
heap_tree=peak
n2: 72745 (heap allocation functions) malloc/new/new[], --alloc-fns, etc.
n1: 72704 0x4909A69: ??? (in /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.28)
n1: 72704 0x4011B99: call_init.part.0 (dl-init.c:72)
n1: 72704 0x4011CA0: call_init (dl-init.c:30)
n1: 72704 0x4011CA0: _dl_init (dl-init.c:119)
n0: 72704 0x4001139: ??? (in /usr/lib/x86_64-linux-gnu/ld-2.31.so)
n0: 41 in 1 place, below massif's threshold (1.00%)
#-----------
-fno-omit-frame-pointer
for g++ and valgrind --keep-debuginfo=yes
does not help.
valgrind version 3.24.0; gcc version 9.4.0