X-Git-Url: http://git.lttng.org/?a=blobdiff_plain;f=doc%2Fman%2Ftracef.3.txt;h=165e7261913f245f5d682c336dde369714c43a1d;hb=7fce6bd50990f582e0b81401dd8ffc25841af626;hp=cb35cc85f58c8b91381f9e4d1d11fe8842a5a0d6;hpb=4ddbd0b790be981d023f344a83e67a8746fa3688;p=lttng-ust.git diff --git a/doc/man/tracef.3.txt b/doc/man/tracef.3.txt index cb35cc85..165e7261 100644 --- a/doc/man/tracef.3.txt +++ b/doc/man/tracef.3.txt @@ -5,7 +5,7 @@ tracef(3) NAME ---- -tracef - LTTng-UST man:printf(3)-like interface +tracef - LTTng-UST printf(3)-like interface SYNOPSIS @@ -16,96 +16,16 @@ SYNOPSIS [verse] #define *tracef*('fmt', ...) -Link with `-llttng-ust`. +Link with `-llttng-ust -llttng-ust-common`. DESCRIPTION ----------- -The LTTng-UST `tracef()` API allows you to trace your application with -the help of a simple man:printf(3)-like macro. The 'fmt' argument is -passed directly to the 'fmt' parameter of man:vasprintf(3), as well as -the optional parameters following 'fmt'. - -To use `tracef()`, 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 `tracef()` calls and -ready to run, use man:lttng-enable-event(1) to enable the -`lttng_ust_tracef:*` event. - -The `tracef()` events contain a single field, named `msg`, which is the -formatted string output. - -If you need to attach a specific log level to a `tracef()` call, use -man:tracelog(3) instead. - -See also the <> section below for important -limitations to consider when using `tracef()`. - - -[[example]] -EXAMPLE -------- -Here's a usage example of `tracef()`: - -------------------------------------------------------------------- -#include -#include - -int main(void) -{ - int i; - - for (i = 0; i < 25; i++) { - tracef("my message: %s, this integer: %d", "a message", i); - } - - return EXIT_SUCCESS; -} -------------------------------------------------------------------- - -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 ---------------------------- - -You can create an LTTng tracing session, enable the `tracef()` events, -and start the created tracing session like this: - -[role="term"] ---------------------------------------------------- -lttng create my-session -lttng enable-event --userspace 'lttng_ust_tracef:*' -lttng start ---------------------------------------------------- - -Next, start the program to be traced: - -[role="term"] ------ -./app ------ - -Finally, stop the tracing session, and inspect the recorded events: - -[role="term"] ----------- -lttng stop -lttng view ----------- - - -[[limitations]] -LIMITATIONS ------------ -:macro-name: tracef - -include::tracef-tracelog-limitations.txt[] +The `tracef()` macro is part of version{nbsp}0 of the LTTng-UST API (see +the ``Compatibility with previous APIs'' section of man:lttng-ust(3)). +Prefer using man:lttng_ust_tracef(3) which is part of version{nbsp}1 of +the API and has the `lttng_ust_` namespace. include::common-footer.txt[] @@ -116,7 +36,5 @@ include::common-authors.txt[] SEE ALSO -------- -man:tracelog(3), -man:lttng-ust(3), -man:lttng(1), -man:printf(3) +man:lttng_ust_tracef(3), +man:lttng_ust_vtracef(3)