【问题标题】:How to use valgrind's massif-out-file option correctly?如何正确使用 valgrind 的 massif-out-file 选项?
【发布时间】:2019-01-07 11:43:34
【问题描述】:

在带有版本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 版本忽略了此功能?我还尝试将文件名放在引号中,但没有成功。

【问题讨论】:

    标签: valgrind massif


    【解决方案1】:

    根据上面的跟踪,您已经给出了 valgrind --massif-out-file=./test.out benchmark1 的选项,它可能默默地忽略了它。

    你必须这样做:

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

    所以,试试这样的:

    valgrind --tool=massif --massif-out-file=./test.out benchmark1
    

    【讨论】:

      【解决方案2】:

      在使用了一些 valgrind 工具(memcheck 和 massif)之后,我发现我们必须遵循它的规则:

      valgrind --tool=... valgrind_option=... your_program program_argument
      

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2015-08-30
        • 1970-01-01
        • 2014-09-16
        • 2010-12-10
        相关资源
        最近更新 更多