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: Hashtable


I am trying to implement full bypass of the code generated by the
SystemTap in some special cases.


My goal is to be able to write code like this:

probe syscall.dup2
{   /* bypass */  /* arg: oldfd */
    printk(KERN_ALERT "tid=%d oldfd=%d\n", current->pid, l->l_oldfd);
// Unmanaged C code
}

I have not finished the code yet. I added two new pragma comments
/* bypass */
/* arg: <argument name> */

When generating the code I add the relevant dwarf_tvar_get_ calls and
initialize "local" variables in the context structure. Because the
probes I am targeting are very short and simple and do not involve
nested calls I shortcut lot of variables copying.

Is there a chance for something similar in the SystemTap future?

Thank you, Arkady.


On Sun, Jul 16, 2017 at 7:19 PM, Arkady <arkady.miasnikov@gmail.com> wrote:
> Eliding the trace would be cool
>
> On Sun, Jul 16, 2017 at 7:09 PM, Frank Ch. Eigler <fche@redhat.com> wrote:
>>
>> arkady.miasnikov wrote:
>>
>>> [...]
>>> I am playing with something I call "STAP bypass" - allow to register a
>>> pure C implementation of a probe. This gives about 1% gain part of
>>> which comes from removing calls to _stp_print_flush(). A define symbol
>>> like STP_TRACE_OFF would be nice. [...]
>>
>> That _stp_print_flush() bit could be elided by analysis of the staptree
>> associated with the probe; if no print*s are found there (or any
>> function transitively called), then no need to flush.  (For embedded-C
>> functions, we could add a /* print */ pragma to handle that in the
>> analysis.)
>>
>> - FChE


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