This is the mail archive of the systemtap@sourceware.org mailing list for the systemtap project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: simple (dumb) script to track sizes of IOs


Frank Ch. Eigler wrote:
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?

Yes.




[...]
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]) # ...
# }


Does this functionality exists today ?



[...]# 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.

Thanks. Is there some documentation on the allowed syntax and library functions ?

Thanks,
Badari


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]