From 885adac87fb5d9ce7384be7eabe52248ed99fc0f Mon Sep 17 00:00:00 2001 From: Philippe Proulx Date: Wed, 6 Apr 2016 21:23:41 -0400 Subject: [PATCH] doc/man: lttng-ust(3): split example files in subsections Signed-off-by: Philippe Proulx Signed-off-by: Mathieu Desnoyers --- doc/man/lttng-ust.3.txt | 40 ++++++++++++++++++++++++++-------------- 1 file changed, 26 insertions(+), 14 deletions(-) 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 --------------------- -- 2.34.1