[lkml]   [2006]   [Mar]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: RFC - Approaches to user-space probes

Andi Kleen <> wrote on 28/03/2006 09:47:57:

> On Tuesday 28 March 2006 11:42, Richard J Moore wrote:
> > 1) ptrace is orientated to debugging a specific process tree and a
> > nominated debug process. Having it operate on arbitrary process would
> > require kernel extensions to achieve that but would also have a major
> > impact on performance if each event were to result in a context switch
> > the debugger process.
> You can attach it to any pid

Yes, of course. But you have to do some work to determine the PIDs,
especially if you want to catch new processes that aren't in the current
set of debugee process trees.

> The problem is just finding new processes when they are created. And when
> you trace all it will be quite inefficient.
> >
> > 2) ptrace operates by privatizing memory via COW, but kprobes doesn't.
> > probes are fixed-up when a page is brought into memory by using an
> > r/w virtual address. Using existing the ptrace mechanism across all, or
> > most, processes could have a significant affect on swapfile and paging
> > rate. And that has to be bad news when investigating performance and
> > conditions problems.
> The problem with ptrace is also that it is quite heavyweight - you have
> to take over all signals at least etc. Some lighter weight probing
> mechanism for user space would be probably a good idea.
> > If we want to make life easier for debugging the types of problems
> > indicated above, then it's seems very reasonable to ask whether ptrace
> > be extended to use the (user) kprobes mechanism.
> It's a mistery to me why people hate ioctl and like ptrace.

No doubt we'll find out soon ;-)

> ptrace already is far too complex and ugly. Clean new calls would be
> preferable.
> -Andi

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at

 \ /
  Last update: 2006-03-28 12:13    [W:0.060 / U:1.436 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site