X-Git-Url: https://git.liburcu.org/?a=blobdiff_plain;f=contents%2Fusing-lttng%2Finstrumenting%2Fc-application%2Ftracef.md;h=1ec93c2674f6987351ca01124f16ebcc760374b8;hb=ce42e1818dc493540c735143e73495cb78f3ea28;hp=b4a9428bcbcf148e1ca5854ba3ac9290cdfa2e0f;hpb=5e0cbfb01373c18e521217342fd8a9159cc186b1;p=lttng-docs.git diff --git a/contents/using-lttng/instrumenting/c-application/tracef.md b/contents/using-lttng/instrumenting/c-application/tracef.md index b4a9428..1ec93c2 100644 --- a/contents/using-lttng/instrumenting/c-application/tracef.md +++ b/contents/using-lttng/instrumenting/c-application/tracef.md @@ -1,5 +1,6 @@ --- id: tracef +since: 2.5 --- `tracef()` is a small LTTng-UST API to avoid defining your own @@ -11,7 +12,7 @@ super simple, albeit with notable disadvantages compared to custom, full-fledged tracepoint providers: * All generated events have the same provider/event names, respectively - `lttng-ust-tracef` and `event`. + `lttng_ust_tracef` and `event`. * There's no static type checking. * The only event field you actually get, named `msg`, is a string potentially containing the values you passed to the function @@ -34,7 +35,8 @@ where you need to insert probes: #include ~~~ -Use `tracef()` like you would use `printf()` in your source code, e.g.: +Use `tracef()` like you would use `printf()` in your source code, for +example: ~~~ c /* ... */ @@ -57,4 +59,9 @@ Execute the application as usual: Voilà! Use the `lttng` command line tool to -[control tracing](#doc-controlling-tracing). +[control tracing](#doc-controlling-tracing). You can enable `tracef()` +events like this: + +
+lttng enable-event --userspace 'lttng_ust_tracef:*'
+