From: Kevin Stafford <kevinrs@us.ibm.com>
To: systemtap@sources.redhat.com
Subject: probes that access userspace
Date: Fri, 14 Oct 2005 15:05:00 -0000 [thread overview]
Message-ID: <E55D.2090005@us.ibm.com> (raw)
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
next reply other threads:[~2005-10-14 15:05 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-10-14 15:05 Kevin Stafford [this message]
[not found] <E55D.2090005__29732.3145241991$1129302467$gmane$org@us.ibm.com>
2005-10-14 16:23 ` Frank Ch. Eigler
2005-10-14 19:10 ` Kevin Stafford
2005-10-14 19:21 ` Frank Ch. Eigler
2005-10-14 21:09 ` Jim Keniston
2005-10-14 22:15 ` Roland McGrath
2005-10-14 21:12 Kevin Stafford
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=E55D.2090005@us.ibm.com \
--to=kevinrs@us.ibm.com \
--cc=systemtap@sources.redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).