This sounds interesting but not terribly clear to me.
First off, this is going to have to be a OS-centric approach. What OS/Hardware do you have?
The reason I ask is dtrace runs on some platforms - iosnoop and other tools written in dtrace can do exactly what you ask - assuming I understand it. dtrace is based partially on awk syntax. (see
http://dtrace.org/blogs/brendan/2012...race-training/)
http://dtrace.org in general.
My take on what you need for a given pid, correct me where I am wrong:
time spent in I/O == (sum of I/O queue waits)/(unit time).
And again, a SAN can handle larger number of direct I/O requests than a single physical disk without much degradation of perofrmance. So I dunno too much here.