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:
- Calculate and summary the total time of disk I/O operations of my application.
- Stack trace is not mandatory but helpful
- Works on Windows or OSX. 开发者_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.
精彩评论