[Trac #83] Systemtap in the OLPC kernel.

Zarro Boogs per Child bugtracker at laptop.org
Fri Sep 15 19:30:57 EDT 2006


#83: Systemtap in the OLPC kernel.
----------------------------+-----------------------------------------------
 Reporter:  cjb             |        Owner:  cjb     
     Type:  enhancement     |       Status:  assigned
 Priority:  normal          |    Milestone:  beta    
Component:  infrastructure  |   Resolution:          
 Keywords:                  |  
----------------------------+-----------------------------------------------
Changes (by cjb):

  * status:  new => assigned

Comment:

 I have systemtap running on my developer board now.  I'm compiling the
 systemtap scripts on a laptop.org machine and shipping the generated .ko
 files to my board and running them there, which means that we don't
 require a compiler on the OLPC itself.  This will make it easy to run
 systemtap on ordinary build images as they're produced.

 The first systemtap probe I ran was the following, which hooks into
 open(2) and logs which files are being opened by which processes:
 {{{

 probe kernel.function("sys_open") {
   if ($flags & 1) {
     print(execname() . " writes " . user_string($filename) . "\n")
   } else {
     print(execname() . " reads " . user_string($filename) . "\n")
   }
 }

 }}}
 I hit ctrl+alt+BS at the start of the script, triggering an X/Sugar
 reload.  Here's the resulting output:

    http://www.inference.phy.cam.ac.uk/cjb/whichfiles.output

 And here's an overview.  There's one line per file read or written to:
 {{{

 % wc -l whichfiles.output
 7677 whichfiles.output
 % grep ' writes ' whichfiles.output | wc -l
 38
 % perl -le 'while(<>) { m/^(.*) reads/; $count{$1}++; } foreach (keys
   %count) { print "$count{$_} $_" }' < whichfiles.output | sort -rn
 3575 sugar
 3280 sugar-presence-
 156 matchbox-window
 125 X
 [..]

 }}}
 I did have to recompile the OLPC kernel to add CONFIG_KPROBES and
 CONFIG_DEBUG_INFO, which are required for Systemtap.  Marcelo, what
 do you think about adding these to the standard build?

-- 
Ticket URL: <http://dev.laptop.org/ticket/83#comment:5>
One Laptop Per Child <http://laptop.org/>



More information about the Devel mailing list