确定线程的执行时间和不同线程的IO访问 [英] Determining execution time of a thread and IO accesses by different threads
本文介绍了确定线程的执行时间和不同线程的IO访问的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想确定多线程程序中线程的执行时间,并且我还想了解每个线程进行的IO访问.
I want to determine execution time of a thread in a multi-threaded program, and I also want to know about IO accesses made by each thread.
是否有任何命令/工具可以对C程序执行此操作?
Is there any command/tool which can do this for C programs?
推荐答案
要确定执行情况,您可以尝试 valgrind (特别是callgrind模块).还有一个用于输出的整洁的可视化工具,名为 KCacheGrind
For determining the execution you could try valgrind (specifically the callgrind module). There is also a neat visualization tool for the output called KCacheGrind
要监视IO访问,可以使用 strace .
For monitoring IO access you could use strace.
这篇关于确定线程的执行时间和不同线程的IO访问的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文