Valgrind Massif结合快照

时间:2019-06-20 00:55:25

标签: valgrind massif

我正在尝试使用massif工具分析应用程序。我使用以下命令运行它:

./valgrind.bin  --tool=massif --stacks=yes --heap=yes --trace-children=yes --vgdb=yes /usr/bin/agl_proxy

该应用程序运行了很长时间。通常,当应用程序接收到中断信号时,它将完全完成,massif会生成带有许多快照的配置文件:

desc: --stacks=yes --heap=yes
cmd: /usr/bin/app
time_unit: i
#-----------
snapshot=0
#-----------
time=0
mem_heap_B=0
mem_heap_extra_B=0
mem_stacks_B=0
heap_tree=empty
#-----------
snapshot=1
#-----------
time=4501979
mem_heap_B=0
mem_heap_extra_B=0
mem_stacks_B=1480
heap_tree=empty

但是,此特定应用程序只是在没有正确退出的情况下转储并挂起,因此没有会正确生成结果文件。我可以在应用程序运行时使用vgdb获取快照。但是它只生成一个快照。

有什么办法可以合并快照?我尝试将快照添加到带有snapshot=#标头的文件中,但是MassifVisualizer抱怨格式。也许可以选择组合它们或某些工具。

1 个答案:

答案 0 :(得分:1)

使用vgdb,您可以要求massif使用以下监视请求转储所有快照:

all_snapshots [<filename>] requests to take all captured snapshots so far and save them in the given <filename> (default massif.vgdb.out).