rpms/kernel/devel kernel.spec, 1.1557, 1.1558 linux-2.6-utrace.patch, 1.111, 1.112
Roland McGrath
roland at fedoraproject.org
Tue Jun 2 20:43:23 UTC 2009
- Previous message (by thread): rpms/eclipse-epic/devel get-epic.sh, 1.7, 1.8 .cvsignore, 1.8, 1.9 sources, 1.8, 1.9 eclipse-epic.spec, 1.11, 1.12
- Next message (by thread): rpms/kernel/F-11/scripts pull-upstreams.sh,1.6,1.7
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
Author: roland
Update of /cvs/pkgs/rpms/kernel/devel
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv10377
Modified Files:
kernel.spec linux-2.6-utrace.patch
Log Message:
utrace update (fixes stap PR10185)
Index: kernel.spec
===================================================================
RCS file: /cvs/pkgs/rpms/kernel/devel/kernel.spec,v
retrieving revision 1.1557
retrieving revision 1.1558
diff -u -p -r1.1557 -r1.1558
--- kernel.spec 2 Jun 2009 17:10:08 -0000 1.1557
+++ kernel.spec 2 Jun 2009 20:42:52 -0000 1.1558
@@ -724,11 +724,10 @@ Requires: gzip
Kernel-bootwrapper contains the wrapper code which makes bootable "zImage"
files combining both kernel and initial ramdisk.
-%package debuginfo-common
+%package debuginfo-common-%{_target_cpu}
Summary: Kernel source files used by %{name}-debuginfo packages
Group: Development/Debug
-Provides: %{name}-debuginfo-common-%{_target_cpu} = %{version}-%{release}
-%description debuginfo-common
+%description debuginfo-common-%{_target_cpu}
This package is required by %{name}-debuginfo subpackages.
It provides the kernel source files common to all builds.
@@ -1543,7 +1542,7 @@ find Documentation -type d | xargs chmod
%if %{with_debuginfo}
%ifnarch noarch
%global __debug_package 1
-%files -f debugfiles.list debuginfo-common
+%files -f debugfiles.list debuginfo-common-%{_target_cpu}
%defattr(-,root,root)
%endif
%endif
@@ -1811,6 +1810,9 @@ fi
# ||----w |
# || ||
%changelog
+* Tue Jun 2 2009 Roland McGrath <roland at redhat.com>
+- utrace update (fixes stap PR10185)
+
* Tue Jun 02 2009 Dave Jones <davej at redhat.com>
- For reasons unknown, RT2X00 driver was being built-in.
Make it modular.
linux-2.6-utrace.patch:
Index: linux-2.6-utrace.patch
===================================================================
RCS file: /cvs/pkgs/rpms/kernel/devel/linux-2.6-utrace.patch,v
retrieving revision 1.111
retrieving revision 1.112
diff -u -p -r1.111 -r1.112
--- linux-2.6-utrace.patch 6 May 2009 16:39:12 -0000 1.111
+++ linux-2.6-utrace.patch 2 Jun 2009 20:42:52 -0000 1.112
@@ -1,5 +1,46 @@
+utrace core
+
+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.
+
+Signed-off-by: Roland McGrath <roland at redhat.com>
+---
+ Documentation/DocBook/Makefile | 2 +-
+ Documentation/DocBook/utrace.tmpl | 590 ++++++++++
+ fs/proc/array.c | 3 +
+ include/linux/init_task.h | 1 +
+ include/linux/sched.h | 6 +
+ include/linux/tracehook.h | 61 +-
+ include/linux/utrace.h | 692 +++++++++++
+ include/linux/utrace_struct.h | 58 +
+ init/Kconfig | 9 +
+ kernel/Makefile | 1 +
+ kernel/ptrace.c | 18 +-
+ kernel/utrace.c | 2357 +++++++++++++++++++++++++++++++++++++
+ 12 files changed, 3795 insertions(+), 3 deletions(-)
+
diff --git a/Documentation/DocBook/Makefile b/Documentation/DocBook/Makefile
-index b1eb661..02851f6 100644
+index b1eb661..02851f6 100644
--- a/Documentation/DocBook/Makefile
+++ b/Documentation/DocBook/Makefile
@@ -9,7 +9,7 @@
@@ -13,10 +54,10 @@ index b1eb661..02851f6 100644
mac80211.xml debugobjects.xml sh.xml regulator.xml \
diff --git a/Documentation/DocBook/utrace.tmpl b/Documentation/DocBook/utrace.tmpl
new file mode 100644
-index 0000000..b802c55
+index ...6cc58a1 100644
--- /dev/null
+++ b/Documentation/DocBook/utrace.tmpl
-@@ -0,0 +1,571 @@
+@@ -0,0 +1,590 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN"
+"http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd" []>
@@ -82,12 +123,12 @@ index 0000000..b802c55
+ <para>
+ Many engines can be attached to each thread. When a thread has an
+ event, each engine gets a callback if it has set the event flag for
-+ that event type. Engines are called in the order they attached.
-+ Engines that attach after the event has occurred do not get callbacks
-+ for that event. This includes any new engines just attached by an
-+ existing engine's callback function. Once the sequence of callbacks
-+ for that one event has completed, such new engines are then eligible in
-+ the next sequence that starts when there is another event.
++ that event type. For most events, engines are called in the order they
++ attached. Engines that attach after the event has occurred do not get
++ callbacks for that event. This includes any new engines just attached
++ by an existing engine's callback function. Once the sequence of
++ callbacks for that one event has completed, such new engines are then
++ eligible in the next sequence that starts when there is another event.
+ </para>
+
+ <para>
@@ -105,6 +146,25 @@ index 0000000..b802c55
+ <function>utrace_control</function> to resume the thread.
+ </para>
+
++ <para>
++ The <constant>UTRACE_EVENT(SYSCALL_ENTRY)</constant> event is a special
++ case. While other events happen in the kernel when it will return to
++ user mode soon, this event happens when entering the kernel before it
++ will proceed with the work requested from user mode. Because of this
++ difference, the <function>report_syscall_entry</function> callback is
++ special in two ways. For this event, engines are called in reverse of
++ the normal order (this includes the <function>report_quiesce</function>
++ call that precedes a <function>report_syscall_entry</function> call).
++ This preserves the semantics that the last engine to attach is called
++ "closest to user mode"--the engine that is first to see a thread's user
++ state when it enters the kernel is also the last to see that state when
++ the thread returns to user mode. For the same reason, if these
++ callbacks use <constant>UTRACE_STOP</constant> (see the next section),
++ the thread stops immediately after callbacks rather than only when it's
++ ready to return to user mode; when allowed to resume, it will actually
++ attempt the system call indicated by the register values at that time.
++ </para>
++
+ </sect1>
+
+ <sect1 id="safely"><title>Stopping Safely</title>
@@ -589,7 +649,7 @@ index 0000000..b802c55
+
+</book>
diff --git a/fs/proc/array.c b/fs/proc/array.c
-index 725a650..e299a63 100644
+index 725a650..e299a63 100644
--- a/fs/proc/array.c
+++ b/fs/proc/array.c
@@ -82,6 +82,7 @@
@@ -600,7 +660,7 @@ index 725a650..e299a63 100644
#include <asm/pgtable.h>
#include <asm/processor.h>
-@@ -188,6 +189,8 @@ static inline void task_state(struct seq_file *m, struct pid_namespace *ns,
+@@ -188,6 +189,8 @@ static inline void task_state(struct seq
cred->uid, cred->euid, cred->suid, cred->fsuid,
cred->gid, cred->egid, cred->sgid, cred->fsgid);
@@ -610,7 +670,7 @@ index 725a650..e299a63 100644
if (p->files)
fdt = files_fdtable(p->files);
diff --git a/include/linux/init_task.h b/include/linux/init_task.h
-index d87247d..0d0b55d 100644
+index d87247d..0d0b55d 100644
--- a/include/linux/init_task.h
+++ b/include/linux/init_task.h
@@ -170,6 +170,7 @@ extern struct cred init_cred;
@@ -622,7 +682,7 @@ index d87247d..0d0b55d 100644
INIT_TRACE_IRQFLAGS \
INIT_LOCKDEP \
diff --git a/include/linux/sched.h b/include/linux/sched.h
-index b4c38bc..30db106 100644
+index b4c38bc..30db106 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -59,6 +59,7 @@ struct sched_param {
@@ -646,7 +706,7 @@ index b4c38bc..30db106 100644
u32 parent_exec_id;
u32 self_exec_id;
diff --git a/include/linux/tracehook.h b/include/linux/tracehook.h
-index 4ec4821..a7de30f 100644
+index 4ec4821..a7de30f 100644
--- a/include/linux/tracehook.h
+++ b/include/linux/tracehook.h
@@ -49,6 +49,7 @@
@@ -666,7 +726,7 @@ index 4ec4821..a7de30f 100644
return (task_ptrace(task) & PT_PTRACED) != 0;
}
-@@ -111,6 +114,9 @@ static inline void ptrace_report_syscall(struct pt_regs *regs)
+@@ -111,6 +114,9 @@ static inline void ptrace_report_syscall
static inline __must_check int tracehook_report_syscall_entry(
struct pt_regs *regs)
{
@@ -676,7 +736,7 @@ index 4ec4821..a7de30f 100644
ptrace_report_syscall(regs);
return 0;
}
-@@ -134,6 +140,8 @@ static inline __must_check int tracehook_report_syscall_entry(
+@@ -134,6 +140,8 @@ static inline __must_check int tracehook
*/
static inline void tracehook_report_syscall_exit(struct pt_regs *regs, int step)
{
@@ -685,7 +745,7 @@ index 4ec4821..a7de30f 100644
ptrace_report_syscall(regs);
}
-@@ -194,6 +202,8 @@ static inline void tracehook_report_exec(struct linux_binfmt *fmt,
+@@ -194,6 +202,8 @@ static inline void tracehook_report_exec
struct linux_binprm *bprm,
struct pt_regs *regs)
{
@@ -694,7 +754,7 @@ index 4ec4821..a7de30f 100644
if (!ptrace_event(PT_TRACE_EXEC, PTRACE_EVENT_EXEC, 0) &&
unlikely(task_ptrace(current) & PT_PTRACED))
send_sig(SIGTRAP, current, 0);
-@@ -211,6 +221,8 @@ static inline void tracehook_report_exec(struct linux_binfmt *fmt,
+@@ -211,6 +221,8 @@ static inline void tracehook_report_exec
*/
static inline void tracehook_report_exit(long *exit_code)
{
@@ -703,7 +763,7 @@ index 4ec4821..a7de30f 100644
ptrace_event(PT_TRACE_EXIT, PTRACE_EVENT_EXIT, *exit_code);
}
-@@ -254,6 +266,7 @@ static inline int tracehook_prepare_clone(unsigned clone_flags)
+@@ -254,6 +266,7 @@ static inline int tracehook_prepare_clon
static inline void tracehook_finish_clone(struct task_struct *child,
unsigned long clone_flags, int trace)
{
@@ -711,7 +771,7 @@ index 4ec4821..a7de30f 100644
ptrace_init_task(child, (clone_flags & CLONE_PTRACE) || trace);
}
-@@ -280,6 +293,8 @@ static inline void tracehook_report_clone(int trace, struct pt_regs *regs,
+@@ -280,6 +293,8 @@ static inline void tracehook_report_clon
unsigned long clone_flags,
pid_t pid, struct task_struct *child)
{
@@ -720,7 +780,7 @@ index 4ec4821..a7de30f 100644
if (unlikely(trace) || unlikely(clone_flags & CLONE_PTRACE)) {
/*
* The child starts up with an immediate SIGSTOP.
-@@ -311,6 +326,9 @@ static inline void tracehook_report_clone_complete(int trace,
+@@ -311,6 +326,9 @@ static inline void tracehook_report_clon
pid_t pid,
struct task_struct *child)
{
@@ -730,7 +790,7 @@ index 4ec4821..a7de30f 100644
if (unlikely(trace))
ptrace_event(0, trace, pid);
}
-@@ -345,6 +363,7 @@ static inline void tracehook_report_vfork_done(struct task_struct *child,
+@@ -345,6 +363,7 @@ static inline void tracehook_report_vfor
*/
static inline void tracehook_prepare_release_task(struct task_struct *task)
{
@@ -738,7 +798,7 @@ index 4ec4821..a7de30f 100644
}
/**
-@@ -359,6 +378,7 @@ static inline void tracehook_prepare_release_task(struct task_struct *task)
+@@ -359,6 +378,7 @@ static inline void tracehook_prepare_rel
static inline void tracehook_finish_release_task(struct task_struct *task)
{
ptrace_release_task(task);
@@ -746,7 +806,7 @@ index 4ec4821..a7de30f 100644
}
/**
-@@ -380,6 +400,8 @@ static inline void tracehook_signal_handler(int sig, siginfo_t *info,
+@@ -380,6 +400,8 @@ static inline void tracehook_signal_hand
const struct k_sigaction *ka,
struct pt_regs *regs, int stepping)
{
@@ -755,7 +815,7 @@ index 4ec4821..a7de30f 100644
if (stepping)
ptrace_notify(SIGTRAP);
}
-@@ -397,6 +419,8 @@ static inline void tracehook_signal_handler(int sig, siginfo_t *info,
+@@ -397,6 +419,8 @@ static inline void tracehook_signal_hand
static inline int tracehook_consider_ignored_signal(struct task_struct *task,
int sig)
{
@@ -764,7 +824,7 @@ index 4ec4821..a7de30f 100644
return (task_ptrace(task) & PT_PTRACED) != 0;
}
-@@ -416,6 +440,9 @@ static inline int tracehook_consider_ignored_signal(struct task_struct *task,
+@@ -416,6 +440,9 @@ static inline int tracehook_consider_ign
static inline int tracehook_consider_fatal_signal(struct task_struct *task,
int sig)
{
@@ -774,7 +834,7 @@ index 4ec4821..a7de30f 100644
return (task_ptrace(task) & PT_PTRACED) != 0;
}
-@@ -430,6 +457,8 @@ static inline int tracehook_consider_fatal_signal(struct task_struct *task,
+@@ -430,6 +457,8 @@ static inline int tracehook_consider_fat
*/
static inline int tracehook_force_sigpending(void)
{
@@ -783,7 +843,7 @@ index 4ec4821..a7de30f 100644
return 0;
}
-@@ -459,6 +488,8 @@ static inline int tracehook_get_signal(struct task_struct *task,
+@@ -459,6 +488,8 @@ static inline int tracehook_get_signal(s
siginfo_t *info,
struct k_sigaction *return_ka)
{
@@ -792,7 +852,7 @@ index 4ec4821..a7de30f 100644
return 0;
}
-@@ -486,6 +517,8 @@ static inline int tracehook_get_signal(struct task_struct *task,
+@@ -486,6 +517,8 @@ static inline int tracehook_get_signal(s
*/
static inline int tracehook_notify_jctl(int notify, int why)
{
@@ -801,7 +861,7 @@ index 4ec4821..a7de30f 100644
return notify ?: (current->ptrace & PT_PTRACED) ? why : 0;
}
-@@ -509,6 +542,8 @@ static inline int tracehook_notify_jctl(int notify, int why)
+@@ -509,6 +542,8 @@ static inline int tracehook_notify_jctl(
static inline int tracehook_notify_death(struct task_struct *task,
void **death_cookie, int group_dead)
{
@@ -810,7 +870,7 @@ index 4ec4821..a7de30f 100644
if (task_detached(task))
return task->ptrace ? SIGCHLD : DEATH_REAP;
-@@ -545,6 +580,20 @@ static inline void tracehook_report_death(struct task_struct *task,
+@@ -545,6 +580,20 @@ static inline void tracehook_report_deat
int signal, void *death_cookie,
int group_dead)
{
@@ -831,7 +891,7 @@ index 4ec4821..a7de30f 100644
}
#ifdef TIF_NOTIFY_RESUME
-@@ -574,10 +623,20 @@ static inline void set_notify_resume(struct task_struct *task)
+@@ -574,10 +623,20 @@ static inline void set_notify_resume(str
* asynchronously, this will be called again before we return to
* user mode.
*
@@ -855,7 +915,7 @@ index 4ec4821..a7de30f 100644
diff --git a/include/linux/utrace.h b/include/linux/utrace.h
new file mode 100644
-index 0000000..f46cc0f
+index ...f877ec6 100644
--- /dev/null
+++ b/include/linux/utrace.h
@@ -0,0 +1,692 @@
@@ -1037,7 +1097,7 @@ index 0000000..f46cc0f
+ * that is developed concurrently with utrace API improvements before they
+ * are merged into the kernel, making LINUX_VERSION_CODE checks unwieldy.
+ */
-+#define UTRACE_API_VERSION 20090302
++#define UTRACE_API_VERSION 20090416
+
+/**
+ * enum utrace_resume_action - engine's choice of action for a traced task
@@ -1553,7 +1613,7 @@ index 0000000..f46cc0f
+#endif /* linux/utrace.h */
diff --git a/include/linux/utrace_struct.h b/include/linux/utrace_struct.h
new file mode 100644
-index 0000000..aba7e09
+index ...aba7e09 100644
--- /dev/null
+++ b/include/linux/utrace_struct.h
@@ -0,0 +1,58 @@
@@ -1616,7 +1676,7 @@ index 0000000..aba7e09
+
+#endif /* linux/utrace_struct.h */
diff --git a/init/Kconfig b/init/Kconfig
-index 7be4d38..a6987df 100644
+index 7be4d38..a6987df 100644
--- a/init/Kconfig
+++ b/init/Kconfig
@@ -1149,6 +1149,15 @@ config STOP_MACHINE
@@ -1636,7 +1696,7 @@ index 7be4d38..a6987df 100644
config PREEMPT_NOTIFIERS
diff --git a/kernel/Makefile b/kernel/Makefile
-index 4242366..a79634e 100644
+index 4242366..a79634e 100644
--- a/kernel/Makefile
+++ b/kernel/Makefile
@@ -68,6 +68,7 @@ obj-$(CONFIG_IKCONFIG) += configs.o
@@ -1648,7 +1708,7 @@ index 4242366..a79634e 100644
obj-$(CONFIG_AUDITSYSCALL) += auditsc.o
obj-$(CONFIG_AUDIT_TREE) += audit_tree.o
diff --git a/kernel/ptrace.c b/kernel/ptrace.c
-index 0692ab5..1d33e9c 100644
+index 0692ab5..1d33e9c 100644
--- a/kernel/ptrace.c
+++ b/kernel/ptrace.c
@@ -16,6 +16,7 @@
@@ -1659,7 +1719,7 @@ index 0692ab5..1d33e9c 100644
#include <linux/security.h>
#include <linux/signal.h>
#include <linux/audit.h>
-@@ -174,6 +175,14 @@ bool ptrace_may_access(struct task_struct *task, unsigned int mode)
+@@ -174,6 +175,14 @@ bool ptrace_may_access(struct task_struc
return !err;
}
@@ -1699,10 +1759,10 @@ index 0692ab5..1d33e9c 100644
*/
diff --git a/kernel/utrace.c b/kernel/utrace.c
new file mode 100644
-index 0000000..c2bb162
+index ...74b5fc5 100644
--- /dev/null
+++ b/kernel/utrace.c
-@@ -0,0 +1,2351 @@
+@@ -0,0 +1,2357 @@
+/*
+ * utrace infrastructure interface for debugging user processes
+ *
@@ -1919,6 +1979,11 @@ index 0000000..c2bb162
+ *
+ * UTRACE_ATTACH_MATCH_OPS: Only consider engines matching @ops.
+ * UTRACE_ATTACH_MATCH_DATA: Only consider engines matching @data.
++ *
++ * Calls with neither %UTRACE_ATTACH_MATCH_OPS nor %UTRACE_ATTACH_MATCH_DATA
++ * match the first among any engines attached to @target. That means that
++ * %UTRACE_ATTACH_EXCLUSIVE in such a call fails with -%EEXIST if there
++ * are any engines on @target at all.
+ */
+struct utrace_engine *utrace_attach_task(
+ struct task_struct *target, int flags,
@@ -3151,6 +3216,7 @@ index 0000000..c2bb162
+ return ops;
+ }
+
++ utrace->reporting = NULL;
+ return NULL;
+}
+
@@ -3162,16 +3228,16 @@ index 0000000..c2bb162
+#define REPORT(task, utrace, report, event, callback, ...) \
+ do { \
+ start_report(utrace); \
-+ REPORT_CALLBACKS(task, utrace, report, event, callback, \
++ REPORT_CALLBACKS(, task, utrace, report, event, callback, \
+ (report)->action, engine, current, \
+ ## __VA_ARGS__); \
+ finish_report(report, task, utrace); \
+ } while (0)
-+#define REPORT_CALLBACKS(task, utrace, report, event, callback, ...) \
++#define REPORT_CALLBACKS(rev, task, utrace, report, event, callback, ...) \
+ do { \
+ struct utrace_engine *engine; \
+ const struct utrace_engine_ops *ops; \
-+ list_for_each_entry(engine, &utrace->attached, entry) { \
++ list_for_each_entry##rev(engine, &utrace->attached, entry) { \
+ ops = start_callback(utrace, report, engine, task, \
+ event); \
+ if (!ops) \
@@ -3206,9 +3272,9 @@ index 0000000..c2bb162
+ INIT_REPORT(report);
+
+ start_report(utrace);
-+ REPORT_CALLBACKS(task, utrace, &report, UTRACE_EVENT(SYSCALL_ENTRY),
-+ report_syscall_entry, report.result | report.action,
-+ engine, current, regs);
++ REPORT_CALLBACKS(_reverse, task, utrace, &report,
++ UTRACE_EVENT(SYSCALL_ENTRY), report_syscall_entry,
++ report.result | report.action, engine, current, regs);
+ finish_report(&report, task, utrace);
+
+ if (report.action == UTRACE_STOP &&
@@ -3256,7 +3322,7 @@ index 0000000..c2bb162
+ start_report(utrace);
+ utrace->cloning = child;
+
-+ REPORT_CALLBACKS(task, utrace, &report,
++ REPORT_CALLBACKS(, task, utrace, &report,
+ UTRACE_EVENT(CLONE), report_clone,
+ report.action, engine, task, clone_flags, child);
+
@@ -3406,7 +3472,7 @@ index 0000000..c2bb162
+ utrace->interrupt = 0;
+ spin_unlock(&utrace->lock);
+
-+ REPORT_CALLBACKS(task, utrace, &report, UTRACE_EVENT(DEATH),
++ REPORT_CALLBACKS(, task, utrace, &report, UTRACE_EVENT(DEATH),
+ report_death, engine, task, group_dead, signal);
+
+ spin_lock(&utrace->lock);
- Previous message (by thread): rpms/eclipse-epic/devel get-epic.sh, 1.7, 1.8 .cvsignore, 1.8, 1.9 sources, 1.8, 1.9 eclipse-epic.spec, 1.11, 1.12
- Next message (by thread): rpms/kernel/F-11/scripts pull-upstreams.sh,1.6,1.7
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
More information about the fedora-extras-commits
mailing list