lkml.org 
[lkml]   [2014]   [Jan]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [RFC/PATCH] Implement new PTRACE_EVENT_SYSCALL_{ENTER,EXIT}
On 01/07/2014 03:30 PM, Oleg Nesterov wrote:
>
> If we add the new API, perhaps we should change ptrace_resume ?
> I mean,
>
> --- x/kernel/ptrace.c
> +++ x/kernel/ptrace.c
> @@ -723,7 +723,9 @@ static int ptrace_resume(struct task_str
> if (!valid_signal(data))
> return -EIO;
>
> - if (request == PTRACE_SYSCALL)
> + if (request == PTRACE_SYSCALL ||
> + ptrace_event_enabled(PTRACE_EVENT_SYSCALL_ENTER) ||
> + ptrace_event_enabled(PTRACE_EVENT_SYSCALL_EXIT))
> set_tsk_thread_flag(child, TIF_SYSCALL_TRACE);
> else
> clear_tsk_thread_flag(child, TIF_SYSCALL_TRACE);
>
>
> This way PTRACE_O_SYSCALL_* will work like other ptrace options which
> ask to report an event.

+10^6. With PTRACE_SYSCALL/sysgood, we don't have a way to trace
syscalls when single-stepping, which isn't much of a problem for
strace, but of course is for GDB. That is one of the things the
new API should definitely sort out.

--
Pedro Alves



\
 
 \ /
  Last update: 2014-01-09 20:01    [W:0.087 / U:0.100 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site