<html><body><div style="font-family: arial, helvetica, sans-serif; font-size: 12pt; color: #000000"><div><br></div><div><br></div><span id="zwchr" data-marker="__DIVIDER__">----- On Dec 7, 2016, at 9:27 AM, Anders Wallin <wallinux@gmail.com> wrote:<br></span><div data-marker="__QUOTED_TEXT__"><blockquote style="border-left:2px solid #1010FF;margin-left:5px;padding-left:5px;color:#000;font-weight:normal;font-style:normal;text-decoration:none;font-family:Helvetica,Arial,sans-serif;font-size:12pt;"><div dir="ltr">Hi,<br><div>Taking a number of snapshots always showed the events in the buffer, before the</div><div>commit de3fb857f034c208c135a10a3cdec2dfe43fbda6 </div><div><br><div><div>    Fix: ust-consumer: flush empty packets on snapshot channel</div><div>    Snapshot operation on a non-stopped stream should use a "final" flush to</div><div>    ensure empty packets are flushed, so we gather timestamps at the moment</div><div>    where the snapshot is taken. This is important for streams that have a</div><div>    low amount of activity, which might be on an empty packet when the</div><div>    snapshot is triggered.</div><br><div>After this the number of snapshots that can be taken and getting events is equal to number of sub-buffers!?</div><div>I think this i BUG!</div></div></div></div></blockquote><div><br></div><div>Hi,<br data-mce-bogus="1"></div><div><br data-mce-bogus="1"></div><div>This has been done on purpose. By moving one packet forward even if there is no data</div><div>in the current packet, we are able to save the end timestamp corresponding to the moment the</div><div>snapshot is taken, which gives us information about the proper time-range to consider for each<br data-mce-bogus="1"></div><div>stream.<br data-mce-bogus="1"></div><div><br data-mce-bogus="1"></div><div>This is needed for the babeltrace stream intersection feature to work properly on<br data-mce-bogus="1"></div><div>snapshots in cases where some streams have low even throughput.<br data-mce-bogus="1"></div><div><br data-mce-bogus="1"></div><div>Can you describe your use-cases that rely on the prior behavior ?<br data-mce-bogus="1"></div><div><br data-mce-bogus="1"></div><div>Thanks,<br data-mce-bogus="1"></div><div><br data-mce-bogus="1"></div><div>Mathieu</div><div><br data-mce-bogus="1"></div><blockquote style="border-left:2px solid #1010FF;margin-left:5px;padding-left:5px;color:#000;font-weight:normal;font-style:normal;text-decoration:none;font-family:Helvetica,Arial,sans-serif;font-size:12pt;"><div dir="ltr"><div><div><br><div>The following test script shows the problem!</div><div>-----------------------------------------------------------------</div><div><div>#!/bin/sh</div><br><div>TRACEAPP="/usr/lib/lttng-tools/ptest/tests/utils/testapp/gen-ust-events/gen-ust-events 1"</div><div>TRACEPATH=$HOME/lttng-snapshots<br></div><div>SESSION=tracetest</div><div>CHANNEL=tracechannel</div><br><div># cleanup</div><div>lttng destroy $SESSION<br></div><div>rm -rf $TRACEPATH</div><div>sleep 1</div><br><div>lttng create $SESSION --snapshot -U file://$TRACEPATH</div><div>lttng enable-channel $CHANNEL -u --subbuf-size 4k --num-subbuf 2</div><div>lttng enable-event -a -u -c $CHANNEL -s $SESSION</div><div>lttng start $SESSION</div><div>lttng --version</div><div>#lttng list $SESSION</div><br><div>$TRACEAPP <br></div><div>sleep 1</div><br><div>for i in $(seq 1 5); do</div><div>  lttng snapshot record --session $SESSION --name $i-something</div><div>  sleep 1</div><div>  echo "------------------------------------"</div><div>  echo " $i print events" </div><div>  babeltrace $TRACEPATH/$i-something* | head -1</div><div>done</div></div><div>------------------------------------------------------------------------</div><br><div>BEFOR the patch the output is like this (I have removed some lines to make it easier to read);</div><div>--------------------------------------------------------------------------------------------------------------------------</div><div><div>Session tracetest created.<br></div><div>Default snapshot output set to: file:///root/lttng-snapshots</div><div>Snapshot mode set. Every channel enabled for that session will be set in overwrite mode and mmap output.</div><div>UST channel tracechannel enabled for session tracetest</div><div>All UST events are enabled in channel tracechannel</div><div>Tracing started for session tracetest</div><div>lttng (LTTng Trace Control) 2.7.2</div><br><div>--- create some user events ---<br></div><div>Snapshot recorded successfully for session tracetest</div><div>------------------------------------</div><div> 1 print events</div><div>[15:02:11.886716015] (+?.?????????) axxiaarm lttng_ust_statedump:start: { cpu_id = 9 }, { }</div><div>------------------------------------<br></div><div>Snapshot recorded successfully for session tracetest</div><div> 2 print events</div><div><div>[15:02:11.886716015] (+?.?????????) axxiaarm lttng_ust_statedump:start: { cpu_id = 9 }, { }</div></div></div><div><div><div>------------------------------------<br></div><div>Snapshot recorded successfully for session tracetest</div><div> 3 print events</div><div>[15:02:11.886716015] (+?.?????????) axxiaarm lttng_ust_statedump:start: { cpu_id = 9 }, { }</div></div></div><div><div><div>------------------------------------<br></div><div>Snapshot recorded successfully for session tracetest</div><div> 4 print events</div><div>[15:02:11.886716015] (+?.?????????) axxiaarm lttng_ust_statedump:start: { cpu_id = 9 }, { }</div></div></div><div><div><div>------------------------------------<br></div><div>Snapshot recorded successfully for session tracetest</div><div> 5 print events</div><div>[15:02:11.886716015] (+?.?????????) axxiaarm lttng_ust_statedump:start: { cpu_id = 9 }, { }</div></div></div><br><div><br><div>AFTER the patch the output is like this (I have removed some lines to make it easier to read);</div><div>--------------------------------------------------------------------------------------------------------------------------</div><div><div>Session tracetest created.<br></div><div>Default snapshot output set to: file:///root/lttng-snapshots</div><div>Snapshot mode set. Every channel enabled for that session will be set in overwrite mode and mmap output.</div><div>UST channel tracechannel enabled for session tracetest</div><div>All UST events are enabled in channel tracechannel</div><div>Tracing started for session tracetest</div><div>lttng (LTTng Trace Control) 2.7.5</div><br><div>--- create some user events ---<br></div><div>Snapshot recorded successfully for session tracetest</div><div>------------------------------------</div><div> 1 print events</div><div>[15:02:11.886716015] (+?.?????????) axxiaarm lttng_ust_statedump:start: { cpu_id = 9 }, { }</div><div>------------------------------------<br></div><div>Snapshot recorded successfully for session tracetest</div><div> 2 print events</div><div>[15:02:11.886716015] (+?.?????????) axxiaarm lttng_ust_statedump:start: { cpu_id = 9 }, { }</div></div><div><div>------------------------------------<br></div><div>Snapshot recorded successfully for session tracetest</div><div> 3 print events</div><div>------------------------------------<br></div></div><div><div>Snapshot recorded successfully for session tracetest</div><div> 4 print events</div><div>------------------------------------<br></div></div><div><div>Snapshot recorded successfully for session tracetest</div><div> 5 print events</div><br></div></div></div><br><div>Tested on 2.7.5 and 2.8.2 with the same result<br clear="all"><div><div class="gmail_signature"><br></div><div class="gmail_signature">Regards</div><div class="gmail_signature">Anders Wallin</div></div></div></div></div><br>_______________________________________________<br>lttng-dev mailing list<br>lttng-dev@lists.lttng.org<br>https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev<br></blockquote></div><br><div data-marker="__SIG_POST__">-- <br></div><div>Mathieu Desnoyers<br>EfficiOS Inc.<br>http://www.efficios.com</div></div></body></html>