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]

Measuring semaphore contention times with markers


FWIW... Here's a simple example of using markers to measure semaphore contention times. I don't claim that it's complete or efficient, just an example of an area where markers are useful.

This was originally written by a colleague to use kprobes. It probes in the middle of functions in some cases. The kprobes version hard coded those probe point addresses, requiring the addresses to be updated for each kernel. Using markers gets rid of all the address hard coding. I realize some of the markers could be handled by function entry kprobes. This is just for demonstration purposes.

The tarball includes:

2.6.21-mm2-markers-patches: Patches I applied to 2.6.21.1 to add marker support. Order shown in patch-order.txt.

kernel-sem-markers.patch:
	The actual semaphore markers.

sem_watch.c/Makefile:
	The marker handlers module.

log.out:
	Example output.

To try it out:
	- apply all the kernel patches, build and reboot.
	- make
	- insmod sem_watch.ko
	- do something that generates contentions (tar zxvf sometarball.tgz for example).
	- rmmod sem_watch
	- look at /var/log/messages for output

Mike Mason

Attachment: sem-markers.tgz
Description: application/compressed


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