Valgrind 调用

在项目的运行设置中为所有项目全局或为每个项目单独设置Valgrind首选项。

要为 Valgrind 设置全局首选项,请选择首选项>Analyzer >Valgrind 。在Callgrind Profiling Options 中设置 Callgrind 首选项。

分析仪偏好设置中 Valgrind 选项卡的 Callgrind 分析选项

KCachegrind executable 字段中,输入要启动的 KCachegrind 可执行文件的路径。

Extra Callgrind arguments 中,指定用于启动可执行文件的附加参数。

Result view: Minimum event costVisualization: Minimum event cost 字段中,限制剖析器显示和可视化的结果数量,以提高剖析器性能。

要在工具提示中显示有关事件的其他信息,请选择Show additional information for events in tooltips

要收集系统调用时间信息,请选择Collect system call time 。要收集执行的事件类型为Ge 的全局总线事件数,请选择Collect global bus events

启用全缓存模拟

默认情况下,只计算指令读取访问 (Ir)。要完全模拟高速缓存,请选择Enable cache simulation 复选框。这将启用以下附加事件计数器:

  • 指令读取时的高速缓存缺失 (I1mr/I2mr)
  • 数据读取访问 (Dr) 和相关缓存未命中 (D1mr/D2mr)
  • 数据写入访问 (Dw) 和相关缓存未命中 (D1mw/D2mw)

启用分支预测模拟

要启用以下附加事件计数器,请选择Enable branch prediction simulation 复选框:

  • 执行的条件分支数和相关预测器未命中数 (Bc/Bcm)
  • 已执行的间接跳转和跳转地址预测器的相关未命中次数 (Bi/Bim)

另请参阅 "分析 CPU 使用情况"、"使用 Memcheck 检测内存泄漏"、"分离视图"、"在外部应用程序上运行 Valgrind 工具"、"为项目指定 Valgrind 设置"和 "Valgrind Memcheck"

Copyright © The Qt Company Ltd. and other contributors. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.