ust update
[lttv.git] / trunk / lttv / doc / developer / ust.html
CommitLineData
ca3fb06a 1<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
2<html>
3<head>
4 <title>LTTng User-space Tracing Design</title>
5</head>
6 <body>
d4c85b6e 7
ca3fb06a 8<h1>LTTng User-space Tracing Design</h1>
9
10<p>
d4c85b6e 11A user-space application may contain static instrumentation, and be linked with
12an associated runtime library, in order to produce an execution trace. User
13space Tracepoints and Markers, analogous to Kernel Tracepoints and Markers,
14define program locations and arguments provided. Probes may then be connected to
15each Tracepoint and Marker before they are activated. The probes will typically
16call LTTng user-space event writing functions.
17
ca3fb06a 18<p>
d4c85b6e 19When the instrumented application starts, a pipe is opened to allow external
20tracing control, asynchronous notification is requested when commands arrive in
9a192a69 21the pipe, and a signal handler is installed for SIGIO (or a carefully chosen
22chainable signal number). Every time such signal is received, the runtime
23library checks for commands received on the external tracing control pipe. The
24recognized commands are:
d4c85b6e 25
ca3fb06a 26<li> list the available Markers and Tracepoints;
27<li> dynamically load a library (presumably containing probes to connect);
28<li> connect a probe to a Tracepoint or Marker;
29<li> activate a Tracepoint or Marker;
30<li> initialize the tracing buffers;
31<li> flush the tracing buffers;
32<li> finalize the tracing buffers;
d4c85b6e 33
ca3fb06a 34<p>
d4c85b6e 35The application may also spontaneously provide information to the pipe:
36
ca3fb06a 37<li> a buffer is full;
38<li> new tracepoints or markers are appearing or disappearing, because modules are
d4c85b6e 39 dynamically loaded or unloaded;
40
ca3fb06a 41<p>
d4c85b6e 42In addition, the tracing control application should be notified when the
43application exits (to save the content of buffers if the application is
44crashing). Such notification may be obtained through utrace.
ca3fb06a 45<p>
14b9349e 46This tracing scheme plans to use a direct function call to tracing into buffers
47mapped in user-space. This should be an order of magnitude faster than the
48current Dtrace implementation (c.f.
9dd3d20d 49<a href="http://ltt.polymtl.ca/tracingwiki/index.php/DTrace">Dtrace information
50on the TracingWiki</a>) which uses a breakpoint to
14b9349e 51perform both dynamic and static user-space tracing. Performance comparison of
52a function call vs the int3 approach is available at
9dd3d20d 53<a href="http://sourceware.org/ml/systemtap/2006-q3/msg00793.html">Markers vs
54int3 performance comparison</a> (see "Conclusion").
e6f8d5e6 55
56Tracing of Java application is planned to be done through a JNI interface.
57Linking standard low-level C tracing library to the application within a JNI
58adaptation class will be required to trace Java events. This has been prototyped
59in the past. The work is available here for older LTTng versions : <a
7f3d7e4f 60href="http://ltt.polymtl.ca/svn/trunk/obsolete/ltt-usertrace/java/"</a>
e6f8d5e6 61
ca3fb06a 62 </body>
63</html>
This page took 0.030136 seconds and 4 git commands to generate.