SoW-2019-0002: Dynamic Snapshot
[lttng-tools.git] / doc / examples / trigger-on-event / README.md
CommitLineData
1831ae68
FD
1# Trigger notification exemple
2
3## Description
4This exemple is made-up of three executables.
5
6### `notification-client`
7
8```
9Usage: notification-client TRIGGER_NAME
10```
11
12A simple client that subscribes to the notifications emitted by the `TRIGGER_NAME` trigger.
13
14### `instrumented-app`
15
16An application that emits the `trigger_exemple:my_event` event every 2 seconds.
17
18### `demo.sh`
19
20This script adds a trigger named `demo_trigger` which emits a notification when the user-space `trigger_exemple:my_event` event occurs.
21
22Once the trigger has been setup, the notification-client is launched to print all notifications emitted by the `demo_trigger` trigger.
23
24## Building
25
26Simply run the included Makefile.
27
28## Running the exemple
29
301) Launch a session daemon using:
31 ```
32 $ lttng-sessiond
33 ```
342) Launch the `demo.sh` script
353) Launch the `instrumented-app`
36
37The following output should be produced:
38
39```
40$ ./demo.sh
41Registering a notification trigger named "demo_trigger" for the trigger_exemple:my_event user-space event
42Trigger registered successfully.
43Subscribed to notifications of trigger "demo_trigger"
44[02-14-2020] 18:13:34.779766 - Received notification of event rule trigger "demo_trigger"
45[02-14-2020] 18:13:36.779888 - Received notification of event rule trigger "demo_trigger"
46[02-14-2020] 18:13:38.780514 - Received notification of event rule trigger "demo_trigger"
47[02-14-2020] 18:13:40.780656 - Received notification of event rule trigger "demo_trigger"
48```
49
50```
51$ ./instrumented-app
52[02-14-2020] 18:13:34.779433 - Tracing event "trigger_exemple:my_event"
53[02-14-2020] 18:13:36.779693 - Tracing event "trigger_exemple:my_event"
54[02-14-2020] 18:13:38.780010 - Tracing event "trigger_exemple:my_event"
55[02-14-2020] 18:13:40.780286 - Tracing event "trigger_exemple:my_event"
56```
This page took 0.025994 seconds and 5 git commands to generate.