This is the mail archive of the
systemtap@sourceware.org
mailing list for the systemtap project.
Tracing through init transitions
- From: "Alan D. Brunelle" <alan dot brunelle at hp dot com>
- To: systemtap at sources dot redhat dot com
- Date: Fri, 30 Apr 2010 15:44:45 -0400
- Subject: Tracing through init transitions
I'm trying to trace the opening of files under /proc & /sys during the
transition from single-user to run level 3, but either the tracing
doesn't start or gets killed. I've tried various means of trying to
daemonize the systemtap run (including starting this via an rc script
utilizing the "daemon" function, and trying the -F option), but nothing
I've tried seems to work.
Any suggestions?
Thanks (please CC me as I'm no longer on the systemtap mailing list),
Alan
PS. I've attached the script, although I doubt there's anything
particular in there that would make a difference...
#! /usr/bin env stap
global opens[4000]
function print_opens() {
foreach ([exe, fn, wr] in opens-) {
if (wr) str = "WR"
else str = "RD"
printf("%4d %-20s: %s %s\n", opens[exe, fn, wr], exe, str, fn)
}
}
probe kernel.function("sys_open") {
fn = user_string($filename)
if (substr(fn, 0, 6) == "/proc/" || substr(fn, 0, 5) == "/sys/")
opens[execname(), fn, $flags & 1] ++
}
probe end {
print_opens()
exit()
}