This is the mail archive of the systemtap@sources.redhat.com mailing list for the systemtap project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: embedded-C proposal


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



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]