From: Philippe Proulx Date: Thu, 6 May 2021 20:50:17 +0000 (-0400) Subject: lttng-add-context(1): add usage examples X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=ed0a071d1ed8b289211d9b4f4c2afc5575143b13;p=lttng-tools.git lttng-add-context(1): add usage examples Signed-off-by: Philippe Proulx Signed-off-by: Jérémie Galarneau Change-Id: I8ce928325a659676210ea9d2647ce7223f9527aa --- diff --git a/doc/man/lttng-add-context.1.txt b/doc/man/lttng-add-context.1.txt index 237467850..5e1155708 100644 --- a/doc/man/lttng-add-context.1.txt +++ b/doc/man/lttng-add-context.1.txt @@ -1,6 +1,6 @@ lttng-add-context(1) ==================== -:revdate: 3 May 2021 +:revdate: 6 May 2021 NAME @@ -91,6 +91,7 @@ The possible values for this part are processor-specific. * An LTTng application-specific context field name: + +-- [verse] $app.'PROVIDER':__TYPE__ + @@ -99,6 +100,9 @@ $app.'PROVIDER':__TYPE__ 'TYPE':: Context type name. +-- ++ +Only available with the option:--jul and option:--log4j options. IMPORTANT: Make sure to **single-quote** 'TYPE' when you run the `add-context` command from a shell, as `$` is a special character for @@ -108,6 +112,8 @@ NOTE: As of LTTng{nbsp}{lttng_version}, you may :not: add context fields to be recorded to the event records of a given channel once its tracing session has been started (see man:lttng-start(1)) at least once. +See the <> section below for usage examples. + include::common-lttng-cmd-options-head.txt[] @@ -166,6 +172,55 @@ include::common-lttng-cmd-help-options.txt[] include::common-lttng-cmd-after-options.txt[] +[[examples]] +EXAMPLES +-------- +.List the available context field types. +==== +See the option:--list option. + +[role="term"] +---- +$ lttng add-context --list +---- +==== + +.Add a single statically-known context field to be recorded to all the Linux kernel channels of the current tracing session. +==== +[role="term"] +---- +$ lttng add-context --kernel --type=pid +---- +==== + +.Add three statically-known context fields to be recorded to a specific user space channel of a specific tracing session. +==== +[role="term"] +---- +$ lttng add-context --userspace --session=my-session \ + --channel=my-channel \ + --type=vpid --type=procname --type=ip +---- +==== + +.Add a perf counter context field to be recorded to a specific Linux kernel channel of the current tracing session. +==== +[role="term"] +---- +$ lttng add-context --kernel --channel=my-channel \ + --type=perf:cpu:cache-misses +---- +==== + +.Add an LTTng application-specific context field to be recorded to all the JUL channels of the current tracing session. +==== +[role="term"] +---- +$ lttng add-context --jul --type='$app.my_server:user_cnt' +---- +==== + + include::common-footer.txt[]