3

When running valgrind --tool=massif benchmark1 --massif-out-file=test.out on MacOS (10.12.6) with version valgrind-3.13.0, output is produced, but only in the default filename format, i.e. massif.out.\d+. No test.out file is generated. Exemplary output is:

==32233== Massif, a heap profiler
==32233== Copyright (C) 2003-2017, and GNU GPL'd, by Nicholas Nethercote
==32233== Using Valgrind-3.13.0 and LibVEX; rerun with -h for copyright info
==32233== Command: benchmark1 --massif-out-file=./test.out
==32233==

What am I missing, or is this feature ignored for the MacOS version? I tried also to put the file name in quotes with no success.

2 Answers2

4

According to the trace above, you have given the valgrind --massif-out-file=./test.out option to benchmark1, which has probably silently ignored it.

You have to do:

   valgrind ...valgrind options...   your_program ....your program options....

So, try something like:

valgrind --tool=massif --massif-out-file=./test.out benchmark1
phd
  • 3,669
  • 1
  • 11
  • 12
1

After working with some valgrind tools (memcheck and massif), I found that we must follow follow it's rule:

valgrind --tool=... valgrind_option=... your_program program_argument
Fading
  • 51
  • 3