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]

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()
}

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