使用的valgrind知道时间(秒)花费在每个功能 [英] use valgrind to know time(in seconds) spent in each function

查看:232
本文介绍了使用的valgrind知道时间(秒)花费在每个功能的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有任何扩展的valgrind的,可以在命令窗口中使用,这将帮助我知道时间,以秒为单位,在度过了每个功能在我的C code?

is there any extension of valgrind, that can be used in the command window, that would help me know the time, in seconds, spent in each function in my C code?

感谢=)

推荐答案

有关机器指令剖析使用的valgrind的 callgrind (也 cachegrind 可以做缓存和分支prediction分析这是相当不错的)。

For machine instruction profiling use valgrind's callgrind (also, cachegrind can do cache and branch prediction profiling which is quite nice).

有关时间测量使用谷歌的CPU分析器,它提供了比gprof的方式更好的效果。您可以设置采样频率,它可以显示输出作为一个很好的注解调用图。

For time measurements use google's cpu profiler, it gives way better results than gprof. You can set sampling frequency and it can show the output as a nice annotated call graph.

这篇关于使用的valgrind知道时间(秒)花费在每个功能的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆