| 1 | --- |
| 2 | id: liblttng‑ust‑dl |
| 3 | --- |
| 4 | |
| 5 | This LTTng-UST helper causes all calls to `dlopen()` and `dlclose()` |
| 6 | in the target application to be traced with LTTng. |
| 7 | |
| 8 | The helper's shared object, `liblttng-ust-dl.so`, registers the |
| 9 | following tracepoints when preloaded: |
| 10 | |
| 11 | <div class="table"> |
| 12 | <table class="func-desc"> |
| 13 | <thead> |
| 14 | <tr> |
| 15 | <th><abbr title="Tracepoint">TP</abbr> provider name</th> |
| 16 | <th><abbr title="Tracepoint">TP</abbr> name</th> |
| 17 | <th>Description/fields</th> |
| 18 | </tr> |
| 19 | </thead> |
| 20 | <tbody> |
| 21 | <tr> |
| 22 | <td rowspan="2"> |
| 23 | <code class="no-bg">ust_baddr</code> |
| 24 | </td> |
| 25 | <td> |
| 26 | <code class="no-bg">push</code> |
| 27 | </td> |
| 28 | <td> |
| 29 | <p><code>dlopen()</code> call</p> |
| 30 | |
| 31 | <ul> |
| 32 | <li> |
| 33 | <code class="arg">baddr</code> memory |
| 34 | base address |
| 35 | (where the dynamic linker placed the shared |
| 36 | object) |
| 37 | </li> |
| 38 | <li> |
| 39 | <code class="arg">sopath</code> file system |
| 40 | path to the loaded shared object |
| 41 | </li> |
| 42 | <li> |
| 43 | <code class="arg">size</code> file size |
| 44 | of the the loaded shared object |
| 45 | </li> |
| 46 | <li> |
| 47 | <code class="arg">mtime</code> last |
| 48 | modification time (seconds since Epoch time) |
| 49 | of the loaded shared object |
| 50 | </li> |
| 51 | </ul> |
| 52 | </td> |
| 53 | </tr> |
| 54 | <tr> |
| 55 | <td> |
| 56 | <code class="no-bg">pop</code> |
| 57 | </td> |
| 58 | <td> |
| 59 | <p><code>dlclose()</code> call</p> |
| 60 | |
| 61 | <ul> |
| 62 | <li> |
| 63 | <code class="arg">baddr</code> memory |
| 64 | base address |
| 65 | </li> |
| 66 | </ul> |
| 67 | </td> |
| 68 | </tr> |
| 69 | </tbody> |
| 70 | </table> |
| 71 | </div> |
| 72 | |
| 73 | To use this LTTng-UST helper with any user application, independently of |
| 74 | how the latter is built, do: |
| 75 | |
| 76 | <pre class="term"> |
| 77 | LD_PRELOAD=liblttng-ust-dl.so my-app |
| 78 | </pre> |
| 79 | |
| 80 | Of course, like any other tracepoint, the ones above need to be enabled |
| 81 | in order for LTTng-UST to generate events. This is done using the |
| 82 | `lttng` command line tool |
| 83 | (see [Controlling tracing](#doc-controlling-tracing)). |