开发者

How to get the total time an application spends on reading/writing from/to the file system?

I am now profiling an application, who does a lot of disk I/O.

At this point, I want to know how much time is spent on disk I/O. So that, I could make a comparison between I/O and the whole execution time, in order to decide the next target of optimization.

In short, I am seeking tools or methods to:

  1. Calculate and summary the total time of disk I/O operations of my application.
  2. Stack trace is not mandatory but helpful
  3. Works on Windows or OSX.
  4. 开发者_Python百科

I have no control on the component who does disk I/O operations. So I have no way to add profiling codes into my application to record I/O time manually.

I have tried the time profiler from Xcode Instruments. But it is too heavy. I just want a summary time of the I/O operations.

Thanks


Use XPerf on Windows to tell you in excruciating detail about the file I/O times. You can get stack traces with this as well - there's a great PDC09 video on using XPerf by Michael Milrud.


I've wrote once some simple hooks for ReadFile/WriteFile under Win32. You just have to call an init() function from the main and the calls from the whole process will be intercepted. I just don't know how to post them, because they are quite large.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜