No need to to use different ENTRY/EXIT syscall codes any longer. PTRACE_EVENT_SYSCALL_EXIT was introduced to emulate send_sigtrap() from syscall_trace_leave(), now we don't do this.
--- kernel/ptrace-utrace.c | 25 +++++++++++-------------- 1 file changed, 11 insertions(+), 14 deletions(-) --- UTRACE-PTRACE/kernel/ptrace-utrace.c~140_PTRACE_EVENT_SYSCALL 2009-11-21 22:15:51.000000000 +0100 +++ UTRACE-PTRACE/kernel/ptrace-utrace.c 2009-11-23 22:15:21.000000000 +0100 @@ -70,10 +70,9 @@ struct ptrace_context { #define PTRACE_O_SYSEMU 0x100 -#define PTRACE_EVENT_SYSCALL_ENTRY (1 << 16) -#define PTRACE_EVENT_SYSCALL_EXIT (2 << 16) -#define PTRACE_EVENT_SIGTRAP (3 << 16) -#define PTRACE_EVENT_SIGNAL (4 << 16) +#define PTRACE_EVENT_SYSCALL (1 << 16) +#define PTRACE_EVENT_SIGTRAP (2 << 16) +#define PTRACE_EVENT_SIGNAL (3 << 16) /* events visible to user-space */ #define PTRACE_EVENT_MASK 0xFFFF @@ -257,8 +256,7 @@ static void ptrace_detach_task(struct ta struct ptrace_context *ctx = ptrace_context(engine); switch (get_stop_event(ctx)) { - case PTRACE_EVENT_SYSCALL_ENTRY: - case PTRACE_EVENT_SYSCALL_EXIT: + case PTRACE_EVENT_SYSCALL: if (voluntary) send_sig_info(sig, SEND_SIG_PRIV, tracee); break; @@ -385,9 +383,9 @@ static u32 ptrace_report_clone(enum utra return UTRACE_STOP; } -static inline void set_syscall_code(struct ptrace_context *ctx, int event) +static inline void set_syscall_code(struct ptrace_context *ctx) { - set_stop_code(ctx, event); + set_stop_code(ctx, PTRACE_EVENT_SYSCALL); if (ctx->options & PTRACE_O_TRACESYSGOOD) ctx->stop_code |= 0x80; } @@ -411,7 +409,7 @@ static u32 ptrace_report_syscall_entry(u WARN_ON(ptrace_event_pending(ctx)); - set_syscall_code(ctx, PTRACE_EVENT_SYSCALL_ENTRY); + set_syscall_code(ctx); if (unlikely(ctx->options & PTRACE_O_SYSEMU)) { suppress_sigtrap(task); @@ -444,7 +442,7 @@ static u32 ptrace_report_syscall_exit(en return UTRACE_INTERRUPT; } - set_syscall_code(ctx, PTRACE_EVENT_SYSCALL_EXIT); + set_syscall_code(ctx); return UTRACE_STOP; } @@ -954,7 +952,7 @@ static int ptrace_resume(struct task_str case PTRACE_EVENT_CLONE: case PTRACE_EVENT_VFORK_DONE: if (request == PTRACE_SYSCALL) { - set_syscall_code(ctx, PTRACE_EVENT_SYSCALL_EXIT); + set_syscall_code(ctx); do_ptrace_notify_stop(ctx, tracee); return 0; } @@ -963,14 +961,13 @@ static int ptrace_resume(struct task_str /* * single-stepping. UTRACE_SIGNAL_REPORT will * synthesize a trap to follow the syscall insn. - */ + */ ctx->signr = SIGTRAP; action = UTRACE_INTERRUPT; } break; - case PTRACE_EVENT_SYSCALL_EXIT: - case PTRACE_EVENT_SYSCALL_ENTRY: + case PTRACE_EVENT_SYSCALL: if (data) send_sig_info(data, SEND_SIG_PRIV, tracee); break;