From faf64a10d51ca7e808cdaf74cba8c31e1d61d6d6 Mon Sep 17 00:00:00 2001 From: yvesf Date: Sun, 4 Sep 2011 17:59:46 +0200 Subject: system iodelay (nur mit usbstick getestet) --- systemtap/ioblock_delay/device.stp | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100755 systemtap/ioblock_delay/device.stp (limited to 'systemtap/ioblock_delay/device.stp') diff --git a/systemtap/ioblock_delay/device.stp b/systemtap/ioblock_delay/device.stp new file mode 100755 index 0000000..b9270e5 --- /dev/null +++ b/systemtap/ioblock_delay/device.stp @@ -0,0 +1,31 @@ +// size of array equals to max. number of pending requests +global calls[30000]; + +probe begin { + printf("device,sector,time_ns\n"); +} + +probe ioblock.request +{ + if (devname == @1) { + calls[$bio] = gettimeofday_ns(); + } +} + +probe ioblock.end +{ + if ([$bio] in calls) { + time = gettimeofday_ns() - calls[$bio]; + delete calls[$bio]; + + printf("%s,%u,%ld\n", + devname, sector, time); + } +} + +probe end { + foreach ([bio] in calls) { + printf("# Lost: %s,%u,%u\n", + __bio_devname(bio), @cast(bio, "bio")->bi_sector, calls[bio]); + } +} -- cgit v1.2.1