Finding what's causing I/O

Eric Anderson anderson at centtech.com
Fri Sep 23 05:28:03 PDT 2005


Francisco Reyes wrote:
> On Fri, 23 Sep 2005, Joseph Koshy wrote:
> 
>>> Is there a way to find out which program(s) are causing
>>> the I/O?
>>
>>
>> ktrace(8); you can use it to trace all descendants of 'init'.
> 
> 
> Looking at the man page it's non-obvious how to use it (to me).
> 
> 
> Specially it seems one needs to indicate a pid or a command. How do I 
> trace all programs?

Maybe you provide the init pid, and the -i option.  I played with this a 
bit last night, and found out I really love this tool!  Here's what I 
did to play with it:

(find pid of a bash shell running - was 1268)
In another shell:
ktrace -tni -ip 1268

In ktraced shell:
cd /
cd /tmp
touch t
cat t
rm t

In ktrace shell window:
ktrace -C
kdump | less


That should give you a quick idea how to use it.  The man page is pretty 
decent.

Eric



-- 
------------------------------------------------------------------------
Eric Anderson        Sr. Systems Administrator        Centaur Technology
Anything that works is better than anything that doesn't.
------------------------------------------------------------------------


More information about the freebsd-performance mailing list