This is the mail archive of the
systemtap@sources.redhat.com
mailing list for the systemtap project.
Re: embedded-C proposal
- From: Jim Keniston <jkenisto at us dot ibm dot com>
- To: "Frank Ch. Eigler" <fche at redhat dot com>
- Cc: SystemTAP <systemtap at sources dot redhat dot com>
- Date: 21 Jul 2005 15:05:33 -0700
- Subject: Re: embedded-C proposal
- Organization:
- References: <20050721185155.GA14500@redhat.com>
On Thu, 2005-07-21 at 11:51, Frank Ch. Eigler wrote:
> Hi -
>
> Here's a possible C extension mechanism for systemtap "guru-mode"
> scripts. It's a synthesis of ideas from zanussi, graydon, and others.
> There would be just two constructs: two places where a script can
> include embedded C code: at the top level, and as a function body.
>
> C code at the top level would be enclosed between "%{" and "%}"
> markers, sort of like yacc. The translator would transcribe, without
> analysis, all such blocks to near the beginning of the synthesized C
> code. These would be suitable for adding "#include's" or defining
> types / auxiliary functions...
...
>
> And that's it! This facility seems sufficient to express unprotected
> traversal of target pointers, extraction of special kernel data, being
> able to do many dangerous and exciting things.
I agree.
> And it requires very
> little extra theory and nearly no work from the translator (to me,
> those are the best parts).
>
> Some notable corollaries. I don't think we'll need an analogous
> C-embedding method for probe handlers. Let script probe handlers call
> into embedded-C functions if they need the help, and pass any
> target-side values necessary.
I agree.
>
> Also, it should be unnecessary for the embedded-C code to interact
> with the rest of the translator's output. In particular, that code
> should not play around with the script's global variables.
Right.
> It could
> perhaps make calls into the runtime ... or ideally, it shouldn't, in
> order to reduce interface coupling.
I agree with the latter.
>
> Comments?
>
>
> - FChE
>
You're right on target, in my opinion.
Jim