如何在linux上分析我的C ++应用程序 [英] How to profile my C++ application on linux

查看:174
本文介绍了如何在linux上分析我的C ++应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在linux上配置我的c ++应用程序。
我想知道我的应用程序花在CPU处理上的时间与IO /空闲时花费的时间的比较。

I would like to profile my c++ application on linux. I would like to find out how much time my application spent on CPU processing vs time spent on block by IO/being idle.

我知道有一个简介工具调用valgrind on linux。但它分解了花在每个方法上的时间,它不能给我一个总体的CPU处理和空闲花费的时间?

I know there is a profile tool call valgrind on linux. But it breaks down time spent on each method, and it does not give me an overall picture of how much time spent on CPU processing vs idle? Or is there a way to do that with valgrind.

推荐答案

我可以推荐 valgrind callgrind 工具与 KCacheGrind 可视化。 KCacheGrind很容易看出热点在哪里。

I can recommend valgrind's callgrind tool in conjunction with KCacheGrind for visualization. KCacheGrind makes it pretty easy to see where the hotspots are.

注意:由于我使用它太长,所以我不知道你能否得到I / O等待时间。也许与 iostat pidstat ,您将可以看到所有时间花在哪里。

Note: It's been too long since I used it, so I'm not sure if you'll be able to get I/O Wait time out of that. Perhaps in conjunction with iostat or pidstat you'll be able to see where all the time was spent.

这篇关于如何在linux上分析我的C ++应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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