Subject: ktrace mods
To: None <tech-kern@netbsd.org>
From: Andrew Doran <ad@netbsd.org>
List: tech-kern
Date: 08/05/2007 21:37:38
Hi,
The following diff does roughly the following:
- eliminate opt_ktrace.h includes and ifdef KTRACE from most of the kernel
- provide stubs that can be called and do nothing if there is no ktrace
- don't require exposing proc/lwp or ktrace guts to ktrace feeders
- don't pass lwp_t * into each ktrace op
The main motivators for doing this are:
- eliminate a lot of ifdefs
- make it viable for LKMs to use/feed ktrace
- don't break ABI compatibility if struct proc/lwp or ktrace change
There's a global flag that's tested (ktrace_on) before any function calls
are made. In the common case (tracing off) it should be marginally cheaper.
http://www.netbsd.org/~ad/ktrace.diff
Comments?
Thanks,
Andrew