[lttng-dev] Snapshot gives no events after calling it more then the number sub-buffers in the channel

Anders Wallin wallinux at gmail.com
Wed Dec 7 14:27:34 UTC 2016


Hi,

Taking a number of snapshots always showed the events in the buffer, before
the
commit de3fb857f034c208c135a10a3cdec2dfe43fbda6

    Fix: ust-consumer: flush empty packets on snapshot channel

    Snapshot operation on a non-stopped stream should use a "final" flush to
    ensure empty packets are flushed, so we gather timestamps at the moment
    where the snapshot is taken. This is important for streams that have a
    low amount of activity, which might be on an empty packet when the
    snapshot is triggered.

After this the number of snapshots that can be taken and getting events is
equal to number of sub-buffers!?
I think this i BUG!

The following test script shows the problem!
-----------------------------------------------------------------
#!/bin/sh

TRACEAPP="/usr/lib/lttng-tools/ptest/tests/utils/testapp/gen-ust-events/gen-ust-events
1"
TRACEPATH=$HOME/lttng-snapshots
SESSION=tracetest
CHANNEL=tracechannel

# cleanup
lttng destroy $SESSION
rm -rf $TRACEPATH
sleep 1

lttng create $SESSION --snapshot -U file://$TRACEPATH
lttng enable-channel $CHANNEL -u --subbuf-size 4k --num-subbuf 2
lttng enable-event -a -u -c $CHANNEL -s $SESSION
lttng start $SESSION
lttng --version
#lttng list $SESSION

$TRACEAPP
sleep 1

for i in $(seq 1 5); do
  lttng snapshot record --session $SESSION --name $i-something
  sleep 1
  echo "------------------------------------"
  echo " $i print events"
  babeltrace $TRACEPATH/$i-something* | head -1
done
------------------------------------------------------------------------

BEFOR the patch the output is like this (I have removed some lines to make
it easier to read);
--------------------------------------------------------------------------------------------------------------------------
Session tracetest created.
Default snapshot output set to: file:///root/lttng-snapshots
Snapshot mode set. Every channel enabled for that session will be set in
overwrite mode and mmap output.
UST channel tracechannel enabled for session tracetest
All UST events are enabled in channel tracechannel
Tracing started for session tracetest
lttng (LTTng Trace Control) 2.7.2

--- create some user events ---
Snapshot recorded successfully for session tracetest
------------------------------------
 1 print events
[15:02:11.886716015] (+?.?????????) axxiaarm lttng_ust_statedump:start: {
cpu_id = 9 }, { }
------------------------------------
Snapshot recorded successfully for session tracetest
 2 print events
[15:02:11.886716015] (+?.?????????) axxiaarm lttng_ust_statedump:start: {
cpu_id = 9 }, { }
------------------------------------
Snapshot recorded successfully for session tracetest
 3 print events
[15:02:11.886716015] (+?.?????????) axxiaarm lttng_ust_statedump:start: {
cpu_id = 9 }, { }
------------------------------------
Snapshot recorded successfully for session tracetest
 4 print events
[15:02:11.886716015] (+?.?????????) axxiaarm lttng_ust_statedump:start: {
cpu_id = 9 }, { }
------------------------------------
Snapshot recorded successfully for session tracetest
 5 print events
[15:02:11.886716015] (+?.?????????) axxiaarm lttng_ust_statedump:start: {
cpu_id = 9 }, { }


AFTER the patch the output is like this (I have removed some lines to make
it easier to read);
--------------------------------------------------------------------------------------------------------------------------
Session tracetest created.
Default snapshot output set to: file:///root/lttng-snapshots
Snapshot mode set. Every channel enabled for that session will be set in
overwrite mode and mmap output.
UST channel tracechannel enabled for session tracetest
All UST events are enabled in channel tracechannel
Tracing started for session tracetest
lttng (LTTng Trace Control) 2.7.5

--- create some user events ---
Snapshot recorded successfully for session tracetest
------------------------------------
 1 print events
[15:02:11.886716015] (+?.?????????) axxiaarm lttng_ust_statedump:start: {
cpu_id = 9 }, { }
------------------------------------
Snapshot recorded successfully for session tracetest
 2 print events
[15:02:11.886716015] (+?.?????????) axxiaarm lttng_ust_statedump:start: {
cpu_id = 9 }, { }
------------------------------------
Snapshot recorded successfully for session tracetest
 3 print events
------------------------------------
Snapshot recorded successfully for session tracetest
 4 print events
------------------------------------
Snapshot recorded successfully for session tracetest
 5 print events


Tested on 2.7.5 and 2.8.2 with the same result

Regards
Anders Wallin
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.lttng.org/pipermail/lttng-dev/attachments/20161207/17a4c8f9/attachment.html>


More information about the lttng-dev mailing list