1 ####################################################################
2 # Copyright (c) 2012, 2015 Ericsson
4 # All rights reserved. This program and the accompanying materials are
5 # made available under the terms of the Eclipse Public License v1.0 which
6 # accompanies this distribution, and is available at
7 # http://www.eclipse.org/legal/epl-v10.html
10 # Bernd Hufmann - Initial API and implementation
11 ####################################################################
12 ####################################################################
13 # Scenario: Test lttng not installed
14 ####################################################################
24 <COMMAND_ERROR_OUTPUT>
26 </COMMAND_ERROR_OUTPUT>
30 ####################################################################
31 # Scenario: Test lttng version
32 ####################################################################
42 lttng version 2.1.0 - Basse Messe
43 Web site: http://lttng.org/
45 lttng is free software and under the GPL license and part LGPL
49 ####################################################################
50 # Scenario: Test lttng version
52 ####################################################################
54 LttngVersionWithPrompt
62 Prompt> lttng version 2.0.0 - Annedd'ale
63 Web site: http://lttng.org/
65 lttng is free software and under the GPL license and part LGPL
69 ####################################################################
70 # Scenario: Test lttng version (unsupported version)
71 ####################################################################
73 LttngUnsupportedVersion
81 lttng version 200.0.0 - Annedd'ale
82 Web site: http://lttng.org/
84 lttng is free software and under the GPL license and part LGPL
89 ####################################################################
90 # Scenario: Test lttng version (noversion)
91 ####################################################################
101 Web site: http://lttng.org/
103 lttng is free software and under the GPL license and part LGPL
107 ####################################################################
108 # Scenario: Test lttng version (compiled from source)
109 ####################################################################
119 lttng version heads/stable-2.5-0-g3910e60 - Fumisterie
121 The Fumisterie is a beer whose style is at the confluence of English and German ales. On the palate, it is full-bodied, malty and slightly caramelized. The organic hemp seeds incorporated during the brewing gives it a unique and original taste. The hop flavour comes through delicately in the after taste.
123 Web site: http://lttng.org
125 lttng is free software and under the GPL license and part LGPL
129 ####################################################################
130 # Scenario: Test no sessions available
131 ####################################################################
141 Currently no available tracing session
145 ####################################################################
146 # Scenario: Test get sessions
147 ####################################################################
157 Available tracing sessions:
158 1) mysession1 (/home/user/lttng-traces/mysession1-20120123-083928) [inactive]
159 2) mysession (/home/user/lttng-traces/mysession-20120123-083318) [inactive]
161 Use lttng list <session_name> for more details
165 ####################################################################
166 # Scenario: Test get sessions with tracing group
167 ####################################################################
169 GetSessionWithTracingGroup
177 Available tracing sessions:
178 1) mysession1 (/home/user/lttng-traces/mysession1-20120123-083928) [inactive]
179 2) mysession (/home/user/lttng-traces/mysession-20120123-083318) [inactive]
181 Use lttng list <session_name> for more details
185 ####################################################################
186 # Scenario: Test lttng list <name> where session doesn't exist
187 ####################################################################
189 GetSessionNameNotExist
197 Session test not found
198 <COMMAND_ERROR_OUTPUT>
199 Error: Session name not found
200 </COMMAND_ERROR_OUTPUT>
204 ####################################################################
205 # Scenario: Test lttng -vvv list <name> where session doesn't exist
206 ####################################################################
208 GetSessionNameNotExistVerbose
216 DEBUG2: Session name: test [in cmd_list() at commands/list.c:618]
217 DEBUG1: Session count 1 [in list_sessions() at commands/list.c:485]
218 <COMMAND_ERROR_OUTPUT>
219 Error: Session 'test' not found
221 </COMMAND_ERROR_OUTPUT>
222 DEBUG1: Clean exit [in clean_exit() at lttng.c:165]
226 ####################################################################
227 # Scenario: Test lttng list with garbage output
228 ####################################################################
238 asdfaereafsdcv 12333456434&*89**(())(^%$*
239 @#$%^&*()@#$%^&*()0834523094578kj;djkfs
240 a;sdf094v5u dsafj;sd9
244 ####################################################################
245 # Scenario: Test lttng list <name> with sample outputs
246 ####################################################################
256 Tracing session mysession: [active]
257 Trace path: /home/user/lttng-traces/mysession-20120129-084256
259 === Domain: Kernel ===
263 - channel0: [enabled]
267 subbufers size: 262144
268 number of subbufers: 4
269 switch timer interval: 0
270 read timer interval: 200
274 block_rq_remap (loglevel: TRACE_EMERG (0)) (type: tracepoint) [enabled]
275 block_bio_remap (loglevel: TRACE_EMERG (0)) (type: tracepoint) [disabled]
277 - channel1: [disabled]
281 subbufers size: 524288
282 number of subbufers: 4
283 switch timer interval: 100
284 read timer interval: 400
290 === Domain: UST global ===
294 - mychannel1: [disabled]
299 number of subbufers: 8
300 switch timer interval: 200
301 read timer interval: 100
307 - channel0: [enabled]
312 number of subbufers: 4
313 switch timer interval: 0
314 read timer interval: 200
318 ust_tests_hello:tptest_sighandler (loglevel: TRACE_DEBUG_LINE (13)) (type: tracepoint) [disabled]
319 * (type: tracepoint) [enabled]
323 lttng list mysession1
329 Tracing session mysession1: [inactive]
330 Trace path: /home/user/lttng-traces/mysession1-20120203-133225
335 ####################################################################
336 # Scenario: Test lttng list <name> (with live time interval)
337 ####################################################################
339 GetSessionWithLiveInterval
347 Tracing session mysession: [inactive snapshot]
349 Live timer interval (usec): 4294967295
352 #------------------------------------------------------------------------------
354 lttng snapshot list-output -s mysession
360 Snapshot output list for session mysession
361 [1] snapshot-1: /home/user/lttng-traces/mysession-20120129-084256 (max-size: 0)
363 #------------------------------------------------------------------------------
365 lttng list mysession1
371 Tracing session mysession1: [active]
372 Trace path: /home/user/lttng-traces/mysession1-20120129-084256
373 Live timer interval (usec): 0
376 #------------------------------------------------------------------------------
378 lttng list mysession2
384 Tracing session mysession2: [inactive]
385 Trace path: tcp4://172.0.0.1:5342/ [data: 5343]
386 Live timer interval (usec): 1000000
391 ####################################################################
392 # Scenario: Test "lttng list -k" with sample output
393 ####################################################################
405 sched_kthread_stop (loglevel: TRACE_EMERG (0)) (type: tracepoint)
406 sched_kthread_stop_ret (loglevel: TRACE_EMERG (0)) (type: tracepoint)
407 sched_wakeup_new (loglevel: TRACE_EMERG (0)) (type: tracepoint)
412 ####################################################################
413 # Scenario: Test "lttng list -k" with no kernel and no session daemon
414 ####################################################################
424 Spawning session daemon
425 <COMMAND_ERROR_OUTPUT>
426 Error: Unable to list kernel events
427 </COMMAND_ERROR_OUTPUT>
431 ####################################################################
432 # Scenario: Test "lttng list -k" with no kernel and with session daemon
433 ####################################################################
443 <COMMAND_ERROR_OUTPUT>
444 Error: Unable to list kernel events
445 </COMMAND_ERROR_OUTPUT>
449 ####################################################################
450 # Scenario: Test "lttng list -k" with no kernel, with session daemon and verbose
451 ####################################################################
453 ListWithNoKernelVerbose
461 DEBUG2: Session name: (null) [in cmd_list() at commands/list.c:618]
462 DEBUG1: Getting kernel tracing events [in list_kernel_events() at commands/list.c:309]
463 <COMMAND_ERROR_OUTPUT>
464 Error: Unable to list kernel events
465 </COMMAND_ERROR_OUTPUT>
466 DEBUG1: Clean exit [in clean_exit() at lttng.c:165]
470 ####################################################################
471 # Scenario: Test "lttng list -u" with sample output
472 ####################################################################
485 PID: 9379 - Name: /home/user/git/lttng-ust/tests/hello.cxx/.libs/lt-hello
486 ust_tests_hello:tptest_sighandler (loglevel: TRACE_DEBUG_MODULE (10)) (type: tracepoint)
487 ust_tests_hello:tptest (loglevel: TRACE_INFO (6)) (type: tracepoint)
489 PID: 4852 - Name: /home/user/git/lttng-ust/tests/hello.cxx/.libs/lt-hello
490 ust_tests_hello:tptest_sighandler (loglevel: TRACE_WARNING (4)) (type: tracepoint)
491 ust_tests_hello:tptest (loglevel: TRACE_DEBUG_FUNCTION (12)) (type: tracepoint)
496 ####################################################################
497 # Scenario: Test "lttng list -u" with no UST provider available
498 ####################################################################
515 ####################################################################
516 # Scenario: Test "lttng list -u" with no UST available (LTTng 2.0.x)
517 ####################################################################
534 ####################################################################
535 # Scenario: Test "lttng list -u" with no UST available and no session daemon
536 ####################################################################
546 Spawning a session daemon
547 <COMMAND_ERROR_OUTPUT>
548 Error: Unable to list UST events: Listing UST events failed
550 </COMMAND_ERROR_OUTPUT>
554 ####################################################################
555 # Scenario: Test "lttng list -u" with no ust and with session daemon
556 ####################################################################
566 <COMMAND_ERROR_OUTPUT>
567 Error: Unable to list UST events: Listing UST events failed
569 </COMMAND_ERROR_OUTPUT>
573 ####################################################################
574 # Scenario: Test "lttng list -u" with no kernel, with session daemon and verbose
575 ####################################################################
579 lttng -vvv list -u -f
585 DEBUG2: Session name: (null) [in cmd_list() at commands/list.c:618]
586 DEBUG1: Getting kernel tracing events [in list_kernel_events() at commands/list.c:309]
587 Spawning a session daemon
588 <COMMAND_ERROR_OUTPUT>
589 Error: Unable to list UST events: Listing UST events failed
591 </COMMAND_ERROR_OUTPUT>
592 DEBUG1: Clean exit [in clean_exit() at lttng.c:165]
597 ####################################################################
598 # Scenario: Test "lttng list -u -f" with sample output (version 2.1.0)
599 ####################################################################
612 PID: 9379 - Name: /home/user/git/lttng-ust/tests/hello.cxx/.libs/lt-hello
613 ust_tests_hello:tptest_sighandler (loglevel: TRACE_DEBUG_MODULE (10)) (type: tracepoint)
614 ust_tests_hello:tptest (loglevel: TRACE_INFO (6)) (type: tracepoint)
615 field: doublefield (float)
616 field: floatfield (float)
617 field: stringfield (string)
619 PID: 4852 - Name: /home/user/git/lttng-ust/tests/hello.cxx/.libs/lt-hello
620 ust_tests_hello:tptest_sighandler (loglevel: TRACE_WARNING (4)) (type: tracepoint)
621 ust_tests_hello:tptest (loglevel: TRACE_DEBUG_FUNCTION (12)) (type: tracepoint)
622 field: doublefield (float)
623 field: floatfield (float)
624 field: stringfield (string)
630 ####################################################################
631 # Scenario: Test "lttng create <session>
632 ####################################################################
636 lttng create mysession2
642 Session mysession2 created.
643 Traces will be written in /home/user/lttng-traces/mysession2-20120209-095418
647 ####################################################################
648 # Scenario: Test "lttng create <session>
649 ####################################################################
651 CreateSessionWithPrompt
653 lttng create mysession2
659 Prompt> Session mysession2 created.
660 Traces will be written in /home/user/lttng-traces/mysession2-20120209-095418
664 ####################################################################
665 # Scenario: Test "lttng create <session> with different variants
667 ####################################################################
669 CreateSessionVariants
671 lttng create alreadyExist
677 <COMMAND_ERROR_OUTPUT>
678 Error: Session name already exist
679 </COMMAND_ERROR_OUTPUT>
683 lttng create session with spaces
689 Session session with spaces created.
690 Traces will be written in /home/user/lttng-traces/session with spaces-20120209-095418
694 lttng create wrongName
700 Session auto created.
701 Traces will be written in /home/user/lttng-traces/auto-20120209-095418
705 lttng create wrongPath -o /home/user/hallo
711 Session wrongPath created.
712 Traces will be written in /home/user/lttng-traces/wrongPath-20120209-095418
716 lttng create pathWithSpaces -o /home/user/hallo user/here
722 Session pathWithSpaces created.
723 Traces will be written in /home/user/hallo user/here/pathWithSpaces-20120209-095418
727 ####################################################################
728 # Scenario: Test "lttng destroy <session>
729 ####################################################################
734 lttng destroy mysession2
740 Session mysession2 destroyed.
744 ####################################################################
745 # Scenario: Test "lttng -vvv destroy <session>"
746 ####################################################################
749 DestroySessionVerbose
751 lttng -vvv destroy mysession2
757 DEBUG2: Config file path found: /home/eedbhu [in get_session_name() at utils.c:98]
758 DEBUG1: Session name found: mysession2 [in get_session_name() at utils.c:99]
759 Session mysession2 destroyed at /home/eedbhu
764 ####################################################################
765 # Scenario: Test "lttng enable-channel ..." with different inputs
766 ####################################################################
771 lttng enable-channel mychannel0,mychannel1 -k -s mysession2 --overwrite --subbuf-size 16384 --num-subbuf 2 --switch-timer 200 --read-timer 100 -C 0 -W 10
777 Kernel channel mychannel0 enabled for session mysession2
778 Kernel channel mychannel1 enabled for session mysession2
782 lttng enable-channel mychannel0,mychannel1 -k -s mysession2 --overwrite --subbuf-size 16384 --num-subbuf 2 --switch-timer 200 --read-timer 100
788 Kernel channel mychannel0 enabled for session mysession2
789 Kernel channel mychannel1 enabled for session mysession2
793 lttng enable-channel ustChannel -u -s mysession2 --overwrite --subbuf-size 32768 --num-subbuf 1 --switch-timer 100 --read-timer 200 -C 0 -W 20
799 UST channel channel0 enabled for session mysession2
803 lttng enable-channel ustChannel -u -s mysession2 --overwrite --subbuf-size 32768 --num-subbuf 1 --switch-timer 100 --read-timer 200
809 UST channel channel0 enabled for session mysession2
813 lttng enable-channel ustChannel -u -s mysession2 --overwrite --subbuf-size 32768 --num-subbuf 1 --switch-timer 100 --read-timer 200 --buffers-uid -C 0 -W 20
819 UST channel channel0 enabled for session mysession2
823 lttng enable-channel ustChannel -u -s mysession2 --overwrite --buffers-pid
829 UST channel ustChannel enabled for session mysession2
833 lttng enable-channel ustChannel -u -s mysession2 --overwrite --subbuf-size 32768 --num-subbuf 1 --switch-timer 100 --read-timer 200 --buffers-uid
839 UST channel channel0 enabled for session mysession2
844 lttng enable-channel mychannel0,mychannel1 -k -s mysession2
850 Kernel channel mychannel0 enabled for session mysession2
851 Kernel channel mychannel1 enabled for session mysession2
855 lttng enable-channel ustChannel -u -s mysession2
861 UST channel mychannel0 enabled for session mysession2
865 lttng disable-channel mychannel0,mychannel1 -k -s mysession2
871 Kernel channel mychannel0 disabled for session mysession2
872 Kernel channel mychannel1 disabled for session mysession2
876 lttng disable-channel ustChannel -u -s mysession2
882 UST channel mychannel0 enabled for session mysession2
887 ####################################################################
888 # Scenario: Test "lttng enable-events ..." with different inputs
889 ####################################################################
893 # Tracepoint test cases
896 lttng enable-event block_rq_remap,block_bio_remap,softirq_entry -k -s mysession2 --tracepoint
902 kernel event block_rq_remap created in channel channel0
903 kernel event block_bio_remap created in channel channel0
904 kernel event softirq_entry created in channel channel0
908 lttng enable-event -a -k -s mysession2 -c mychannel --tracepoint
914 All kernel tracepoints are enabled in channel channel0
918 lttng enable-event ust_tests_hello:tptest_sighandler -u -s mysession2 -c mychannel --tracepoint
924 UST event ust_tests_hello:tptest_sighandler created in channel mychannel
928 lttng enable-event ust_tests_hello:tptest_sighandler -u -s mysession2 -c mychannel --tracepoint --filter intfield==10
934 UST event ust_tests_hello:tptest_sighandler created in channel mychannel
938 lttng enable-event -a -u -s mysession2 -c mychannel --tracepoint
944 All UST tracepoints are enabled in channel mychannel
950 lttng enable-event -a -k -s mysession2 --syscall
956 All kernel system calls are enabled in channel channel0
960 lttng enable-event -a -k -s mysession2 -c mychannel --syscall
966 All kernel system calls are enabled in channel mychannel
969 # dynamic probe/function probe test cases
972 lttng enable-event myevent0 -k -s mysession2 --function 0xc0101340
978 kernel event myevent0 created in channel mychannel
982 lttng enable-event myevent1 -k -s mysession2 -c mychannel --probe init_post
988 kernel event myevent1 created in channel mychannel
991 # log level test cases
994 lttng enable-event myevent4 -u -s mysession2 --loglevel-only TRACE_DEBUG
1000 UST event myevent4 created in channel channel0
1004 lttng enable-event myevent5 -u -s mysession2 -c mychannel --loglevel TRACE_DEBUG_FUNCTION
1010 UST event myevent5 created in channel mychannel
1014 lttng enable-event -a -k -s mysession2
1020 All Kernel events are enabled in channel channel0
1025 ####################################################################
1026 # Scenario: Test "lttng add-context -h" and lttng add-context ..." with different inputs
1027 ####################################################################
1033 lttng add-context -h
1039 usage: lttng add-context -t TYPE
1041 If no channel and no event is given (-c/-e), the context
1042 will be added to all events and all channels.
1043 Otherwise the context will be added only to the channel (-c)
1044 and/or event (-e) indicated.
1045 Exactly one domain (-k/--kernel or -u/--userspace) must be specified.
1048 -h, --help Show this help
1049 --list-options Simple listing of options
1050 -s, --session NAME Apply to session name
1051 -c, --channel NAME Apply to channel
1052 -e, --event NAME Apply to event
1053 -k, --kernel Apply to the kernel tracer
1054 -u, --userspace Apply to the user-space tracer
1055 -t, --type TYPE Context type. You can repeat that option on
1056 the command line to specify multiple contexts at once.
1057 (--kernel preempts --userspace)
1058 TYPE can be one of the strings below:
1059 pid, procname, prio, nice, vpid, tid, pthread_id,
1060 vtid, ppid, vppid, perf:cpu-cycles, perf:cycles
1062 This command will add the context information 'prio' and two perf
1063 counters (hardware branch misses and cache misses), to all events
1064 in the trace data output:
1065 # lttng add-context -k -t prio -t perf:branch-misses -t perf:cache-misses
1070 lttng add-context -s mysession2 -c mychannel -e ust_tests_hello:tptest_sighandler -u -t prio -t pid
1076 UST context prio added to event ust_tests_hello:tptest_sighandle channel mychannel
1077 UST context pid added to event sched_kthread_stop_ret channel mychannel
1082 ContextErrorHandling
1085 lttng add-context -h
1091 usage: lttng add-context -t TYPE
1093 If no channel and no event is given (-c/-e), the context
1094 will be added to all events and all channels.
1095 Otherwise the context will be added only to the channel (-c)
1096 and/or event (-e) indicated.
1097 Exactly one domain (-k/--kernel or -u/--userspace) must be specified.
1100 -h, --help Show this help
1101 --list-options Simple listing of options
1102 -s, --session NAME Apply to session name
1103 -c, --channel NAME Apply to channel
1104 -e, --event NAME Apply to event
1105 -k, --kernel Apply to the kernel tracer
1106 -u, --userspace Apply to the user-space tracer
1107 -t, --type TYPE Context type. You can repeat that option on
1108 the command line to specify multiple contexts at once.
1109 (--kernel preempts --userspace)
1110 TYPE can be one of the strings below:
1111 pid, procname, prio, nice, vpid, tid, pthread_id,
1112 vtid, ppid, vppid, perf:cpu-cycles, perf:cycles
1114 This command will add the context information 'prio' and two perf
1115 counters (hardware branch misses and cache misses), to all events
1116 in the trace data output:
1117 # lttng add-context -k -t prio -t perf:branch-misses -t perf:cache-misses
1122 lttng add-context -s mysession2 -c mychannel -e ust_tests_hello:tptest_sighandler -u -t prio -t pid
1128 UST context prio added to event ust_tests_hello:tptest_sighandle channel mychannel
1129 UST context pid added to event sched_kthread_stop_ret channel mychannel
1134 ####################################################################
1135 # Scenario: Test "lttng create <session> with LTTng 2.1 options
1136 ####################################################################
1138 CreateSessionLttng2.1
1141 lttng create mysession -U net://172.0.0.1
1147 Session mysession created.
1148 Traces will be written in net://172.0.0.1
1152 lttng create mysession -U file:///tmp
1158 Session mysession created.
1159 Traces will be written in file:///tmp
1163 lttng create mysession -C tcp://172.0.0.1 -D tcp://172.0.0.1:5343
1169 Session mysession created.
1170 Control URL tcp://172.0.0.1 set for session mysession
1171 Data URL tcp://172.0.0.1:5343 set for session mysession
1175 lttng create mysession -U net://172.0.0.1:1234:2345
1181 Session mysession created.
1182 Traces will be written in net://172.0.0.1:1234:2345
1186 lttng destroy mysession
1192 Session mysession destroyed.
1196 lttng -vvv create mysession -U net://172.0.0.1
1202 DEBUG3: URI string: net://172.0.0.1 [in uri_parse() at uri.c:253]
1203 DEBUG2: IP address resolved to 172.0.0.1 [in set_ip_address() at uri.c:132]
1204 DEBUG3: URI dtype: 1, proto: 1, host: 172.0.0.1, subdir: , ctrl: 0, data: 0 [in uri_parse() at uri.c:467]
1205 DEBUG1: LSM cmd type : 8 [in send_session_msg() at lttng-ctl.c:261]
1206 Session mysession created.
1207 Traces will be written in net://172.0.0.1
1208 DEBUG1: Init config session in /home/bernd [in config_init() at conf.c:294]
1213 ####################################################################
1214 # Scenario: Test "lttng -vvv create <session> with LTTng 2.1 options"
1215 ####################################################################
1217 CreateSessionLttngVerbose2.1
1219 lttng -vvv create mysession -U net://172.0.0.1
1225 DEBUG3: URI string: net://172.0.0.1 [in uri_parse() at uri.c:253]
1226 DEBUG2: IP address resolved to 172.0.0.1 [in set_ip_address() at uri.c:132]
1227 DEBUG3: URI dtype: 1, proto: 1, host: 172.0.0.1, subdir: , ctrl: 0, data: 0 [in uri_parse() at uri.c:467]
1228 DEBUG1: LSM cmd type : 8 [in send_session_msg() at lttng-ctl.c:261]
1229 Session mysession created.
1230 Traces will be written in net://172.0.0.1
1231 DEBUG1: Init config session in /home/bernd [in config_init() at conf.c:294]
1235 lttng -vvv destroy mysession
1241 Session mysession destroyed.
1245 ####################################################################
1246 # Scenario: Test "lttng create <session> --snapshot (LTTng 2.3)
1247 ####################################################################
1249 CreateSessionSnapshot
1251 lttng create mysession --snapshot
1257 Session mysession created.
1258 Default snapshot output set to: /home/user/lttng-traces/mysession-20130913-141651
1259 Snapshot mode set. Every channel enabled for that session will be set in overwrite mode and mmap output.
1261 #------------------------------------------------------------------------------
1263 lttng snapshot list-output -s mysession
1269 Snapshot output list for session mysession
1270 [1] snapshot-1: /home/user/lttng-traces/mysession-20130913-141651
1272 #------------------------------------------------------------------------------
1280 1) mysession () [inactive snapshot]
1283 #------------------------------------------------------------------------------
1285 lttng snapshot record -s mysession
1291 Snapshot recorded successfully for session mysession
1293 #------------------------------------------------------------------------------
1295 lttng destroy mysession
1301 Session mysession destroyed.
1305 ####################################################################
1306 # Scenario: Test "lttng create <session> --snapshot -U <URL> (LTTng 2.3)
1307 ####################################################################
1309 CreateSessionStreamedSnapshot
1311 lttng create mysession --snapshot -U net://172.0.0.1
1317 Session mysession created.
1318 Default snapshot output set to: net://172.0.0.1
1319 Snapshot mode set. Every channel enabled for that session will be set in overwrite mode and mmap output.
1321 #------------------------------------------------------------------------------
1323 lttng snapshot list-output -s mysession
1329 Snapshot output list for session mysession
1330 [2] snapshot-2: net4://172.0.0.1:5342/
1332 #------------------------------------------------------------------------------
1340 1) mysession () [inactive snapshot]
1343 #------------------------------------------------------------------------------
1345 lttng snapshot record -s mysession
1351 Snapshot recorded successfully for session mysession
1353 #------------------------------------------------------------------------------
1355 lttng destroy mysession
1361 Session mysession destroyed.
1365 ####################################################################
1366 # Scenario: Test "lttng create <session> --snapshot (LTTng 2.3)
1367 ####################################################################
1369 CreateSessionSnapshotErrors
1371 lttng snapshot list-output -s blabla
1377 <COMMAND_ERROR_OUTPUT>
1378 Error: Session name not found
1379 </COMMAND_ERROR_OUTPUT>
1381 #------------------------------------------------------------------------------
1382 #next is not an error case but good to be tested
1390 1) mysession () [active snapshot]
1393 #------------------------------------------------------------------------------
1395 lttng snapshot record -s blabla
1401 <COMMAND_ERROR_OUTPUT>
1402 Error: Session name not found
1403 </COMMAND_ERROR_OUTPUT>
1405 #------------------------------------------------------------------------------
1407 lttng snapshot record -s mysession
1413 <COMMAND_ERROR_OUTPUT>
1414 Error: Session needs to be started once
1415 </COMMAND_ERROR_OUTPUT>
1420 ####################################################################
1421 # Scenario: Test "lttng create <session> --live [USEC] (LTTng 2.4)
1422 ####################################################################
1426 lttng create mysession --live -U net://127.0.0.1
1432 Session mysession created.
1433 Traces will be written in net://127.0.0.1
1434 Live timer set to 1000000 usec
1436 #------------------------------------------------------------------------------
1444 Available tracing sessions:
1445 1) mysession (net4://127.0.0.1:5342/ [data: 5343]) [inactive]
1447 Use lttng list <session_name> for more details
1449 #------------------------------------------------------------------------------
1451 lttng destroy mysession
1457 Session mysession destroyed.
1461 ####################################################################
1462 # Scenario: Test errors for "lttng create <session> --live [USEC] (LTTng 2.4)
1463 ####################################################################
1465 CreateSessionLiveErrors
1467 lttng create mysession --live --snapshot
1473 <COMMAND_ERROR_OUTPUT>
1474 Error: Snapshot and live modes are mutually exclusive.
1475 Error: Command error
1476 </COMMAND_ERROR_OUTPUT>
1478 #------------------------------------------------------------------------------
1480 lttng create mysession --live -U blah
1486 <COMMAND_ERROR_OUTPUT>
1487 Error: URI parse unknown protocol blah
1488 Error: Unable to parse the URL blah
1489 Error: Invalid parameter
1490 </COMMAND_ERROR_OUTPUT>
1492 #------------------------------------------------------------------------------
1494 lttng create mysession --live -C net://127.0.0.1
1500 <COMMAND_ERROR_OUTPUT>
1501 Error: You need both control and data URL.
1502 Error: Command error
1503 </COMMAND_ERROR_OUTPUT>
1506 ####################################################################
1507 # Scenario: Test "lttng create <session> --snapshot (LTTng 2.5)
1508 ####################################################################
1510 CreateSessionSnapshot2.5
1512 lttng create mysession --snapshot
1518 Session mysession created.
1519 Default snapshot output set to: /home/user/lttng-traces/mysession-20130913-141651
1520 Snapshot mode set. Every channel enabled for that session will be set in overwrite mode and mmap output.
1522 #------------------------------------------------------------------------------
1524 lttng snapshot list-output -s mysession
1530 Snapshot output list for session mysession
1531 [1] snapshot-1: /home/user/lttng-traces/mysession-20130913-141651 (max-size: 0)
1533 #------------------------------------------------------------------------------
1541 1) mysession () [inactive snapshot]
1544 #------------------------------------------------------------------------------
1546 lttng snapshot record -s mysession
1552 Snapshot recorded successfully for session mysession
1554 #-----------------------------------------------------------------------------
1556 lttng destroy mysession
1562 Session mysession destroyed.
1567 ####################################################################
1568 # Scenario: Test "lttng load [OPTIONS] [SESSION]"
1569 # "lttng save [OPTIONS] [SESSION]"
1571 ####################################################################
1575 lttng load -i /home/user/.lttng/sessions/mysession.lttng
1581 All sessions have been loaded successfully.
1587 lttng load -i /home/user/.lttng/sessions/mysession.lttng -f
1593 All sessions have been loaded successfully.
1603 All sessions have been saved successfully.
1607 lttng save mysession
1613 Session mysession saved successfully.
1617 lttng save -f mysession
1623 Session mysession saved successfully.
1627 lttng save -o /tmp/test -f mysession
1633 Session mysession saved successfully.