SoW-2020-0002: Trace Hit Counters: trigger error reporting integration
[lttng-tools.git] / doc / examples / trigger-on-event / demo.sh
1 #!/bin/bash
2 #
3 # Copyright (C) 2020 Jérémie Galarneau <jeremie.galarneau@efficios.com>
4 #
5 # SPDX-License-Identifier: MIT
6
7 EVENT_NAME=trigger_example:my_event
8 TRIGGER_NAME=demo_trigger
9 TRIGGER_NAME_CAPTURE=demo_trigger_capture
10
11 lttng list > /dev/null 2>&1
12 if [ $? -ne 0 ]; then
13 echo "Could not connect to session daemon, are you sure it is running?"
14 exit 1
15 fi
16
17 echo "Registering a notification trigger named \"$TRIGGER_NAME\" for the $EVENT_NAME user-space event"
18 lttng add-trigger --id $TRIGGER_NAME --condition on-event --userspace $EVENT_NAME --action notify
19 lttng add-trigger --id $TRIGGER_NAME_CAPTURE --condition on-event --userspace $EVENT_NAME --capture 'iteration' --capture 'does_not_exist' --capture '$ctx.vtid' --capture '$ctx.procname' --action notify
20
21 ./notification-client $TRIGGER_NAME $TRIGGER_NAME_CAPTURE
22
This page took 0.042019 seconds and 5 git commands to generate.