]> git.hungrycats.org Git - linux/commit
[PATCH] kprobes base patch
authorPrasanna S. Panchamukhi <prasanna@in.ibm.com>
Tue, 31 Aug 2004 03:32:21 +0000 (20:32 -0700)
committerLinus Torvalds <torvalds@ppc970.osdl.org>
Tue, 31 Aug 2004 03:32:21 +0000 (20:32 -0700)
commit4ece58992befbbbc83f27a7c92a0353bdff1e3b6
treeb64bd099de4ea1c98e6d8a3b62f6a995e9482a15
parentf63b75f96ff101eb66c3a2ea3329d417eb899e38
[PATCH] kprobes base patch

This patch helps developers to trap at almost any kernel code address,
specifying a handler routine to be invoked when the breakpoint is hit.

Useful for analysing the Linux kernel by collecting debugging information
non-disruptively.  Employs single-stepping out-of-line to avoid probe
misses on SMP and may be especially useful in aiding debugging elusive
races and problems on live systems.  More elaborate dynamic tracing tools
such as DProbes can be built over the kprobes interface.

Helps developers to trap at almost any kernel code address, specifying a
handler routine to be invoked when the breakpoint is hit.  Useful for
analysing the Linux kernel by collecting debugging information
non-disruptively.  Employs single-stepping out-of-line to avoid probe
misses on SMP and may be especially useful in aiding debugging elusive
races and problems on live systems.  More elaborate dynamic tracing tools
such as DProbes can be built over the kprobes interface.

Sample usage:
To place a probe on __blockdev_direct_IO:
static int probe_handler(struct kprobe *p, struct pt_regs *)
{
... whatever ...
}
struct kprobe kp = {
.addr = __blockdev_direct_IO,
.pre_handler = probe_handler
};
register_kprobe(&kp);

Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
arch/i386/Kconfig.debug
arch/i386/kernel/Makefile
arch/i386/kernel/entry.S
arch/i386/kernel/kprobes.c [new file with mode: 0644]
arch/i386/kernel/traps.c
include/asm-i386/kprobes.h [new file with mode: 0644]
include/linux/kprobes.h [new file with mode: 0644]
kernel/Makefile
kernel/kprobes.c [new file with mode: 0644]