This is the mail archive of the
systemtap@sourceware.org
mailing list for the systemtap project.
Re: probes that access userspace
- From: Jim Keniston <jkenisto at us dot ibm dot com>
- To: "Frank Ch. Eigler" <fche at redhat dot com>
- Cc: Kevin Stafford <kevinrs at us dot ibm dot com>, SystemTAP <systemtap at sources dot redhat dot com>
- Date: 14 Oct 2005 14:08:50 -0700
- Subject: Re: probes that access userspace
- Organization:
- References: <E55D.2090005__29732.3145241991$1129302467$gmane$org@us.ibm.com> <y0mzmpc2hkt.fsf@tooth.toronto.redhat.com>
On Fri, 2005-10-14 at 09:23, Frank Ch. Eigler wrote:
> kevinrs wrote:
>
> > Especially when considering syscall tapset there are times when it
> > is useful to access the value referenced by a user space
> > pointer. [...]
>
> > Is dwarf able to provide enough information to accurately detect a
> > user space pointer reference? [...]
>
> No, there appears to be no such qualification data in the debuginfo at
> all. IIRC, the preprocessor makes __user go away before the compiler
> ever sees it.
That's my understanding as well.
>
> > [...] If this is not possible, I think it would be useful to
> > enhance the language such that a probe script could explicitly
> > notify the translator of a user space pointer access [...]
>
> Perhaps. Other than the system call interfaces, is this difficulty
> likely to arise often elsewhere?
Almost certainly. According to cscope, there are over 8700 uses of
__user in the kernel source. This should not be a surprise if you
consider that the whole point of an OS is to implement system calls.
>
> > This will be especially beneficial for scripts probing user-space
> > apps. Eventually, when SystemTap supports user-space probes, the
> > translator will need to know how to follow pointers in user space.
>
> Not quite. For user-level probes, there is no ambiguity: every
> pointer dereference is in user space.
Correct, there's no ambiguity. So you're not likely to need a "-> into
user-space" operator when probing user apps. The trickier problem of
making safe refs to user space from (kernel-space) probe handlers
remains, though.
>
> - FChE
>
Jim