在具有valgrind-3.13.0版本的MacOS (10.12.6)上运行valgrind --tool=massif benchmark1 --massif-out-file=test.out时,将生成输出,但仅以默认文件名格式生成,即massif.out.\d+。未生成任何test.out文件。示例输出为:
==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==我遗漏了什么,或者在MacOS版本中忽略了此功能?我还尝试将文件名放在引号中,但没有成功。
发布于 2018-08-29 05:45:21
根据上面的跟踪,您已经向benchmark1提供了valgrind --massif-out-file=./test.out选项,它可能已经默默地忽略了它。
你需要做的是:
valgrind ...valgrind options... your_program ....your program options....因此,尝试如下所示:
valgrind --tool=massif --massif-out-file=./test.out benchmark1发布于 2019-01-07 11:43:34
在使用了一些valgrind工具(memcheck和massif)之后,我发现我们必须遵循它的规则:
valgrind --tool=... valgrind_option=... your_program program_argumenthttps://stackoverflow.com/questions/52063507
复制相似问题