1 ####################################################################
2 # Copyright (c) 2012 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 ####################################################################
28 ####################################################################
29 # Scenario: Test lttng version
30 ####################################################################
40 lttng version 2.0.0 - Annedd'ale
41 Web site: http://lttng.org/
43 lttng is free software and under the GPL license and part LGPL
47 ####################################################################
48 # Scenario: Test lttng version
50 ####################################################################
52 LttngVersionWithPrompt
60 Prompt> lttng version 2.0.0 - Annedd'ale
61 Web site: http://lttng.org/
63 lttng is free software and under the GPL license and part LGPL
67 ####################################################################
68 # Scenario: Test lttng version (unsupported version)
69 ####################################################################
71 LttngUnsupportedVersion
79 lttng version 200.0.0 - Annedd'ale
80 Web site: http://lttng.org/
82 lttng is free software and under the GPL license and part LGPL
87 ####################################################################
88 # Scenario: Test lttng version (noversion)
89 ####################################################################
99 Web site: http://lttng.org/
101 lttng is free software and under the GPL license and part LGPL
105 ####################################################################
106 # Scenario: Test no sessions available
107 ####################################################################
117 Currently no available tracing session
121 ####################################################################
122 # Scenario: Test get sessions
123 ####################################################################
133 Available tracing sessions:
134 1) mysession1 (/home/user/lttng-traces/mysession1-20120123-083928) [inactive]
135 2) mysession (/home/user/lttng-traces/mysession-20120123-083318) [inactive]
137 Use lttng list <session_name> for more details
141 ####################################################################
142 # Scenario: Test lttng list <name> where session doesn't exist
143 ####################################################################
145 GetSessionNameNotExist
153 Session test not found
154 Error: Session name not found
158 ####################################################################
159 # Scenario: Test lttng list with garbage output
160 ####################################################################
170 asdfaereafsdcv 12333456434&*89**(())(^%$*
171 @#$%^&*()@#$%^&*()0834523094578kj;djkfs
172 a;sdf094v5u dsafj;sd9
176 ####################################################################
177 # Scenario: Test lttng list <name> with sample outputs
178 ####################################################################
188 Tracing session mysession: [active]
189 Trace path: /home/user/lttng-traces/mysession-20120129-084256
191 === Domain: Kernel ===
195 - channel0: [enabled]
199 subbufers size: 262144
200 number of subbufers: 4
201 switch timer interval: 0
202 read timer interval: 200
206 block_rq_remap (loglevel: TRACE_EMERG (0)) (type: tracepoint) [enabled]
207 block_bio_remap (loglevel: TRACE_EMERG (0)) (type: tracepoint) [disabled]
209 - channel1: [disabled]
213 subbufers size: 524288
214 number of subbufers: 4
215 switch timer interval: 100
216 read timer interval: 400
222 === Domain: UST global ===
226 - mychannel1: [disabled]
231 number of subbufers: 8
232 switch timer interval: 200
233 read timer interval: 100
239 - channel0: [enabled]
244 number of subbufers: 4
245 switch timer interval: 0
246 read timer interval: 200
250 ust_tests_hello:tptest_sighandler (loglevel: TRACE_DEBUG_LINE (13)) (type: tracepoint) [disabled]
251 * (type: tracepoint) [enabled]
255 lttng list mysession1
261 Tracing session mysession1: [inactive]
262 Trace path: /home/user/lttng-traces/mysession1-20120203-133225
268 ####################################################################
269 # Scenario: Test "lttng list -k" with sample output
270 ####################################################################
282 sched_kthread_stop (loglevel: TRACE_EMERG (0)) (type: tracepoint)
283 sched_kthread_stop_ret (loglevel: TRACE_EMERG (0)) (type: tracepoint)
284 sched_wakeup_new (loglevel: TRACE_EMERG (0)) (type: tracepoint)
289 ####################################################################
290 # Scenario: Test "lttng list -k" with no kernel and no session daemon
291 ####################################################################
301 Spawning session daemon
302 Error: Unable to list kernel events
306 ####################################################################
307 # Scenario: Test "lttng list -k" with no kernel and with session daemon
308 ####################################################################
318 Error: Unable to list kernel events
322 ####################################################################
323 # Scenario: Test "lttng list -u" with sample output
324 ####################################################################
337 PID: 9379 - Name: /home/user/git/lttng-ust/tests/hello.cxx/.libs/lt-hello
338 ust_tests_hello:tptest_sighandler (loglevel: TRACE_DEBUG_MODULE (10)) (type: tracepoint)
339 ust_tests_hello:tptest (loglevel: TRACE_INFO (6)) (type: tracepoint)
341 PID: 4852 - Name: /home/user/git/lttng-ust/tests/hello.cxx/.libs/lt-hello
342 ust_tests_hello:tptest_sighandler (loglevel: TRACE_WARNING (4)) (type: tracepoint)
343 ust_tests_hello:tptest (loglevel: TRACE_DEBUG_FUNCTION (12)) (type: tracepoint)
348 ####################################################################
349 # Scenario: Test "lttng list -u" with no UST provider available
350 ####################################################################
367 ####################################################################
368 # Scenario: Test "lttng create <session>
369 ####################################################################
373 lttng create mysession2
379 Session mysession2 created.
380 Traces will be written in /home/user/lttng-traces/mysession2-20120209-095418
384 ####################################################################
385 # Scenario: Test "lttng create <session>
386 ####################################################################
388 CreateSessionWithPrompt
390 lttng create mysession2
396 Prompt> Session mysession2 created.
397 Traces will be written in /home/user/lttng-traces/mysession2-20120209-095418
401 ####################################################################
402 # Scenario: Test "lttng create <session> with different variants
404 ####################################################################
406 CreateSessionVariants
408 lttng create alreadyExist
414 Error: Session name already exist
418 lttng create "session with spaces"
424 Session session with spaces created.
425 Traces will be written in /home/user/lttng-traces/session with spaces-20120209-095418
429 lttng create wrongName
435 Session auto created.
436 Traces will be written in /home/user/lttng-traces/auto-20120209-095418
440 lttng create wrongPath -o /home/user/hallo
446 Session wrongPath created.
447 Traces will be written in /home/user/lttng-traces/wrongPath-20120209-095418
451 lttng create pathWithSpaces -o "/home/user/hallo user/here"
457 Session pathWithSpaces created.
458 Traces will be written in /home/user/hallo user/here/pathWithSpaces-20120209-095418
462 ####################################################################
463 # Scenario: Test "lttng destroy <session>
464 ####################################################################
469 lttng destroy mysession2
475 Session mysession2 destroyed.
479 ####################################################################
480 # Scenario: Test "lttng enable-channel ..." with different inputs
481 ####################################################################
486 lttng enable-channel mychannel0,mychannel1 -k -s mysession2 --overwrite --subbuf-size 16384 --num-subbuf 2 --switch-timer 200 --read-timer 100
492 Kernel channel mychannel0 enabled for session mysession2
493 Kernel channel mychannel1 enabled for session mysession2
497 lttng enable-channel ustChannel -u -s mysession2 --overwrite --subbuf-size 32768 --num-subbuf 1 --switch-timer 100 --read-timer 200
503 UST channel channel0 enabled for session mysession2
507 lttng enable-channel mychannel0,mychannel1 -k -s mysession2
513 Kernel channel mychannel0 enabled for session mysession2
514 Kernel channel mychannel1 enabled for session mysession2
518 lttng enable-channel ustChannel -u -s mysession2
524 UST channel mychannel0 enabled for session mysession2
528 lttng disable-channel mychannel0,mychannel1 -k -s mysession2
534 Kernel channel mychannel0 disabled for session mysession2
535 Kernel channel mychannel1 disabled for session mysession2
539 lttng disable-channel ustChannel -u -s mysession2
545 UST channel mychannel0 enabled for session mysession2
550 ####################################################################
551 # Scenario: Test "lttng enable-events ..." with different inputs
552 ####################################################################
556 # Tracepoint test cases
559 lttng enable-event block_rq_remap,block_bio_remap,softirq_entry -k -s mysession2 --tracepoint
565 kernel event block_rq_remap created in channel channel0
566 kernel event block_bio_remap created in channel channel0
567 kernel event softirq_entry created in channel channel0
571 lttng enable-event -a -k -s mysession2 -c mychannel --tracepoint
577 All kernel tracepoints are enabled in channel channel0
581 lttng enable-event ust_tests_hello:tptest_sighandler -u -s mysession2 -c mychannel --tracepoint
587 UST event ust_tests_hello:tptest_sighandler created in channel mychannel
591 lttng enable-event -a -u -s mysession2 -c mychannel --tracepoint
597 All UST tracepoints are enabled in channel mychannel
603 lttng enable-event -a -k -s mysession2 --syscall
609 All kernel system calls are enabled in channel channel0
613 lttng enable-event -a -k -s mysession2 -c mychannel --syscall
619 All kernel system calls are enabled in channel mychannel
622 # dynamic probe/function probe test cases
625 lttng enable-event myevent0 -k -s mysession2 --function 0xc0101340
631 kernel event myevent0 created in channel mychannel
635 lttng enable-event myevent1 -k -s mysession2 -c mychannel --probe init_post
641 kernel event myevent1 created in channel mychannel
644 # log level test cases
647 lttng enable-event myevent4 -u -s mysession2 --loglevel-only TRACE_DEBUG
653 UST event myevent4 created in channel channel0
657 lttng enable-event myevent5 -u -s mysession2 -c mychannel --loglevel TRACE_DEBUG_FUNCTION
663 UST event myevent5 created in channel mychannel
668 ####################################################################
669 # Scenario: Test "lttng add-context -h" and lttng add-context ..." with different inputs
670 ####################################################################
682 usage: lttng add-context -t TYPE
684 If no channel and no event is given (-c/-e), the context
685 will be added to all events and all channels.
686 Otherwise the context will be added only to the channel (-c)
687 and/or event (-e) indicated.
688 Exactly one domain (-k/--kernel or -u/--userspace) must be specified.
691 -h, --help Show this help
692 --list-options Simple listing of options
693 -s, --session NAME Apply to session name
694 -c, --channel NAME Apply to channel
695 -e, --event NAME Apply to event
696 -k, --kernel Apply to the kernel tracer
697 -u, --userspace Apply to the user-space tracer
698 -t, --type TYPE Context type. You can repeat that option on
699 the command line to specify multiple contexts at once.
700 (--kernel preempts --userspace)
701 TYPE can be one of the strings below:
702 pid, procname, prio, nice, vpid, tid, pthread_id,
703 vtid, ppid, vppid, perf:cpu-cycles, perf:cycles
705 This command will add the context information 'prio' and two perf
706 counters (hardware branch misses and cache misses), to all events
707 in the trace data output:
708 # lttng add-context -k -t prio -t perf:branch-misses -t perf:cache-misses
713 lttng add-context -s mysession2 -c mychannel -e ust_tests_hello:tptest_sighandler -u -t prio -t pid
719 UST context prio added to event ust_tests_hello:tptest_sighandle channel mychannel
720 UST context pid added to event sched_kthread_stop_ret channel mychannel
734 usage: lttng add-context -t TYPE
736 If no channel and no event is given (-c/-e), the context
737 will be added to all events and all channels.
738 Otherwise the context will be added only to the channel (-c)
739 and/or event (-e) indicated.
740 Exactly one domain (-k/--kernel or -u/--userspace) must be specified.
743 -h, --help Show this help
744 --list-options Simple listing of options
745 -s, --session NAME Apply to session name
746 -c, --channel NAME Apply to channel
747 -e, --event NAME Apply to event
748 -k, --kernel Apply to the kernel tracer
749 -u, --userspace Apply to the user-space tracer
750 -t, --type TYPE Context type. You can repeat that option on
751 the command line to specify multiple contexts at once.
752 (--kernel preempts --userspace)
753 TYPE can be one of the strings below:
754 pid, procname, prio, nice, vpid, tid, pthread_id,
755 vtid, ppid, vppid, perf:cpu-cycles, perf:cycles
757 This command will add the context information 'prio' and two perf
758 counters (hardware branch misses and cache misses), to all events
759 in the trace data output:
760 # lttng add-context -k -t prio -t perf:branch-misses -t perf:cache-misses
765 lttng add-context -s mysession2 -c mychannel -e ust_tests_hello:tptest_sighandler -u -t prio -t pid
771 UST context prio added to event ust_tests_hello:tptest_sighandle channel mychannel
772 UST context pid added to event sched_kthread_stop_ret channel mychannel
780 lttng calibrate -k --function
786 Kernel calibration done
790 lttng calibrate -u --function
796 Kernel calibration done