Now that we don't use "ptrace & PT_" we can kill ptrace_setoptions() and ptrace_update_utrace().
We could also remove all PT_ defines except PT_PTRACED and PT_PTRACE_CAP. --- kernel/ptrace.c | 73 -------------------------------------------------------- 1 file changed, 73 deletions(-) --- PU/kernel/ptrace.c~22_KILL_PT_XXX 2009-09-04 18:33:03.000000000 +0200 +++ PU/kernel/ptrace.c 2009-09-04 19:50:35.000000000 +0200 @@ -85,46 +85,6 @@ void __ptrace_unlink(struct task_struct arch_ptrace_untrace(child); } -static int ptrace_update_utrace(struct task_struct *task, - struct utrace_engine *engine) -{ - unsigned long events; - - /* - * We need this for resume handling. - */ - events = UTRACE_EVENT(QUIESCE); - - /* - * These events are always reported. - */ - events |= UTRACE_EVENT(EXEC) | UTRACE_EVENT_SIGNAL_ALL; - - /* - * We always have to examine clone events to check for CLONE_PTRACE. - */ - events |= UTRACE_EVENT(CLONE); - - /* - * PTRACE_SETOPTIONS can request more events. - */ - if (task->ptrace & PT_TRACE_EXIT) - events |= UTRACE_EVENT(EXIT); - - if (!engine) { - int ret; - engine = utrace_attach_task(task, UTRACE_ATTACH_MATCH_OPS, - &ptrace_utrace_ops, NULL); - if (IS_ERR(engine)) - return -ESRCH; - ret = utrace_set_events(task, engine, events); - utrace_engine_put(engine); - return ret; - } - - return utrace_set_events(task, engine, events); -} - static void ptrace_set_action(struct task_struct *task, enum utrace_resume_action action, enum utrace_syscall_action syscall) @@ -253,7 +213,6 @@ static void ptrace_clone_attach(struct t sigaddset(&child->pending.signal, SIGSTOP); set_tsk_thread_flag(child, TIF_SIGPENDING); - ptrace_update_utrace(child, NULL); } static u32 ptrace_report_clone(enum utrace_resume_action action, @@ -875,37 +834,6 @@ int ptrace_writedata(struct task_struct return copied; } -/* will die soon ... */ -static int ptrace_setoptions(struct task_struct *child, long data) -{ - child->ptrace &= ~PT_TRACE_MASK; - - if (data & PTRACE_O_TRACESYSGOOD) - child->ptrace |= PT_TRACESYSGOOD; - - if (data & PTRACE_O_TRACEFORK) - child->ptrace |= PT_TRACE_FORK; - - if (data & PTRACE_O_TRACEVFORK) - child->ptrace |= PT_TRACE_VFORK; - - if (data & PTRACE_O_TRACECLONE) - child->ptrace |= PT_TRACE_CLONE; - - if (data & PTRACE_O_TRACEEXEC) - child->ptrace |= PT_TRACE_EXEC; - - if (data & PTRACE_O_TRACEVFORKDONE) - child->ptrace |= PT_TRACE_VFORK_DONE; - - if (data & PTRACE_O_TRACEEXIT) - child->ptrace |= PT_TRACE_EXIT; - - ptrace_update_utrace(child, NULL); - - return (data & ~PTRACE_O_MASK) ? -EINVAL : 0; -} - static int ptrace_set_options(struct task_struct *child, long data) { struct utrace_engine *engine; @@ -1160,7 +1088,6 @@ int ptrace_request(struct task_struct *c case PTRACE_OLDSETOPTIONS: #endif case PTRACE_SETOPTIONS: - ret = ptrace_setoptions(child, data); ret = ptrace_set_options(child, data); break; case PTRACE_GETEVENTMSG: