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 # Bruno Roy - Added new test cases
12 ####################################################################
13 ####################################################################
14 # Scenario: Test lttng not installed
15 ####################################################################
25 <COMMAND_ERROR_OUTPUT>
27 </COMMAND_ERROR_OUTPUT>
31 ####################################################################
32 # Scenario: Test lttng version
33 ####################################################################
43 lttng version 2.1.0 - Basse Messe
44 Web site: http://lttng.org/
46 lttng is free software and under the GPL license and part LGPL
50 ####################################################################
51 # Scenario: Test lttng version
53 ####################################################################
55 LttngVersionWithPrompt
63 Prompt> lttng version 2.0.0 - Annedd'ale
64 Web site: http://lttng.org/
66 lttng is free software and under the GPL license and part LGPL
70 ####################################################################
71 # Scenario: Test lttng version (unsupported version)
72 ####################################################################
74 LttngUnsupportedVersion
82 lttng version 200.0.0 - Annedd'ale
83 Web site: http://lttng.org/
85 lttng is free software and under the GPL license and part LGPL
90 ####################################################################
91 # Scenario: Test lttng version (noversion)
92 ####################################################################
102 Web site: http://lttng.org/
104 lttng is free software and under the GPL license and part LGPL
108 ####################################################################
109 # Scenario: Test lttng version (compiled from source)
110 ####################################################################
120 lttng version heads/stable-2.5-0-g3910e60 - Fumisterie
122 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.
124 Web site: http://lttng.org
126 lttng is free software and under the GPL license and part LGPL
130 ####################################################################
131 # Scenario: Test no sessions available
132 ####################################################################
142 Currently no available tracing session
146 ####################################################################
147 # Scenario: Test get sessions
148 ####################################################################
158 Available tracing sessions:
159 1) mysession1 (/home/user/lttng-traces/mysession1-20120123-083928) [inactive]
160 2) mysession (/home/user/lttng-traces/mysession-20120123-083318) [inactive]
162 Use lttng list <session_name> for more details
166 ####################################################################
167 # Scenario: Test get sessions with tracing group
168 ####################################################################
170 GetSessionWithTracingGroup
178 Available tracing sessions:
179 1) mysession1 (/home/user/lttng-traces/mysession1-20120123-083928) [inactive]
180 2) mysession (/home/user/lttng-traces/mysession-20120123-083318) [inactive]
182 Use lttng list <session_name> for more details
186 ####################################################################
187 # Scenario: Test lttng list <name> where session doesn't exist
188 ####################################################################
190 GetSessionNameNotExist
198 Session test not found
199 <COMMAND_ERROR_OUTPUT>
200 Error: Session name not found
201 </COMMAND_ERROR_OUTPUT>
205 ####################################################################
206 # Scenario: Test lttng -vvv list <name> where session doesn't exist
207 ####################################################################
209 GetSessionNameNotExistVerbose
217 DEBUG2: Session name: test [in cmd_list() at commands/list.c:618]
218 DEBUG1: Session count 1 [in list_sessions() at commands/list.c:485]
219 <COMMAND_ERROR_OUTPUT>
220 Error: Session 'test' not found
222 </COMMAND_ERROR_OUTPUT>
223 DEBUG1: Clean exit [in clean_exit() at lttng.c:165]
227 ####################################################################
228 # Scenario: Test lttng list with garbage output
229 ####################################################################
239 asdfaereafsdcv 12333456434&*89**(())(^%$*
240 @#$%^&*()@#$%^&*()0834523094578kj;djkfs
241 a;sdf094v5u dsafj;sd9
245 ####################################################################
246 # Scenario: Test lttng list <name> with sample outputs
247 ####################################################################
257 Tracing session mysession: [active]
258 Trace path: /home/user/lttng-traces/mysession-20120129-084256
260 === Domain: Kernel ===
264 - channel0: [enabled]
268 subbufers size: 262144
269 number of subbufers: 4
270 switch timer interval: 0
271 read timer interval: 200
275 block_rq_remap (loglevel: TRACE_EMERG (0)) (type: tracepoint) [enabled]
276 block_bio_remap (loglevel: TRACE_EMERG (0)) (type: tracepoint) [disabled]
278 - channel1: [disabled]
282 subbufers size: 524288
283 number of subbufers: 4
284 switch timer interval: 100
285 read timer interval: 400
291 === Domain: UST global ===
295 - mychannel1: [disabled]
300 number of subbufers: 8
301 switch timer interval: 200
302 read timer interval: 100
308 - channel0: [enabled]
313 number of subbufers: 4
314 switch timer interval: 0
315 read timer interval: 200
319 ust_tests_hello:tptest_sighandler (loglevel: TRACE_DEBUG_LINE (13)) (type: tracepoint) [disabled]
320 * (type: tracepoint) [enabled]
324 lttng list mysession1
330 Tracing session mysession1: [inactive]
331 Trace path: /home/user/lttng-traces/mysession1-20120203-133225
336 ####################################################################
337 # Scenario: Test lttng list <name> (with live time interval)
338 ####################################################################
340 GetSessionWithLiveInterval
348 Tracing session mysession: [inactive snapshot]
350 Live timer interval (usec): 4294967295
353 #------------------------------------------------------------------------------
355 lttng snapshot list-output -s mysession
361 Snapshot output list for session mysession
362 [1] snapshot-1: /home/user/lttng-traces/mysession-20120129-084256 (max-size: 0)
364 #------------------------------------------------------------------------------
366 lttng list mysession1
372 Tracing session mysession1: [active]
373 Trace path: /home/user/lttng-traces/mysession1-20120129-084256
374 Live timer interval (usec): 0
377 #------------------------------------------------------------------------------
379 lttng list mysession2
385 Tracing session mysession2: [inactive]
386 Trace path: tcp4://172.0.0.1:5342/ [data: 5343]
387 Live timer interval (usec): 1000000
392 ####################################################################
393 # Scenario: Test "lttng list -k" with sample output
394 ####################################################################
406 sched_kthread_stop (loglevel: TRACE_EMERG (0)) (type: tracepoint)
407 sched_kthread_stop_ret (loglevel: TRACE_EMERG (0)) (type: tracepoint)
408 sched_wakeup_new (loglevel: TRACE_EMERG (0)) (type: tracepoint)
413 ####################################################################
414 # Scenario: Test "lttng list -k" with no kernel and no session daemon
415 ####################################################################
425 Spawning session daemon
426 <COMMAND_ERROR_OUTPUT>
427 Error: Unable to list kernel events
428 </COMMAND_ERROR_OUTPUT>
432 ####################################################################
433 # Scenario: Test "lttng list -k" with no kernel and with session daemon
434 ####################################################################
444 <COMMAND_ERROR_OUTPUT>
445 Error: Unable to list kernel events
446 </COMMAND_ERROR_OUTPUT>
450 ####################################################################
451 # Scenario: Test "lttng list -k" with no kernel, with session daemon and verbose
452 ####################################################################
454 ListWithNoKernelVerbose
462 DEBUG2: Session name: (null) [in cmd_list() at commands/list.c:618]
463 DEBUG1: Getting kernel tracing events [in list_kernel_events() at commands/list.c:309]
464 <COMMAND_ERROR_OUTPUT>
465 Error: Unable to list kernel events
466 </COMMAND_ERROR_OUTPUT>
467 DEBUG1: Clean exit [in clean_exit() at lttng.c:165]
471 ####################################################################
472 # Scenario: Test "lttng list -u" with sample output
473 ####################################################################
486 PID: 9379 - Name: /home/user/git/lttng-ust/tests/hello.cxx/.libs/lt-hello
487 ust_tests_hello:tptest_sighandler (loglevel: TRACE_DEBUG_MODULE (10)) (type: tracepoint)
488 ust_tests_hello:tptest (loglevel: TRACE_INFO (6)) (type: tracepoint)
490 PID: 4852 - Name: /home/user/git/lttng-ust/tests/hello.cxx/.libs/lt-hello
491 ust_tests_hello:tptest_sighandler (loglevel: TRACE_WARNING (4)) (type: tracepoint)
492 ust_tests_hello:tptest (loglevel: TRACE_DEBUG_FUNCTION (12)) (type: tracepoint)
497 ####################################################################
498 # Scenario: Test "lttng list -u" with no UST provider available
499 ####################################################################
516 ####################################################################
517 # Scenario: Test "lttng list -u" with no UST available (LTTng 2.0.x)
518 ####################################################################
535 ####################################################################
536 # Scenario: Test "lttng list -u" with no UST available and no session daemon
537 ####################################################################
547 Spawning a session daemon
548 <COMMAND_ERROR_OUTPUT>
549 Error: Unable to list UST events: Listing UST events failed
551 </COMMAND_ERROR_OUTPUT>
555 ####################################################################
556 # Scenario: Test "lttng list -u" with no ust and with session daemon
557 ####################################################################
567 <COMMAND_ERROR_OUTPUT>
568 Error: Unable to list UST events: Listing UST events failed
570 </COMMAND_ERROR_OUTPUT>
574 ####################################################################
575 # Scenario: Test "lttng list -u" with no kernel, with session daemon and verbose
576 ####################################################################
580 lttng -vvv list -u -f
586 DEBUG2: Session name: (null) [in cmd_list() at commands/list.c:618]
587 DEBUG1: Getting kernel tracing events [in list_kernel_events() at commands/list.c:309]
588 Spawning a session daemon
589 <COMMAND_ERROR_OUTPUT>
590 Error: Unable to list UST events: Listing UST events failed
592 </COMMAND_ERROR_OUTPUT>
593 DEBUG1: Clean exit [in clean_exit() at lttng.c:165]
598 ####################################################################
599 # Scenario: Test "lttng list -u -f" with sample output (version 2.1.0)
600 ####################################################################
613 PID: 9379 - Name: /home/user/git/lttng-ust/tests/hello.cxx/.libs/lt-hello
614 ust_tests_hello:tptest_sighandler (loglevel: TRACE_DEBUG_MODULE (10)) (type: tracepoint)
615 ust_tests_hello:tptest (loglevel: TRACE_INFO (6)) (type: tracepoint)
616 field: doublefield (float)
617 field: floatfield (float)
618 field: stringfield (string)
620 PID: 4852 - Name: /home/user/git/lttng-ust/tests/hello.cxx/.libs/lt-hello
621 ust_tests_hello:tptest_sighandler (loglevel: TRACE_WARNING (4)) (type: tracepoint)
622 ust_tests_hello:tptest (loglevel: TRACE_DEBUG_FUNCTION (12)) (type: tracepoint)
623 field: doublefield (float)
624 field: floatfield (float)
625 field: stringfield (string)
631 ####################################################################
632 # Scenario: Test "lttng create <session>
633 ####################################################################
637 lttng create mysession2
643 Session mysession2 created.
644 Traces will be written in /home/user/lttng-traces/mysession2-20120209-095418
648 ####################################################################
649 # Scenario: Test "lttng create <session>
650 ####################################################################
652 CreateSessionWithPrompt
654 lttng create mysession2
660 Prompt> Session mysession2 created.
661 Traces will be written in /home/user/lttng-traces/mysession2-20120209-095418
665 ####################################################################
666 # Scenario: Test "lttng create <session> with different variants
668 ####################################################################
670 CreateSessionVariants
672 lttng create alreadyExist
678 <COMMAND_ERROR_OUTPUT>
679 Error: Session name already exist
680 </COMMAND_ERROR_OUTPUT>
684 lttng create session with spaces
690 Session session with spaces created.
691 Traces will be written in /home/user/lttng-traces/session with spaces-20120209-095418
695 lttng create wrongName
701 Session auto created.
702 Traces will be written in /home/user/lttng-traces/auto-20120209-095418
706 lttng create wrongPath -o /home/user/hallo
712 Session wrongPath created.
713 Traces will be written in /home/user/lttng-traces/wrongPath-20120209-095418
717 lttng create pathWithSpaces -o /home/user/hallo user/here
723 Session pathWithSpaces created.
724 Traces will be written in /home/user/hallo user/here/pathWithSpaces-20120209-095418
728 ####################################################################
729 # Scenario: Test "lttng destroy <session>
730 ####################################################################
735 lttng destroy mysession2
741 Session mysession2 destroyed.
745 ####################################################################
746 # Scenario: Test "lttng -vvv destroy <session>"
747 ####################################################################
750 DestroySessionVerbose
752 lttng -vvv destroy mysession2
758 DEBUG2: Config file path found: /home/eedbhu [in get_session_name() at utils.c:98]
759 DEBUG1: Session name found: mysession2 [in get_session_name() at utils.c:99]
760 Session mysession2 destroyed at /home/eedbhu
765 ####################################################################
766 # Scenario: Test "lttng enable-channel ..." with different inputs
767 ####################################################################
772 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
778 Kernel channel mychannel0 enabled for session mysession2
779 Kernel channel mychannel1 enabled for session mysession2
783 lttng enable-channel mychannel0,mychannel1 -k -s mysession2 --overwrite --subbuf-size 16384 --num-subbuf 2 --switch-timer 200 --read-timer 100
789 Kernel channel mychannel0 enabled for session mysession2
790 Kernel channel mychannel1 enabled for session mysession2
794 lttng enable-channel ustChannel -u -s mysession2 --overwrite --subbuf-size 32768 --num-subbuf 1 --switch-timer 100 --read-timer 200 -C 0 -W 20
800 UST channel channel0 enabled for session mysession2
804 lttng enable-channel ustChannel -u -s mysession2 --overwrite --subbuf-size 32768 --num-subbuf 1 --switch-timer 100 --read-timer 200
810 UST channel channel0 enabled for session mysession2
814 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
820 UST channel channel0 enabled for session mysession2
824 lttng enable-channel ustChannel -u -s mysession2 --overwrite --buffers-pid
830 UST channel ustChannel enabled for session mysession2
834 lttng enable-channel ustChannel -u -s mysession2 --overwrite --subbuf-size 32768 --num-subbuf 1 --switch-timer 100 --read-timer 200 --buffers-uid
840 UST channel channel0 enabled for session mysession2
845 lttng enable-channel mychannel0,mychannel1 -k -s mysession2
851 Kernel channel mychannel0 enabled for session mysession2
852 Kernel channel mychannel1 enabled for session mysession2
856 lttng enable-channel ustChannel -u -s mysession2
862 UST channel mychannel0 enabled for session mysession2
866 lttng disable-channel mychannel0,mychannel1 -k -s mysession2
872 Kernel channel mychannel0 disabled for session mysession2
873 Kernel channel mychannel1 disabled for session mysession2
877 lttng disable-channel ustChannel -u -s mysession2
883 UST channel mychannel0 enabled for session mysession2
888 ####################################################################
889 # Scenario: Test "lttng enable-events ..." with different inputs
890 ####################################################################
894 # Tracepoint test cases
897 lttng enable-event block_rq_remap,block_bio_remap,softirq_entry -k -s mysession2 --tracepoint
903 kernel event block_rq_remap created in channel channel0
904 kernel event block_bio_remap created in channel channel0
905 kernel event softirq_entry created in channel channel0
909 lttng enable-event -a -k -s mysession2 -c mychannel --tracepoint
915 All kernel tracepoints are enabled in channel channel0
919 lttng enable-event ust_tests_hello:tptest_sighandler -u -s mysession2 -c mychannel --tracepoint
925 UST event ust_tests_hello:tptest_sighandler created in channel mychannel
929 lttng enable-event ust_tests_hello:tptest_sighandler -u -s mysession2 -c mychannel --tracepoint --filter intfield==10
935 UST event ust_tests_hello:tptest_sighandler created in channel mychannel
939 lttng enable-event -a -u -s mysession2 -c mychannel --tracepoint
945 All UST tracepoints are enabled in channel mychannel
949 lttng enable-event -a -u -s mysession2 -c mychannel --tracepoint --exclude ust_tests_hello:tptest_sighandler
955 All UST events excluding ust_tests_hello:tptest_sighandler are enabled in channel mychannel
959 lttng enable-event -a -u -s mysession2 -c mychannel --tracepoint --exclude ust_tests_hello:tptest_sighandler,ust_tests_bye:tptest_sighandler
965 All UST events excluding ust_tests_hello:tptest_sighandler,ust_tests_bye:tptest_sighandler are enabled in channel mychannel
969 lttng enable-event ust* -u -s mysession2 -c mychannel --tracepoint --exclude ust_tests_hello:tptest_sighandler,ust_tests_bye:tptest_sighandler
975 UST event ust* excluding ust_tests_hello:tptest_sighandler,ust_tests_bye:tptest_sighandler created in channel mychannel
979 lttng enable-event ust* -u -s mysession2 -c mychannel --tracepoint --filter ust=="Challenger" --exclude ust_tests_hello:tptest_sighandler,ust_tests_bye:tptest_sighandler
985 Event ust* excluding ust_tests_hello:tptest_sighandler,ust_tests_bye:tptest_sighandler: Filter 'ust==Challenger' successfully set
991 lttng enable-event -a -k -s mysession2 --syscall
997 All kernel system calls are enabled in channel channel0
1001 lttng enable-event -a -k -s mysession2 -c mychannel --syscall
1007 All kernel system calls are enabled in channel mychannel
1011 lttng enable-event close -k -s mysession2 -c mychannel --syscall
1017 Kernel event close created in channel mychannel
1021 lttng enable-event close,read,write -k -s mysession2 -c mychannel --syscall
1027 Kernel event close created in channel mychannel
1028 Kernel event read created in channel mychannel
1029 Kernel event write created in channel mychannel
1032 # dynamic probe/function probe test cases
1035 lttng enable-event myevent0 -k -s mysession2 --function 0xc0101340
1041 kernel event myevent0 created in channel mychannel
1045 lttng enable-event myevent1 -k -s mysession2 -c mychannel --probe init_post
1051 kernel event myevent1 created in channel mychannel
1054 # log level test cases
1057 lttng enable-event myevent4 -u -s mysession2 --loglevel-only TRACE_DEBUG
1063 UST event myevent4 created in channel channel0
1067 lttng enable-event myevent5 -u -s mysession2 -c mychannel --loglevel TRACE_DEBUG_FUNCTION
1073 UST event myevent5 created in channel mychannel
1077 lttng enable-event -a -k -s mysession2
1083 All Kernel events are enabled in channel channel0
1088 ####################################################################
1089 # Scenario: Test "lttng enable-events ..." with exclusion
1090 ####################################################################
1095 lttng enable-event ust* -u -s mysession2 -c mychannel --tracepoint --exclude ust_tests_hello:tptest_sighandler
1101 UST event ust* excluding ust_tests_hello:tptest_sighandler created in channel mychannel
1105 lttng list mysession2
1111 Tracing session mysession2: [inactive]
1112 Trace path: /home/user/lttng-traces/mysession2-20160621-104942
1114 === Domain: UST global ===
1116 Buffer type: per UID
1120 - mychannel: [enabled]
1124 subbufers size: 131072
1125 number of subbufers: 4
1126 switch timer interval: 0
1127 read timer interval: 0
1129 trace file size (bytes): 0
1133 ust* (type: tracepoint) [enabled] [has exclusions]
1138 lttng enable-event ust* -u -s mysession2 -c mychannel --tracepoint --exclude ust_tests_hello:tptest_sighandler,ust_tests_bye:tptest_sighandler
1144 UST event ust* excluding ust_tests_hello:tptest_sighandler,ust_tests_bye:tptest_sighandler created in channel mychannel
1148 lttng list mysession2
1154 Tracing session mysession2: [inactive]
1155 Trace path: /home/user/lttng-traces/mysession2-20160621-104942
1157 === Domain: UST global ===
1159 Buffer type: per UID
1163 - mychannel: [enabled]
1167 subbufers size: 131072
1168 number of subbufers: 4
1169 switch timer interval: 0
1170 read timer interval: 0
1172 trace file size (bytes): 0
1176 ust* (type: tracepoint) [enabled] [has exclusions]
1181 lttng enable-event ust* -u -s mysession2 -c mychannel --tracepoint --filter ust=="Challenger" --exclude ust_tests_hello:tptest_sighandler,ust_tests_bye:tptest_sighandler
1187 Event ust* excluding ust_tests_hello:tptest_sighandler,ust_tests_bye:tptest_sighandler: Filter 'ust==Challenger' successfully set
1191 lttng list mysession2
1197 Tracing session mysession2: [inactive]
1198 Trace path: /home/ebruroy/lttng-traces/mysession2-20160630-135750
1200 === Domain: UST global ===
1202 Buffer type: per UID
1206 - mychannel: [enabled]
1210 subbufers size: 131072
1211 number of subbufers: 4
1212 switch timer interval: 0
1213 read timer interval: 0
1215 trace file size (bytes): 0
1219 ust* (type: tracepoint) [enabled] [has exclusions] [with filter]
1225 ####################################################################
1226 # Scenario: Test "lttng add-context -h" and lttng add-context ..." with different inputs
1227 ####################################################################
1233 lttng add-context -h
1239 usage: lttng add-context -t TYPE
1241 If no channel and no event is given (-c/-e), the context
1242 will be added to all events and all channels.
1243 Otherwise the context will be added only to the channel (-c)
1244 and/or event (-e) indicated.
1245 Exactly one domain (-k/--kernel or -u/--userspace) must be specified.
1248 -h, --help Show this help
1249 --list-options Simple listing of options
1250 -s, --session NAME Apply to session name
1251 -c, --channel NAME Apply to channel
1252 -e, --event NAME Apply to event
1253 -k, --kernel Apply to the kernel tracer
1254 -u, --userspace Apply to the user-space tracer
1255 -t, --type TYPE Context type. You can repeat that option on
1256 the command line to specify multiple contexts at once.
1257 (--kernel preempts --userspace)
1258 TYPE can be one of the strings below:
1259 pid, procname, prio, nice, vpid, tid, pthread_id,
1260 vtid, ppid, vppid, perf:cpu-cycles, perf:cycles
1262 This command will add the context information 'prio' and two perf
1263 counters (hardware branch misses and cache misses), to all events
1264 in the trace data output:
1265 # lttng add-context -k -t prio -t perf:branch-misses -t perf:cache-misses
1270 lttng add-context -s mysession2 -c mychannel -e ust_tests_hello:tptest_sighandler -u -t prio -t pid
1276 UST context prio added to event ust_tests_hello:tptest_sighandle channel mychannel
1277 UST context pid added to event sched_kthread_stop_ret channel mychannel
1282 ContextErrorHandling
1285 lttng add-context -h
1291 usage: lttng add-context -t TYPE
1293 If no channel and no event is given (-c/-e), the context
1294 will be added to all events and all channels.
1295 Otherwise the context will be added only to the channel (-c)
1296 and/or event (-e) indicated.
1297 Exactly one domain (-k/--kernel or -u/--userspace) must be specified.
1300 -h, --help Show this help
1301 --list-options Simple listing of options
1302 -s, --session NAME Apply to session name
1303 -c, --channel NAME Apply to channel
1304 -e, --event NAME Apply to event
1305 -k, --kernel Apply to the kernel tracer
1306 -u, --userspace Apply to the user-space tracer
1307 -t, --type TYPE Context type. You can repeat that option on
1308 the command line to specify multiple contexts at once.
1309 (--kernel preempts --userspace)
1310 TYPE can be one of the strings below:
1311 pid, procname, prio, nice, vpid, tid, pthread_id,
1312 vtid, ppid, vppid, perf:cpu-cycles, perf:cycles
1314 This command will add the context information 'prio' and two perf
1315 counters (hardware branch misses and cache misses), to all events
1316 in the trace data output:
1317 # lttng add-context -k -t prio -t perf:branch-misses -t perf:cache-misses
1322 lttng add-context -s mysession2 -c mychannel -e ust_tests_hello:tptest_sighandler -u -t prio -t pid
1328 UST context prio added to event ust_tests_hello:tptest_sighandle channel mychannel
1329 UST context pid added to event sched_kthread_stop_ret channel mychannel
1334 ####################################################################
1335 # Scenario: Test "lttng create <session> with LTTng 2.1 options
1336 ####################################################################
1338 CreateSessionLttng2.1
1341 lttng create mysession -U net://172.0.0.1
1347 Session mysession created.
1348 Traces will be written in net://172.0.0.1
1352 lttng create mysession -U file:///tmp
1358 Session mysession created.
1359 Traces will be written in file:///tmp
1363 lttng create mysession -C tcp://172.0.0.1 -D tcp://172.0.0.1:5343
1369 Session mysession created.
1370 Control URL tcp://172.0.0.1 set for session mysession
1371 Data URL tcp://172.0.0.1:5343 set for session mysession
1375 lttng create mysession -U net://172.0.0.1:1234:2345
1381 Session mysession created.
1382 Traces will be written in net://172.0.0.1:1234:2345
1386 lttng destroy mysession
1392 Session mysession destroyed.
1396 lttng -vvv create mysession -U net://172.0.0.1
1402 DEBUG3: URI string: net://172.0.0.1 [in uri_parse() at uri.c:253]
1403 DEBUG2: IP address resolved to 172.0.0.1 [in set_ip_address() at uri.c:132]
1404 DEBUG3: URI dtype: 1, proto: 1, host: 172.0.0.1, subdir: , ctrl: 0, data: 0 [in uri_parse() at uri.c:467]
1405 DEBUG1: LSM cmd type : 8 [in send_session_msg() at lttng-ctl.c:261]
1406 Session mysession created.
1407 Traces will be written in net://172.0.0.1
1408 DEBUG1: Init config session in /home/bernd [in config_init() at conf.c:294]
1413 ####################################################################
1414 # Scenario: Test "lttng -vvv create <session> with LTTng 2.1 options"
1415 ####################################################################
1417 CreateSessionLttngVerbose2.1
1419 lttng -vvv create mysession -U net://172.0.0.1
1425 DEBUG3: URI string: net://172.0.0.1 [in uri_parse() at uri.c:253]
1426 DEBUG2: IP address resolved to 172.0.0.1 [in set_ip_address() at uri.c:132]
1427 DEBUG3: URI dtype: 1, proto: 1, host: 172.0.0.1, subdir: , ctrl: 0, data: 0 [in uri_parse() at uri.c:467]
1428 DEBUG1: LSM cmd type : 8 [in send_session_msg() at lttng-ctl.c:261]
1429 Session mysession created.
1430 Traces will be written in net://172.0.0.1
1431 DEBUG1: Init config session in /home/bernd [in config_init() at conf.c:294]
1435 lttng -vvv destroy mysession
1441 Session mysession destroyed.
1445 ####################################################################
1446 # Scenario: Test "lttng create <session> --snapshot (LTTng 2.3)
1447 ####################################################################
1449 CreateSessionSnapshot
1451 lttng create mysession --snapshot
1457 Session mysession created.
1458 Default snapshot output set to: /home/user/lttng-traces/mysession-20130913-141651
1459 Snapshot mode set. Every channel enabled for that session will be set in overwrite mode and mmap output.
1461 #------------------------------------------------------------------------------
1463 lttng snapshot list-output -s mysession
1469 Snapshot output list for session mysession
1470 [1] snapshot-1: /home/user/lttng-traces/mysession-20130913-141651
1472 #------------------------------------------------------------------------------
1480 1) mysession () [inactive snapshot]
1483 #------------------------------------------------------------------------------
1485 lttng snapshot record -s mysession
1491 Snapshot recorded successfully for session mysession
1493 #------------------------------------------------------------------------------
1495 lttng destroy mysession
1501 Session mysession destroyed.
1505 ####################################################################
1506 # Scenario: Test "lttng create <session> --snapshot -U <URL> (LTTng 2.3)
1507 ####################################################################
1509 CreateSessionStreamedSnapshot
1511 lttng create mysession --snapshot -U net://172.0.0.1
1517 Session mysession created.
1518 Default snapshot output set to: net://172.0.0.1
1519 Snapshot mode set. Every channel enabled for that session will be set in overwrite mode and mmap output.
1521 #------------------------------------------------------------------------------
1523 lttng snapshot list-output -s mysession
1529 Snapshot output list for session mysession
1530 [2] snapshot-2: net4://172.0.0.1:5342/
1532 #------------------------------------------------------------------------------
1540 1) mysession () [inactive snapshot]
1543 #------------------------------------------------------------------------------
1545 lttng snapshot record -s mysession
1551 Snapshot recorded successfully for session mysession
1553 #------------------------------------------------------------------------------
1555 lttng destroy mysession
1561 Session mysession destroyed.
1565 ####################################################################
1566 # Scenario: Test "lttng create <session> --snapshot (LTTng 2.3)
1567 ####################################################################
1569 CreateSessionSnapshotErrors
1571 lttng snapshot list-output -s blabla
1577 <COMMAND_ERROR_OUTPUT>
1578 Error: Session name not found
1579 </COMMAND_ERROR_OUTPUT>
1581 #------------------------------------------------------------------------------
1582 #next is not an error case but good to be tested
1590 1) mysession () [active snapshot]
1593 #------------------------------------------------------------------------------
1595 lttng snapshot record -s blabla
1601 <COMMAND_ERROR_OUTPUT>
1602 Error: Session name not found
1603 </COMMAND_ERROR_OUTPUT>
1605 #------------------------------------------------------------------------------
1607 lttng snapshot record -s mysession
1613 <COMMAND_ERROR_OUTPUT>
1614 Error: Session needs to be started once
1615 </COMMAND_ERROR_OUTPUT>
1620 ####################################################################
1621 # Scenario: Test "lttng create <session> --live [USEC] (LTTng 2.4)
1622 ####################################################################
1626 lttng create mysession --live -U net://127.0.0.1
1632 Session mysession created.
1633 Traces will be written in net://127.0.0.1
1634 Live timer set to 1000000 usec
1636 #------------------------------------------------------------------------------
1644 Available tracing sessions:
1645 1) mysession (net4://127.0.0.1:5342/ [data: 5343]) [inactive]
1647 Use lttng list <session_name> for more details
1649 #------------------------------------------------------------------------------
1651 lttng destroy mysession
1657 Session mysession destroyed.
1661 ####################################################################
1662 # Scenario: Test errors for "lttng create <session> --live [USEC] (LTTng 2.4)
1663 ####################################################################
1665 CreateSessionLiveErrors
1667 lttng create mysession --live --snapshot
1673 <COMMAND_ERROR_OUTPUT>
1674 Error: Snapshot and live modes are mutually exclusive.
1675 Error: Command error
1676 </COMMAND_ERROR_OUTPUT>
1678 #------------------------------------------------------------------------------
1680 lttng create mysession --live -U blah
1686 <COMMAND_ERROR_OUTPUT>
1687 Error: URI parse unknown protocol blah
1688 Error: Unable to parse the URL blah
1689 Error: Invalid parameter
1690 </COMMAND_ERROR_OUTPUT>
1692 #------------------------------------------------------------------------------
1694 lttng create mysession --live -C net://127.0.0.1
1700 <COMMAND_ERROR_OUTPUT>
1701 Error: You need both control and data URL.
1702 Error: Command error
1703 </COMMAND_ERROR_OUTPUT>
1706 ####################################################################
1707 # Scenario: Test "lttng create <session> --snapshot (LTTng 2.5)
1708 ####################################################################
1710 CreateSessionSnapshot2.5
1712 lttng create mysession --snapshot
1718 Session mysession created.
1719 Default snapshot output set to: /home/user/lttng-traces/mysession-20130913-141651
1720 Snapshot mode set. Every channel enabled for that session will be set in overwrite mode and mmap output.
1722 #------------------------------------------------------------------------------
1724 lttng snapshot list-output -s mysession
1730 Snapshot output list for session mysession
1731 [1] snapshot-1: /home/user/lttng-traces/mysession-20130913-141651 (max-size: 0)
1733 #------------------------------------------------------------------------------
1741 1) mysession () [inactive snapshot]
1744 #------------------------------------------------------------------------------
1746 lttng snapshot record -s mysession
1752 Snapshot recorded successfully for session mysession
1754 #-----------------------------------------------------------------------------
1756 lttng destroy mysession
1762 Session mysession destroyed.
1767 ####################################################################
1768 # Scenario: Test "lttng load [OPTIONS] [SESSION]"
1769 # "lttng save [OPTIONS] [SESSION]"
1771 ####################################################################
1775 lttng load -i /home/user/.lttng/sessions/mysession.lttng
1781 All sessions have been loaded successfully.
1787 lttng load -i /home/user/.lttng/sessions/mysession.lttng -f
1793 All sessions have been loaded successfully.
1803 All sessions have been saved successfully.
1807 lttng save mysession
1813 Session mysession saved successfully.
1817 lttng save -f mysession
1823 Session mysession saved successfully.
1827 lttng save -o /tmp/test -f mysession
1833 Session mysession saved successfully.