probes that access userspace
Jim Keniston
jkenisto@us.ibm.com
Fri Oct 14 21:09:00 GMT 2005
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
More information about the Systemtap
mailing list