3 # Copyright (C) 2020 Jonathan Rajotte-Julien <jonathan.rajotte-julien@efficios.com>
5 # SPDX-License-Identifier: MIT
7 EVENT_NAME_HIT
=performance
:hit
8 EVENT_NAME_RECEIVE
=performance
:receive
9 TRIGGER_NAME
=performance_hit
12 echo "missing source id int value"
17 echo "missing trace directory name"
22 echo "missing loop delay"
27 echo "missing loop count"
32 trace_directory
="$(pwd)/trace/$2"
36 if ! lttng list
> /dev
/null
2>&1 ; then
37 echo "Could not connect to session daemon, are you sure it is running?"
41 lttng create performance
--output="$trace_directory"
42 lttng enable-event
-u $EVENT_NAME_HIT,$EVENT_NAME_RECEIVE -s performance
45 filter
="source==$key_id"
46 lttng add-trigger
--id ${TRIGGER_NAME} --condition on-event
--userspace $EVENT_NAME_HIT --filter="$filter" --action notify
48 .
/consumer
"$key_id" "$count" $TRIGGER_NAME &
50 # Cheap way to synchronize and ensure that the consumer is ready to consume
53 .
/producer
"$key_id" "$count" "$delay" &
57 lttng remove-trigger
${TRIGGER_NAME}
60 lttng destroy performance