This method will tell you.
Just pause it like 10 times.
Each time look at the stack.
If you catch it in the process of doing IO on, say, 6 of those pauses, that means about 60% of its time is in IO.
If you want to know how much of that was spent in IO requested by function F, just count the number of samples that were doing IO when function F was on the stack.
(gprof will not tell you this, because it suspends sampling during IO.)
Added: Alternatively, you could just stub out the IO calls in function F, and measure overall time with and without IO.