NAME
----
-tracef - LTTng-UST printf(3)-like interface
+tracef, vtracef - LTTng-UST printf(3)-like interface
SYNOPSIS
[verse]
#define *tracef*('fmt', ...)
+#define *vtracef*('fmt', 'va_list' ap)
Link with `-llttng-ust`.
passed directly to the 'fmt' parameter of man:vasprintf(3), as well as
the optional parameters following 'fmt'.
-To use `tracef()`, include `<lttng/tracef.h>` where you need it, and
-link your application with `liblttng-ust`. See the <<example,EXAMPLE>>
+To use `tracef()` or `vtracef()`, include `<lttng/tracef.h>` where you need it,
+and link your application with `liblttng-ust`. See the <<example,EXAMPLE>>
section below for a complete usage example.
-Once your application is instrumented with `tracef()` calls and
+Once your application is instrumented with `tracef()` or `vtracef()` calls and
ready to run, use man:lttng-enable-event(1) to enable the
`lttng_ust_tracef:*` event.
man:tracelog(3) instead.
See also the <<limitations,LIMITATIONS>> section below for important
-limitations to consider when using `tracef()`.
+limitations to consider when using `tracef()` or `vtracef()`.
[[example]]
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 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
----------------------------------------------------
+----
+$ lttng create my-session
+$ lttng enable-event --userspace 'lttng_ust_tracef:*'
+$ lttng start
+----
Next, start the program to be traced:
[role="term"]
------
-./app
------
+----
+$ ./app
+----
Finally, stop the tracing session, and inspect the recorded events:
[role="term"]
-----------
-lttng stop
-lttng view
-----------
+----
+$ lttng stop
+$ lttng view
+----
[[limitations]]