确定线程的执行时间和不同线程的IO访问

编程入门 行业动态 更新时间:2024-10-22 11:32:13
本文介绍了确定线程的执行时间和不同线程的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访问

本文发布于:2023-11-12 12:27:42,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1581499.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:线程   执行时间   IO

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!