Re: getting process i/o wasted time ...

From: Richard B. Johnson (root@chaos.analogic.com)
Date: Wed Mar 06 2002 - 14:44:02 EST


On Wed, 6 Mar 2002, Dario Bahena Tapia wrote:

> Hi linux hackers ...
>
> I'd like to know, if there's a way to get the ammount of time wasted by a
> process, while it was making i/o. I've seen that the rusage
> makes available the ammount of i/o blocks, but I'm thinking in something
> like:
>
> process warawara ...
> time wasted in disks i/o .... XXX
> time wasted in net i/o .... XXX
> etc. ???
>
> Doest it makes sense? it could be done in linux?
>
> I supposed ,that I can insert some system calls in the right places
> in the program to make this... but I'm interested in a non-intrusive
> method ...
>
> Thanks in advance
>
> saludos
> dario estepario ...

Time for I/O is not generally "wasted" as you say. It is given to
other tasks. Of course if there are no other tasks that want the
CPU then, I guess, you could call it wasted.

You can measure the time from when you make a system call to
the time your code gets control back. There are several
high-resolution (rdtsc) and low resolution (gettimeofday) ways
to do this.

Cheers,
Dick Johnson

Penguin : Linux version 2.4.18 on an i686 machine (799.53 BogoMips).

        Bill Gates? Who?

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Thu Mar 07 2002 - 21:00:56 EST