This is the mail archive of the
systemtap@sourceware.org
mailing list for the systemtap project.
probes that access userspace
- From: Kevin Stafford <kevinrs at us dot ibm dot com>
- To: systemtap at sources dot redhat dot com
- Date: Thu, 01 Jan 1970 08:18:37 -0800
- Subject: probes that access userspace
Especially when considering syscall tapset there are times when it is
useful to access
the value referenced by a user space pointer. In probe script language,
such an attempt
(i.e. $userspace_struct->member) will cause a pointer dereference fault.
Thus it is
necessary to write a function to dig the value out of the pointer
manually. Ex:
_get_user_ptr_val($userspace_struct,member) _get_user_ptr_val
function _get_user_ptr_val(u_addr,mem) %{
[...]
copy_from_user(..., THIS->u_addr, ...);
[...]
%}
Is dwarf able to provide enough information to accurately detect a user
space pointer
reference? If so, is it possible to teach the translator to bring
references of user
space into the kernel automagically? Such a mechanism would relieve the
user/tapset
author from writing an embedded C function for every pointer they wanted
to look at.
The current implementation does not support such behavior.
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 *var for scalars & *struct=>mem for structs). 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.
--
Kevin Stafford
DES 2 | MS 2M3
Beaverton - OR
Linux Technology Center
IBM Systems & Technology
Phone: 1-503-578-3039
Email: kevinrs@us.ibm.com