Reputation: 91
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.
Upvotes: 3
Views: 5451
Reputation: 59
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
Upvotes: 1
Reputation: 3807
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
Upvotes: 4