This adds the utrace facility, a new modular interface in the kernel for
commite2f2cea4ab1d9164aebb643c499625a575f280ff
authorRoland McGrath <roland@redhat.com>
Fri, 25 Sep 2009 20:12:47 +0000 (25 22:12 +0200)
committerjames toy <toyj@union.edu>
Fri, 25 Sep 2009 20:12:47 +0000 (25 22:12 +0200)
tree3e5efbe8daa360af3b6730f88b25fc3e3e815464
parent417401dd94d9e6547d4e553f6667f8c80514a101
This adds the utrace facility, a new modular interface in the kernel for
implementing user thread tracing and debugging.  This fits on top of the
tracehook_* layer, so the new code is well-isolated.

The new interface is in <linux/utrace.h> and the DocBook utrace book
describes it.  It allows for multiple separate tracing engines to work in
parallel without interfering with each other.  Higher-level tracing
facilities can be implemented as loadable kernel modules using this layer.

The new facility is made optional under CONFIG_UTRACE.  When this is not
enabled, no new code is added.  It can only be enabled on machines that
have all the prerequisites and select CONFIG_HAVE_ARCH_TRACEHOOK.

In this initial version, utrace and ptrace do not play together at all.
If ptrace is attached to a thread, the attach calls in the utrace kernel
API return -EBUSY.  If utrace is attached to a thread, the PTRACE_ATTACH
or PTRACE_TRACEME request will return EBUSY to userland.  The old ptrace
code is otherwise unchanged and nothing using ptrace should be affected by
this patch as long as utrace is not used at the same time.  In the future
we can clean up the ptrace implementation and rework it to use the utrace
API.

[oleg@redhat.com: kill exclude_xtrace logic]
Signed-off-by: Roland McGrath <roland@redhat.com>
Signed-off-by: Oleg Nesterov <oleg@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
12 files changed:
Documentation/DocBook/Makefile
Documentation/DocBook/utrace.tmpl [new file with mode: 0644]
fs/proc/array.c
fs/proc/base.c
include/linux/init_task.h
include/linux/sched.h
include/linux/tracehook.h
include/linux/utrace.h [new file with mode: 0644]
include/linux/utrace_struct.h [new file with mode: 0644]
init/Kconfig
kernel/Makefile
kernel/utrace.c [new file with mode: 0644]