Generally, yes, using syscalls is a great way to profile the IO
load from your applications. You need to figure out which
calls they''re using - read(2), or pread(2), etc. Start with a
generic syscall profile, and go from there.
Once you have the system call profile, you can tweak your
dtrace to breakdown IO by file type, file system type, etc.
The fds[] array is a joy to use. Makes it very easy to build scripts
with simple predicates to profile disk versus network, etc.
For example
syscall::read:entry
/ fds[arg0].fi_fs == "ufs" /
{
@ufs_ios = count();
}
syscall::read:entry
/ fds[arg0].fi_fs == "sockfs" /
{
@net_ios = count();
}
....
You can profile on file pathnames easily using fds[arg0].fi_pathname.
Data rates, etc...all is possible with the proper dose of vitamin D.
:^)
/jim
Ferrand wrote:> Hye everybody,
>
> I just try to write a simple DTrace program to trace I/O from the
application point of view (and not the Disk Driver point of view (io::*:*
provider)).
>
> My first idea is to trace calls to syscall read and write.
> Is it enougth to trace efficiently all application I/O or not ?
>
> Thanks
> R.
>