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 -u" with sample output
291 ####################################################################
304 PID: 9379 - Name: /home/user/git/lttng-ust/tests/hello.cxx/.libs/lt-hello
305 ust_tests_hello:tptest_sighandler (loglevel: TRACE_DEBUG_MODULE (10)) (type: tracepoint)
306 ust_tests_hello:tptest (loglevel: TRACE_INFO (6)) (type: tracepoint)
308 PID: 4852 - Name: /home/user/git/lttng-ust/tests/hello.cxx/.libs/lt-hello
309 ust_tests_hello:tptest_sighandler (loglevel: TRACE_WARNING (4)) (type: tracepoint)
310 ust_tests_hello:tptest (loglevel: TRACE_DEBUG_FUNCTION (12)) (type: tracepoint)
315 ####################################################################
316 # Scenario: Test "lttng list -u" with no UST provider available
317 ####################################################################
334 ####################################################################
335 # Scenario: Test "lttng create <session>
336 ####################################################################
340 lttng create mysession2
346 Session mysession2 created.
347 Traces will be written in /home/user/lttng-traces/mysession2-20120209-095418
351 ####################################################################
352 # Scenario: Test "lttng create <session>
353 ####################################################################
355 CreateSessionWithPrompt
357 lttng create mysession2
363 Prompt> Session mysession2 created.
364 Traces will be written in /home/user/lttng-traces/mysession2-20120209-095418
368 ####################################################################
369 # Scenario: Test "lttng create <session> with different variants
371 ####################################################################
373 CreateSessionVariants
375 lttng create alreadyExist
381 Error: Session name already exist
385 lttng create "session with spaces"
391 Session session with spaces created.
392 Traces will be written in /home/user/lttng-traces/session with spaces-20120209-095418
396 lttng create wrongName
402 Session auto created.
403 Traces will be written in /home/user/lttng-traces/auto-20120209-095418
407 lttng create wrongPath -o /home/user/hallo
413 Session wrongPath created.
414 Traces will be written in /home/user/lttng-traces/wrongPath-20120209-095418
418 lttng create pathWithSpaces -o "/home/user/hallo user/here"
424 Session pathWithSpaces created.
425 Traces will be written in /home/user/hallo user/here/pathWithSpaces-20120209-095418
429 ####################################################################
430 # Scenario: Test "lttng destroy <session>
431 ####################################################################
436 lttng destroy mysession2
442 Session mysession2 destroyed.
446 ####################################################################
447 # Scenario: Test "lttng enable-channel ..." with different inputs
448 ####################################################################
453 lttng enable-channel mychannel0,mychannel1 -k -s mysession2 --overwrite --subbuf-size 16384 --num-subbuf 2 --switch-timer 200 --read-timer 100
459 Kernel channel mychannel0 enabled for session mysession2
460 Kernel channel mychannel1 enabled for session mysession2
464 lttng enable-channel ustChannel -u -s mysession2 --overwrite --subbuf-size 32768 --num-subbuf 1 --switch-timer 100 --read-timer 200
470 UST channel channel0 enabled for session mysession2
474 lttng enable-channel mychannel0,mychannel1 -k -s mysession2
480 Kernel channel mychannel0 enabled for session mysession2
481 Kernel channel mychannel1 enabled for session mysession2
485 lttng enable-channel ustChannel -u -s mysession2
491 UST channel mychannel0 enabled for session mysession2
495 lttng disable-channel mychannel0,mychannel1 -k -s mysession2
501 Kernel channel mychannel0 disabled for session mysession2
502 Kernel channel mychannel1 disabled for session mysession2
506 lttng disable-channel ustChannel -u -s mysession2
512 UST channel mychannel0 enabled for session mysession2
517 ####################################################################
518 # Scenario: Test "lttng enable-events ..." with different inputs
519 ####################################################################
523 # Tracepoint test cases
526 lttng enable-event block_rq_remap,block_bio_remap,softirq_entry -k -s mysession2 --tracepoint
532 kernel event block_rq_remap created in channel channel0
533 kernel event block_bio_remap created in channel channel0
534 kernel event softirq_entry created in channel channel0
538 lttng enable-event -a -k -s mysession2 -c mychannel --tracepoint
544 All kernel tracepoints are enabled in channel channel0
548 lttng enable-event ust_tests_hello:tptest_sighandler -u -s mysession2 -c mychannel --tracepoint
554 UST event ust_tests_hello:tptest_sighandler created in channel mychannel
558 lttng enable-event -a -u -s mysession2 -c mychannel --tracepoint
564 All UST tracepoints are enabled in channel mychannel
570 lttng enable-event -a -k -s mysession2 --syscall
576 All kernel system calls are enabled in channel channel0
580 lttng enable-event -a -k -s mysession2 -c mychannel --syscall
586 All kernel system calls are enabled in channel mychannel
589 # dynamic probe/function probe test cases
592 lttng enable-event myevent0 -k -s mysession2 --function 0xc0101340
598 kernel event myevent0 created in channel mychannel
602 lttng enable-event myevent1 -k -s mysession2 -c mychannel --probe init_post
608 kernel event myevent1 created in channel mychannel
611 # log level test cases
614 lttng enable-event myevent4 -u -s mysession2 --loglevel-only TRACE_DEBUG
620 UST event myevent4 created in channel channel0
624 lttng enable-event myevent5 -u -s mysession2 -c mychannel --loglevel TRACE_DEBUG_FUNCTION
630 UST event myevent5 created in channel mychannel
635 ####################################################################
636 # Scenario: Test "lttng add-context -h" and lttng add-context ..." with different inputs
637 ####################################################################
649 usage: lttng add-context -t TYPE
651 If no channel and no event is given (-c/-e), the context
652 will be added to all events and all channels.
653 Otherwise the context will be added only to the channel (-c)
654 and/or event (-e) indicated.
655 Exactly one domain (-k/--kernel or -u/--userspace) must be specified.
658 -h, --help Show this help
659 --list-options Simple listing of options
660 -s, --session NAME Apply to session name
661 -c, --channel NAME Apply to channel
662 -e, --event NAME Apply to event
663 -k, --kernel Apply to the kernel tracer
664 -u, --userspace Apply to the user-space tracer
665 -t, --type TYPE Context type. You can repeat that option on
666 the command line to specify multiple contexts at once.
667 (--kernel preempts --userspace)
668 TYPE can be one of the strings below:
669 pid, procname, prio, nice, vpid, tid, pthread_id,
670 vtid, ppid, vppid, perf:cpu-cycles, perf:cycles
672 This command will add the context information 'prio' and two perf
673 counters (hardware branch misses and cache misses), to all events
674 in the trace data output:
675 # lttng add-context -k -t prio -t perf:branch-misses -t perf:cache-misses
680 lttng add-context -s mysession2 -c mychannel -e ust_tests_hello:tptest_sighandler -u -t prio -t pid
686 UST context prio added to event ust_tests_hello:tptest_sighandle channel mychannel
687 UST context pid added to event sched_kthread_stop_ret channel mychannel
701 usage: lttng add-context -t TYPE
703 If no channel and no event is given (-c/-e), the context
704 will be added to all events and all channels.
705 Otherwise the context will be added only to the channel (-c)
706 and/or event (-e) indicated.
707 Exactly one domain (-k/--kernel or -u/--userspace) must be specified.
710 -h, --help Show this help
711 --list-options Simple listing of options
712 -s, --session NAME Apply to session name
713 -c, --channel NAME Apply to channel
714 -e, --event NAME Apply to event
715 -k, --kernel Apply to the kernel tracer
716 -u, --userspace Apply to the user-space tracer
717 -t, --type TYPE Context type. You can repeat that option on
718 the command line to specify multiple contexts at once.
719 (--kernel preempts --userspace)
720 TYPE can be one of the strings below:
721 pid, procname, prio, nice, vpid, tid, pthread_id,
722 vtid, ppid, vppid, perf:cpu-cycles, perf:cycles
724 This command will add the context information 'prio' and two perf
725 counters (hardware branch misses and cache misses), to all events
726 in the trace data output:
727 # lttng add-context -k -t prio -t perf:branch-misses -t perf:cache-misses
732 lttng add-context -s mysession2 -c mychannel -e ust_tests_hello:tptest_sighandler -u -t prio -t pid
738 UST context prio added to event ust_tests_hello:tptest_sighandle channel mychannel
739 UST context pid added to event sched_kthread_stop_ret channel mychannel
747 lttng calibrate -k --function
753 Kernel calibration done
757 lttng calibrate -u --function
763 Kernel calibration done