This is the mail archive of the
systemtap@sourceware.org
mailing list for the systemtap project.
Re: simple (dumb) script to track sizes of IOs
- From: fche at redhat dot com (Frank Ch. Eigler)
- To: Badari Pulavarty <pbadari at us dot ibm dot com>
- Cc: systemtap at sources dot redhat dot com
- Date: 06 Oct 2005 13:27:03 -0400
- Subject: Re: simple (dumb) script to track sizes of IOs
- References: <1128617293.4754.101.camel@dyn9047017102.beaverton.ibm.com>
pbadari wrote:
> Here is a simple systemtap script to track the sizes of IOs
> that are getting generated (to the driver).
That's block i/o only right?
> [...]
> Is there a way, I can print in the order of IO sizes easily ?
There will be a way of iterating in a sorted order, probably
expressed syntactically like this:
# function report () {
# foreach (ascending(io) in iosizes) {
# if (iosizes[io]) # ...
# }
> [...]# stap -g iosizes.stp [...]
Your script does not need guru mode. Merely reading $rq->nr_sectors
is fine without that. You also don't need to check "if (iosizes[io])"
since zero-valued array elements do not appear in foreach()
iterations.
- FChE