This is the mail archive of the systemtap@sources.redhat.com 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]

kprobe example watching block device access


I am working on an article describing how kprobe works. As a part of the article I wanted to make an example showing how it might be used to gather information.

I have an example module working tracking the number of generic_make_request() calls and sectors transferred on a per device basis. It takes advantage of the current serial nature of the kprobe execution. It writes the data out when the module is removed. With the kernel-devel rpm I was able to build the module with:

make -C /lib/modules/`uname -r`/build M=`pwd` modules

# /sbin/insmod kprobebio.ko
# /sbin/rmmod kprobebio
# tail /var/log/messages
Feb 22 18:38:58 slingshot kernel: plant jprobe at c024f900, handler addr e09e4000
Feb 22 18:39:50 slingshot kernel: jprobe unregistered
Feb 22 18:39:50 slingshot kernel: generic_make_request() called 9831 times for 79064 sectors.
Feb 22 18:39:50 slingshot kernel: bdev 0xdb404da8 (3,5) 9503 76024 sectors.
Feb 22 18:39:50 slingshot kernel: bdev 0xdbf44da8 (3,3) 53 424 sectors.
Feb 22 18:39:50 slingshot kernel: bdev 0xdf011da8 (3,2) 275 2616 sectors.


I have attached a compress tarball of the module to this email. I am interested in comments on the module.

-Will

Attachment: kprobebio.tar.gz
Description: Unix tar archive


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