| 1 | LTTng User-space Tracing Design |
| 2 | |
| 3 | A user-space application may contain static instrumentation, and be linked with |
| 4 | an associated runtime library, in order to produce an execution trace. User |
| 5 | space Tracepoints and Markers, analogous to Kernel Tracepoints and Markers, |
| 6 | define program locations and arguments provided. Probes may then be connected to |
| 7 | each Tracepoint and Marker before they are activated. The probes will typically |
| 8 | call LTTng user-space event writing functions. |
| 9 | |
| 10 | When the instrumented application starts, a pipe is opened to allow external |
| 11 | tracing control, asynchronous notification is requested when commands arrive in |
| 12 | the pipe, and a signal handler is installed for SIGIO. Every time a SIGIO signal |
| 13 | is received, the runtime library checks for commands received on the external |
| 14 | tracing control pipe. The recognized commands are: |
| 15 | |
| 16 | - list the available Markers and Tracepoints; |
| 17 | - dynamically load a library (presumably containing probes to connect); |
| 18 | - connect a probe to a Tracepoint or Marker; |
| 19 | - activate a Tracepoint or Marker; |
| 20 | - initialize the tracing buffers; |
| 21 | - flush the tracing buffers; |
| 22 | - finalize the tracing buffers; |
| 23 | |
| 24 | The application may also spontaneously provide information to the pipe: |
| 25 | |
| 26 | - a buffer is full; |
| 27 | - new tracepoints or markers are appearing or disappearing, because modules are |
| 28 | dynamically loaded or unloaded; |
| 29 | |
| 30 | In addition, the tracing control application should be notified when the |
| 31 | application exits (to save the content of buffers if the application is |
| 32 | crashing). Such notification may be obtained through utrace. |