This is the mail archive of the
systemtap@sourceware.org
mailing list for the systemtap project.
Re: Calling systemtap function from pure code
- From: fche at redhat dot com (Frank Ch. Eigler)
- To: Daniel Doron <danielmeirdoron at gmail dot com>
- Cc: systemtap at sourceware dot org
- Date: Wed, 13 Sep 2017 16:05:18 -0400
- Subject: Re: Calling systemtap function from pure code
- Authentication-results: sourceware.org; auth=none
- Authentication-results: ext-mx07.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com
- Authentication-results: ext-mx07.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=fche at redhat dot com
- Dmarc-filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 3D19EC047B6D
- References: <CAFwN=+zcORJkmRWuGUySAtQTkDzdcBuEoQzC5QRmatQrhJW6uA@mail.gmail.com>
Daniel Doron <danielmeirdoron@gmail.com> writes:
> Is it possible to call a stap function from [embedded-c code]?
> function log_evnt_stap(name){
> printf("name %s \n", name )
> }
> [something like ... function foo () %{ log_event_stap("foo") %}
Nope. For example, the code that systemtap functions are translated to
have a rather different API/ABI at the C level, e.g., involving putting
parameters into an explicit stack structure (context*). You can
probably hack together something that would work for your script, based
on an examination of stap -p3 output, but is not a well-supported
technique.
- FChE