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: Static/dynamic userspace/kernel trace


> 
> > I had a chat with Tom at the collaboration summit on tracing, he was
> > suggesting I send you a mail on a recent GDB improvement.  You might
> > not be aware that user space dynamic tracepoint are now available in
> > GDB, in process tracing if a few byte space is available to put a
> > jump, if that space is not available then a trap between gdbserver
> > and the process. With this addition all aspects of tracing seem to
> > be covered:
> >
> >  - static user space: LTTng UST
> >  - dynamic user space: GDB dynamic tracepoint

I did go thro
http://sources.redhat.com/gdb/current/onlinedocs/gdb.html#Set-Tracepoints
but it says 
 "The tracepoint facility is currently available only for remote targets.
See Targets. In addition, your remote target must know how to collect
trace data. This functionality is implemented in the remote stub;
however, none of the stubs distributed with gdb support tracepoints as
of this writing. "
 
and 

"Some targets may support fast tracepoints, which are inserted in a
different way (such as with a jump instead of a trap), that is faster
but possibly restricted in where they may be installed. "

So it possible to use GDB dynamic tracepoints on regular programs
without using remote protocol? If not do you plans to implement this for
non-remote targets?


> >  - static kernel: kernel static tracepoint/trace event
> >  - dynamic kernel: kprobe
> >
> > and conditional tracing is available for both kernel and user space.
> 
> All right.
> 
> 
> > Tom was saying uprobes/utrace can bring nice improvements for
> > ptrace, for tracing it was not clear to me or Tom why we need
> > uprobe/utrace or why systemtap needs it. Do you have a use case
> > where the above tracing cannot be use and uprobe/utrace is needed
> > instead?

Since gdb tracepoints would fall back on traps, using uprobes could
decrease the overhead on inserting/processing a trap instruction. Also
the uprobes handler could be used to collect the information in the same
process context.

Alternatively gdb could use user_bkpt layer to insert traps and 
collect the information in the tracer's context. However this would
require tracer to do some additional work. Still this should be provide
lesser overhead than ptrace.

Uprobes/user_bkpt implements execution out of line, hence it scales well
with multithreaded applications.

Also as Frank already pointed out, uprobes/utrace were designed for
allowing multiple tracing sessions to connect to the same tracee.

I am ignorant on how gdb dynamic tracepoints was implemented to comment
on how gdb could further use uprobes/utrace. Can you please point me to
some documentation on the same.

--
Thanks and Regards
Srikar


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