This is the mail archive of the
systemtap@sourceware.org
mailing list for the systemtap project.
Re: Trying to get an embedded C function to use file I/O
- From: Josh Stone <jistone at redhat dot com>
- To: Eric Wong <normalperson at yhbt dot net>
- Cc: Jeff Johnston <jjohnstn at redhat dot com>, systemtap at sourceware dot org
- Date: Mon, 19 Aug 2013 12:10:59 -0700
- Subject: Re: Trying to get an embedded C function to use file I/O
- References: <520E645A dot 9080305 at redhat dot com> <20130816181732 dot GA6552 at dcvr dot yhbt dot net>
On 08/16/2013 11:17 AM, Eric Wong wrote:
> I think guru mode runs the code in kernel space. I tried using
> strftime() the other day and could not. Maybe dyninst lets one use
> glibc, I haven't looked into it more...
Correct - the entire script runs in kernel mode, so any embedded-C you
add can only use kernel headers and functions. This is not directly an
artifact of guru, really -- it's just that guru is required to let you
write embedded-c at all. For your own good. :)
And you're also correct that --runtime=dyninst can use glibc, because in
this mode the script will be running as a plain shared library. In
theory, you could use *any* header and library on your system, although
I don't think we currently give any way to add compiler flags. You also
have to be aware of the process space though, e.g. a file you open() in
one process isn't going to be open in all involved processes.