-
Increment a map value
-
Synopsis:
--action=incr-map-value --session=SESSION --channel=CHANNEL
--type=(kernel | user) --key=TEMPLATE
Increments a counter within the map channel named CHANNEL (see
lttng-add-map-channel(1)) with the type of --type
within the recording session named SESSION.
The effective key of the counter to increment is the result of
expanding TEMPLATE. Within TEMPLATE, LTTng substitutes the following
placeholders:
-
{event_name}
-
The effective name of the event which made the trigger fire (see
the “Event name condition” section of lttng-event-rule(7)).
For example, canadian_tire:money_redeemed (user space tracepoint),
sched_switch (Linux kernel tracepoint), openat (Linux kernel
system call), or ca.provigo.checkout.ScannerLogger
(Java or Python logger name).
-
{provider_name}
-
The name of the LTTng tracepoint provider of the event which made
the trigger fire.
For example, canadian_tire
(user space tracepoint canadian_tire:money_redeemed) or sched
(Linux kernel tracepoint sched_switch).
Any other text in TEMPLATE is used as is. To include a literal {
or } character in the resulting key, use in TEMPLATE
(similar to {fmt} and Python’s f-string syntax).
You may only use the {event_name} and {provider_name} placeholders
when the condition of the trigger is an
“event rule matches” condition
(event-rule-matches). With any other condition, TEMPLATE must be
literal text.
Moreover, you may not use the {event_name} or {provider_name}
placeholders when the event rule of the “event rule matches” condition
has the jul:logging, log4j:logging, log4j2:logging, or
python:logging instrumentation point type (see the --type
option of lttng-event-rule(7)): TEMPLATE must be literal text in
that case.
When the condition of the trigger isn’t an
“event rule matches” condition
(event-rule-matches), --type must be user: LTTng increments
a counter within the shared user space map, as there’s no kernel
instrumentation point executor in that case.
The map channel named CHANNEL within the recording session named
SESSION must exist when LTTng is ready to execute the action;
otherwise, LTTng does nothing.
LTTng only increments the counter when the recording session named
SESSION is active (started; see lttng-start(1)). While the
recording session is inactive (stopped; see lttng-stop(1)), the
action does nothing.
The update policy of CHANNEL (see the --update-policy
option of lttng-add-map-channel(1)) controls how LTTng increments
counters when multiple “increment map value” actions which target
SESSION and CHANNEL produce the same effective key (for example,
multiple “event rule matches” triggers matching the same event).
Unlike the other action types, the incr-map-value action doesn’t
support the --rate-policy option: its effective rate policy
is every:1.
Unlike the other action types, an incr-map-value action may
execute out of order: when the action list of the trigger contains at
least one incr-map-value action, LTTng doesn’t guarantee the execution
order of the incr-map-value action(s) relative to all the actions of
the list, including other incr-map-value actions. In other words,
the significant action specifier order (see above) only holds amongst
the non-``incr-map-value`` actions.
The short options -s, -c, -t, and
-k are aliases of --session, --channel,
--type, and --key.
-
Notify
-
Synopsis:
--action=notify [--rate-policy=POLICY]
Sends a notification through the notification
mechanism of the session daemon (see lttng-sessiond(8)).
The session daemon sends details about the condition evaluation along
with the notification.
As of LTTng 2.16, you can write a C/C++ program
to receive LTTng notifications (see the liblttng-ctl C headers).
See below for the --rate-policy option.
-
Start a recording session
-
Synopsis:
--action=start-session SESSION [--rate-policy=POLICY]
Starts the recording session named SESSION like lttng-start(1)
would.
If no recording session has the name SESSION when LTTng is ready to
execute the action, LTTng does nothing.
See below for the --rate-policy option.
-
Stop a recording session
-
Synopsis:
--action=stop-session SESSION [--rate-policy=POLICY]
Stops the recording session named SESSION like lttng-stop(1)
would.
If no recording session has the name SESSION when LTTng is ready to
execute the action, LTTng does nothing.
See below for the --rate-policy option.
-
Rotate a recording session
-
Synopsis:
--action=rotate-session SESSION [--rate-policy=POLICY]
Archives the current trace chunk of the recording session named
SESSION like lttng-rotate(1) would.
If no recording session has the name SESSION when LTTng is ready to
execute the action, LTTng does nothing.
See below for the --rate-policy option.
-
Take a recording session snapshot
-
Synopsis:
--action=snapshot-session SESSION [--name=NAME]
[--max-size=SIZE]
[--path=PATH | --url=URL |
(--ctrl-url=URL --data-url=URL)]
[--rate-policy=POLICY]
Takes a snapshot of the recording session named SESSION like
lttng-snapshot(1) would.
When the condition of the trigger is satisfied, the recording session
named SESSION, if any, must be a snapshot-mode recording session
(see lttng-create(1)).
If no recording session has the name SESSION when LTTng is ready to
execute the action, LTTng does nothing.
See the add-output action of the lttng-snapshot(1) command
to learn about the snapshot output options:
--name/-n,
--max-size/-m,
--url,
--ctrl-url/-C, and
--data-url/-D. The --path option specifies
to write the snapshot to the local directory PATH.
See below for the --rate-policy option.