Boot-time probing with SystemTap

William Cohen wcohen@redhat.com
Fri Jan 19 21:59:00 GMT 2007


William Cohen wrote:

<... snip ...>
 > Using the lessons from bootchart there can be some things done to make
 > SystemTap provide information to quickly focus attention to problem
 > areas (BZ#2035).  Want systemtap boot up probing as easy to use as
 > bootchart.  Key requirements are:
 >
 > - Simplify the SystemTap boot probe install steps to a simple command line.
 > - Have the startup show the SystemTap bootprobe option as grub entry
 > - Have method that automatically shuts down the probe:
 >     -user defined script/function test function called when probe started
 >         -e.g. stop data collection when particular process starts
 >     -when script/function returns kill probe

I have written a couple simple-minded scripts, create_boottap and delete_boottap 
to simplify this process. Both of the scripts need to be run as root because 
they modify grub entries.

create_boottap dir_name exit_condition script.stp "options for stap"

creates a directory "dir_name". In that directory it puts the kernel module, an 
initscript and a directory to store output. The exit_condition is shell command 
  to execute, when exit_condition exits, the systemtap script is killed. 
script.stp is the actual script. Anything else on the line is passed as options 
to stap when building compiling the SystemTap script. Below is an example line:

# ~/bin/create_boottap /boottap3 'sleep 100' \
/home/wcohen/systemtap_write/src/examples/iotime.stp

When rebooting the machine there will be an entry with SystemTap base name in 
the grub menu. Select this and the boot up will be done with the systemtap 
script running. Data will be stored in dir_name/data/boottap.log

delete_boottap dir_name

delete_boottap removes the directory holding the instrumentation module and 
initscript. This will also remove the data in dir_name/data.

The lookingfor script is a little script that can be used to look for a 
particular process running indicating that the instrumentation can shut down. 
This looks once every 5 seconds, so it might not catch short running processes.

-Will
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: create_boottap
URL: <http://sourceware.org/pipermail/systemtap/attachments/20070119/3f7db823/attachment.ksh>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: delete_boottap
URL: <http://sourceware.org/pipermail/systemtap/attachments/20070119/3f7db823/attachment-0001.ksh>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: lookingfor
URL: <http://sourceware.org/pipermail/systemtap/attachments/20070119/3f7db823/attachment-0002.ksh>


More information about the Systemtap mailing list