This is the mail archive of the systemtap@sourceware.org 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: revamp sdt.h


On Wed, 2010-09-08 at 11:42 -0400, Stan Cox wrote:
> > semaphore feature.
> 
> Ah sorry about that; didn't realize you were seeking that kind of feedback. 
> Interpreters, java in particular, tcl and perhaps python to a lesser degree 
> use #ifdef IS_JAVA_PROBEA_ENABLED(), as I understand it, to avoid runtime 
> probe argument setup overhead, so the semaphore feature was added to implement 
> *ENABLED.

Apologies here too. I had missed the request for feedback on the
semaphores. Here are a couple of examples of code using the ENABLED
probes. In python the main PyEval_EvalFrameEx() function has the
following near the start:

    if (PYTHON_FUNCTION_ENTRY_ENABLED())
        dtrace_entry(f);

and then near the end:

    if (PYTHON_FUNCTION_RETURN_ENABLED())
        dtrace_return(f);

This is done because the entry and exit probes provide arguments which
might take some time to setup. e.g for entry:

static void
dtrace_entry(PyFrameObject *f)
{
    const char *filename;
    const char *fname;
    int lineno;

    filename = PyString_AsString(f->f_code->co_filename);
    fname = PyString_AsString(f->f_code->co_name);
    lineno = PyCode_Addr2Line(f->f_code, f->f_lasti);

    PYTHON_FUNCTION_ENTRY((char *)filename, (char *)fname, lineno);

Something similar can be found in tcl and firefox.

The java hotspot support doesn't use this feature (yet). There we fetch
all arguments through user*() stap functions in the accompanied tapset.
But even though the stap language is pretty rich and flexible, this is a
lot of magic (re)coding of what the (c++) hotspot code already does.

If we like to be completely source compatible with dtrace markers
already in existing programs/libraries supporting the ENABLED macros
would be really nice/essential.

Cheers,

Mark 


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