views:

30

answers:

2

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.

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

A: 

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.

ruslik
+1  A: 

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.

Paul Betts