| 1 | lttng-add-context(1) |
| 2 | ==================== |
| 3 | |
| 4 | |
| 5 | NAME |
| 6 | ---- |
| 7 | lttng-add-context - Add context fields to an LTTng channel |
| 8 | |
| 9 | |
| 10 | SYNOPSIS |
| 11 | -------- |
| 12 | Add context fields to a channel: |
| 13 | |
| 14 | [verse] |
| 15 | *lttng* ['linkgenoptions:(GENERAL OPTIONS)'] *add-context* |
| 16 | (option:--kernel | option:--userspace | option:--jul | option:--log4j) |
| 17 | [option:--session='SESSION'] [option:--channel='CHANNEL'] |
| 18 | option:--type='TYPE' [option:--type='TYPE']... |
| 19 | |
| 20 | List the available context fields: |
| 21 | |
| 22 | [verse] |
| 23 | *lttng* ['linkgenoptions:(GENERAL OPTIONS)'] *add-context* option:--list |
| 24 | |
| 25 | |
| 26 | DESCRIPTION |
| 27 | ----------- |
| 28 | The `lttng add-context` command adds one or more context fields to a |
| 29 | channel. |
| 30 | |
| 31 | Channels are created with the linklttng:lttng-enable-channel(1) command. |
| 32 | |
| 33 | When context fields are added to a channel, all the events emitted |
| 34 | within this channel contain the dynamic values of those context fields. |
| 35 | |
| 36 | If the option:--session option is omitted, the current tracing session |
| 37 | is used. If the option:--channel option is omitted, the context fields |
| 38 | are added to all the selected tracing session's channels. |
| 39 | |
| 40 | Many context fields can be added to a channel at once by repeating the |
| 41 | option:--type option. |
| 42 | |
| 43 | perf counters are available as per-CPU (`perf:cpu:` prefix) as well as |
| 44 | per-thread (`perf:thread:` prefix) counters. Currently, per-CPU counters |
| 45 | can only be used in the Linux kernel tracing domain, while per-thread |
| 46 | counters can only be used in the user space tracing domain. |
| 47 | |
| 48 | Application-specific context fields can be added to a channel using the |
| 49 | following syntax: |
| 50 | |
| 51 | [verse] |
| 52 | $app.'PROVIDER':__TYPE__ |
| 53 | |
| 54 | with: |
| 55 | |
| 56 | 'PROVIDER':: |
| 57 | Provider name. |
| 58 | |
| 59 | 'TYPE':: |
| 60 | Context type name. |
| 61 | |
| 62 | Use the option:--list option without other arguments to list the |
| 63 | available context field names. |
| 64 | |
| 65 | |
| 66 | include::common-cmd-options-head.txt[] |
| 67 | |
| 68 | |
| 69 | Domain |
| 70 | ~~~~~~ |
| 71 | One of: |
| 72 | |
| 73 | option:-j, option:--jul:: |
| 74 | Add context to channel in the `java.util.logging` (JUL) domain. |
| 75 | |
| 76 | option:-k, option:--kernel:: |
| 77 | Add context to channel in the Linux kernel domain. |
| 78 | |
| 79 | option:-l, option:--log4j:: |
| 80 | Add context to channel in the Apache log4j domain. |
| 81 | |
| 82 | option:-u, option:--userspace:: |
| 83 | Add context to channel in the user space domain. |
| 84 | |
| 85 | |
| 86 | Target |
| 87 | ~~~~~~ |
| 88 | option:-c, option:--channel='CHANNEL':: |
| 89 | Add context fields to a channel named 'CHANNEL' instead of adding |
| 90 | them to all the channels. |
| 91 | |
| 92 | option:-s, option:--session='SESSION':: |
| 93 | Add context fields to a channel in the tracing session named 'SESSION' |
| 94 | instead of the current tracing session. |
| 95 | |
| 96 | |
| 97 | Context |
| 98 | ~~~~~~~ |
| 99 | option:--list:: |
| 100 | List the available context fields. Use this option alone. |
| 101 | |
| 102 | option:-t, option:--type='TYPE':: |
| 103 | Add context field named 'TYPE'. This option can be repeated as |
| 104 | many times as needed on the command-line. |
| 105 | |
| 106 | |
| 107 | include::common-cmd-help-options.txt[] |
| 108 | |
| 109 | |
| 110 | include::common-cmd-footer.txt[] |
| 111 | |
| 112 | |
| 113 | SEE ALSO |
| 114 | -------- |
| 115 | linklttng:lttng(1) |