X-Git-Url: http://git.liburcu.org/?a=blobdiff_plain;f=doc%2Fman%2Ftracelog.3.txt;h=5cf1953ae9ea573e1ba6f82e3d58e9230b2e3aa9;hb=bd9bb3c77252c984f8b6a7cbfb1d6ebbd069159c;hp=139e91bedccfec10224e441835f60214ee03a4de;hpb=4ddbd0b790be981d023f344a83e67a8746fa3688;p=lttng-ust.git diff --git a/doc/man/tracelog.3.txt b/doc/man/tracelog.3.txt index 139e91be..5cf1953a 100644 --- a/doc/man/tracelog.3.txt +++ b/doc/man/tracelog.3.txt @@ -5,7 +5,7 @@ tracelog(3) NAME ---- -tracelog - LTTng-UST man:printf(3)-like interface with a log level +tracelog - LTTng-UST printf(3)-like interface with a log level SYNOPSIS @@ -15,6 +15,7 @@ SYNOPSIS [verse] #define *tracelog*('level', 'fmt', ...) +#define *vtracelog*('level', 'fmt', 'va_list' ap) Link with `-llttng-ust`. @@ -34,9 +35,9 @@ The available values for the 'level' parameter are: include::log-levels.txt[] -To use `tracelog()`, include `` where you need it, and -link your application with `liblttng-ust`. See the <> -section below for a complete usage example. +To use `tracelog()` or `vtracelog()`, include `` where you +need it, and link your application with `liblttng-ust`. +See the <> section below for a complete usage example. Once your application is instrumented with `tracelog()` calls and ready to run, use man:lttng-enable-event(1) to enable the @@ -47,19 +48,27 @@ command. The `tracelog()` events contain the following fields: [options="header"] -|=============================================================== -| Field name | Description -| `line` | Line in source file where `tracelog()` was called -| `file` | Source file from which `tracelog()` was called -| `func` | Function name from which `tracelog()` was called -| `msg` | Formatted string output -|=============================================================== +|=== +|Field name |Description + +|`line` +|Line in source file where `tracelog()` was called. + +|`file` +|Source file from which `tracelog()` was called. + +|`func` +|Function name from which `tracelog()` was called. + +|`msg` +|Formatted string output. +|=== If you do not need to attach a specific log level to a `tracelog()` call, use man:tracef(3) instead. See also the <> section below for important -limitations to consider when using `tracelog()`. +limitations to consider when using `tracelog()` or `vtracelog()`. [[example]] @@ -96,43 +105,43 @@ This C source file, saved as `app.c`, can be compiled into a program like this: [role="term"] ---------------------------- -cc -o app app.c -llttng-ust ---------------------------- +---- +$ cc -o app app.c -llttng-ust +---- You can create an LTTng tracing session, enable all the `tracelog()` events, and start the created tracing session like this: [role="term"] ---------------------------------------------------- -lttng create my-session -lttng enable-event --userspace 'lttng_ust_tracelog:*' -lttng start ---------------------------------------------------- +---- +$ lttng create my-session +$ lttng enable-event --userspace 'lttng_ust_tracelog:*' +$ lttng start +---- Or you can enable `tracelog()` events matching a log level at least as severe as a given log level: [role="term"] -------------------------------------------------------- -lttng enable-event --userspace 'lttng_ust_tracelog:*' \ +---- +$ lttng enable-event --userspace 'lttng_ust_tracelog:*' \ --loglevel=TRACE_INFO -------------------------------------------------------- +---- Next, start the program to be traced: [role="term"] ------------------------------------------------- -./app a few arguments passed to this application ------------------------------------------------- +---- +$ ./app a few arguments passed to this application +---- Finally, stop the tracing session, and inspect the recorded events: [role="term"] ----------- -lttng stop -lttng view ----------- +---- +$ lttng stop +$ lttng view +---- [[limitations]]