From: Philippe Proulx Date: Thu, 7 Apr 2016 01:23:41 +0000 (-0400) Subject: doc/man: lttng-ust(3): split example files in subsections X-Git-Tag: v2.8.0-rc2~15 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=4211432521346433a0861ba688e32bb5acf5152d;p=lttng-ust.git doc/man: lttng-ust(3): split example files in subsections Signed-off-by: Philippe Proulx Signed-off-by: Mathieu Desnoyers --- diff --git a/doc/man/lttng-ust.3.txt b/doc/man/lttng-ust.3.txt index cbf28bb4..dda9cec6 100644 --- a/doc/man/lttng-ust.3.txt +++ b/doc/man/lttng-ust.3.txt @@ -833,7 +833,20 @@ 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 +------------------------------------- + + +Tracepoint provider header file +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +`tp.h`: ------------------------------------------------------------------------ #undef TRACEPOINT_PROVIDER @@ -954,7 +967,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 +979,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 +997,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 +1050,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 ---------------------