X-Git-Url: http://git.liburcu.org/?a=blobdiff_plain;f=doc%2Fman%2Flttng-ust.3.txt;h=c7b82c1a61876762a0026b183b8c3d1aabdce890;hb=444da810e491b66b873466c240202c27e0cd1adc;hp=cbf28bb4c8a17790e5a51667823c2e9e5e949483;hpb=7a9c458512b11824be687a6b716514d403f25487;p=lttng-ust.git diff --git a/doc/man/lttng-ust.3.txt b/doc/man/lttng-ust.3.txt index cbf28bb4..c7b82c1a 100644 --- a/doc/man/lttng-ust.3.txt +++ b/doc/man/lttng-ust.3.txt @@ -777,18 +777,20 @@ This event has no fields. This event has no fields. `lttng_ust_statedump:soinfo`:: - Emitted when information about a currently loaded shared object is - found. + Emitted when information about a currently loaded executable or + shared object is found. + Fields: + [options="header"] -|============================================================== +|================================================================== | Field name | Description -| `baddr` | Base address of loaded library -| `memsz` | Size of loaded library in memory -| `sopath` | Path to loaded library file -|============================================================== +| `baddr` | Base address of loaded executable +| `memsz` | Size of loaded executable in memory +| `sopath` | Path to loaded executable file +| `is_pic` | Whether the executable is + position-independent code +|================================================================== `lttng_ust_statedump:build_id`:: Emitted when a build ID is found in a currently loaded shared @@ -833,7 +835,53 @@ This example shows all the features documented in the previous sections. The <> method is chosen here to link the application with the tracepoint provider. -Let's start with the tracepoint provider header file (`tp.h`): +You can compile the source files and link them together statically +like this: + +[role="term"] +------------------------------------- +cc -c -I. tp.c +cc -c app.c +cc -o app tp.o app.o -llttng-ust -ldl +------------------------------------- + +Using the man:lttng(1) tool, create an LTTng tracing session, enable +all the events of this tracepoint provider, and start tracing: + +[role="term"] +---------------------------------------------- +lttng create my-session +lttng enable-event --userspace 'my_provider:*' +lttng start +---------------------------------------------- + +You may also enable specific events: + +[role="term"] +---------------------------------------------------------- +lttng enable-event --userspace my_provider:big_event +lttng enable-event --userspace my_provider:event_instance2 +---------------------------------------------------------- + +Run the application: + +[role="term"] +-------------------- +./app some arguments +-------------------- + +Stop the current tracing session and inspect the recorded events: + +[role="term"] +---------- +lttng stop +lttng view +---------- + + +Tracepoint provider header file +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +`tp.h`: ------------------------------------------------------------------------ #undef TRACEPOINT_PROVIDER @@ -954,7 +1002,10 @@ TRACEPOINT_EVENT_INSTANCE( #include ------------------------------------------------------------------------ -The tracepoint provider source file looks like this (`tp.c`): + +Tracepoint provider source file +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +`tp.c`: ------------------------------------------------------------------------ #define TRACEPOINT_CREATE_PROBES @@ -963,7 +1014,10 @@ The tracepoint provider source file looks like this (`tp.c`): #include "tp.h" ------------------------------------------------------------------------ -The included `app.h`, where the application structure resides, is: + +Application header file +~~~~~~~~~~~~~~~~~~~~~~~ +`app.h`: ------------------------------------------------------------------------ #ifndef _APP_H @@ -978,7 +1032,10 @@ struct app_struct { #endif /* _APP_H */ ------------------------------------------------------------------------ -Finally, the application itself, `app.c`, using the defined tracepoints: + +Application source file +~~~~~~~~~~~~~~~~~~~~~~~ +`app.c`: ------------------------------------------------------------------------ #include @@ -1028,16 +1085,6 @@ int main(int argc, char* argv[]) } ------------------------------------------------------------------------ -Here are the steps to compile the source files and link them together -statically: - -[role="term"] -------------------------------------- -cc -c -I. tp.c -cc -c app.c -cc -o app tp.o app.o -llttng-ust -ldl -------------------------------------- - ENVIRONMENT VARIABLES ---------------------