Hi,
I am observing a performance issue with regards to enabling events while a session is active and was wondering if this is expected.
LTTng versions:
Steps to reproduce:
The time it takes to enable each new event has increasing cost e.g.
If either:
Then the time it takes to enable new events is constant (e.g. 1ms).
Below is a bash script demonstrating this behavior:
# Pre-requisite: have many userspace tracepoints available
lttng create foo
lttng enable-channel -u -s foo bar
lttng start foo
total_t1=$(date +%s%3N);
for i in {1..100}
do
t1=$(date +%s%3N);
lttng enable-event -u lttng_iter_$i -s foo -c bar > /dev/null
t2=$(date +%s%3N);
echo "Event #$i took $((t2-t1)) ms"
done
total_t2=$(date +%s%3N);
echo "----------------------------------------------------"
echo "Enabling events on active session took $((total_t2-total_t1)) ms"
echo "----------------------------------------------------"
lttng destroy foo
lttng create foo
lttng enable-channel -u -s foo bar
total_t1=$(date +%s%3N);
for i in {1..100}
do
t1=$(date +%s%3N);
lttng enable-event -u lttng_iter_$i -s foo -c bar > /dev/null
t2=$(date +%s%3N);
echo "Event #$i took $((t2-t1)) ms"
done
total_t2=$(date +%s%3N);
echo "----------------------------------------------------"
echo "Enabling events on inactive session took $((total_t2-total_t1)) ms"
echo "----------------------------------------------------"
lttng destroy foo
Is this reproducible for you? Any insight is appreciated.
Many thanks,
Zach