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 (unsupported version)
49 ####################################################################
51 LttngUnsupportedVersion
59 lttng version 200.0.0 - Annedd'ale
60 Web site: http://lttng.org/
62 lttng is free software and under the GPL license and part LGPL
67 ####################################################################
68 # Scenario: Test lttng version (noversion)
69 ####################################################################
79 Web site: http://lttng.org/
81 lttng is free software and under the GPL license and part LGPL
85 ####################################################################
86 # Scenario: Test no sessions available
87 ####################################################################
97 Currently no available tracing session
101 ####################################################################
102 # Scenario: Test get sessions
103 ####################################################################
113 Available tracing sessions:
114 1) mysession1 (/home/user/lttng-traces/mysession1-20120123-083928) [inactive]
115 2) mysession (/home/user/lttng-traces/mysession-20120123-083318) [inactive]
117 Use lttng list <session_name> for more details
121 ####################################################################
122 # Scenario: Test lttng list <name> where session doesn't exist
123 ####################################################################
125 GetSessionNameNotExist
133 Session test not found
134 Error: Session name not found
138 ####################################################################
139 # Scenario: Test lttng list with garbage output
140 ####################################################################
150 asdfaereafsdcv 12333456434&*89**(())(^%$*
151 @#$%^&*()@#$%^&*()0834523094578kj;djkfs
152 a;sdf094v5u dsafj;sd9
156 ####################################################################
157 # Scenario: Test lttng list <name> with sample outputs
158 ####################################################################
168 Tracing session mysession: [active]
169 Trace path: /home/user/lttng-traces/mysession-20120129-084256
171 === Domain: Kernel ===
175 - channel0: [enabled]
179 subbufers size: 262144
180 number of subbufers: 4
181 switch timer interval: 0
182 read timer interval: 200
186 block_rq_remap (loglevel: TRACE_EMERG (0)) (type: tracepoint) [enabled]
187 block_bio_remap (loglevel: TRACE_EMERG (0)) (type: tracepoint) [disabled]
189 - channel1: [disabled]
193 subbufers size: 524288
194 number of subbufers: 4
195 switch timer interval: 100
196 read timer interval: 400
202 === Domain: UST global ===
206 - mychannel1: [disabled]
211 number of subbufers: 8
212 switch timer interval: 200
213 read timer interval: 100
219 - channel0: [enabled]
224 number of subbufers: 4
225 switch timer interval: 0
226 read timer interval: 200
230 ust_tests_hello:tptest_sighandler (loglevel: TRACE_DEBUG_LINE (13)) (type: tracepoint) [disabled]
231 * (type: tracepoint) [enabled]
235 lttng list mysession1
241 Tracing session mysession1: [inactive]
242 Trace path: /home/user/lttng-traces/mysession1-20120203-133225
248 ####################################################################
249 # Scenario: Test "lttng list -k" with sample output
250 ####################################################################
262 sched_kthread_stop (loglevel: TRACE_EMERG (0)) (type: tracepoint)
263 sched_kthread_stop_ret (loglevel: TRACE_EMERG (0)) (type: tracepoint)
264 sched_wakeup_new (loglevel: TRACE_EMERG (0)) (type: tracepoint)
269 ####################################################################
270 # Scenario: Test "lttng list -u" with sample output
271 ####################################################################
284 PID: 9379 - Name: /home/user/git/lttng-ust/tests/hello.cxx/.libs/lt-hello
285 ust_tests_hello:tptest_sighandler (loglevel: TRACE_DEBUG_MODULE (10)) (type: tracepoint)
286 ust_tests_hello:tptest (loglevel: TRACE_INFO (6)) (type: tracepoint)
288 PID: 4852 - Name: /home/user/git/lttng-ust/tests/hello.cxx/.libs/lt-hello
289 ust_tests_hello:tptest_sighandler (loglevel: TRACE_WARNING (4)) (type: tracepoint)
290 ust_tests_hello:tptest (loglevel: TRACE_DEBUG_FUNCTION (12)) (type: tracepoint)
295 ####################################################################
296 # Scenario: Test "lttng list -u" with no UST provider available
297 ####################################################################
314 ####################################################################
315 # Scenario: Test "lttng create <session>
316 ####################################################################
320 lttng create mysession2
326 Session mysession2 created.
327 Traces will be written in /home/user/lttng-traces/mysession2-20120209-095418
331 ####################################################################
332 # Scenario: Test "lttng create <session> with different variants
334 ####################################################################
336 CreateSessionVariants
338 lttng create alreadyExist
344 Error: Session name already exist
348 lttng create "session with spaces"
354 Session session with spaces created.
355 Traces will be written in /home/user/lttng-traces/session with spaces-20120209-095418
359 lttng create wrongName
365 Session auto created.
366 Traces will be written in /home/user/lttng-traces/auto-20120209-095418
370 lttng create wrongPath -o /home/user/hallo
376 Session wrongPath created.
377 Traces will be written in /home/user/lttng-traces/wrongPath-20120209-095418
381 lttng create pathWithSpaces -o "/home/user/hallo user/here"
387 Session pathWithSpaces created.
388 Traces will be written in /home/user/hallo user/here/pathWithSpaces-20120209-095418
392 ####################################################################
393 # Scenario: Test "lttng destroy <session>
394 ####################################################################
399 lttng destroy mysession2
405 Session mysession2 destroyed.
409 ####################################################################
410 # Scenario: Test "lttng enable-channel ..." with different inputs
411 ####################################################################
416 lttng enable-channel mychannel0,mychannel1 -k -s mysession2 --overwrite --subbuf-size 16384 --num-subbuf 2 --switch-timer 200 --read-timer 100
422 Kernel channel mychannel0 enabled for session mysession2
423 Kernel channel mychannel1 enabled for session mysession2
427 lttng enable-channel ustChannel -u -s mysession2 --overwrite --subbuf-size 32768 --num-subbuf 1 --switch-timer 100 --read-timer 200
433 UST channel channel0 enabled for session mysession2
437 lttng enable-channel mychannel0,mychannel1 -k -s mysession2
443 Kernel channel mychannel0 enabled for session mysession2
444 Kernel channel mychannel1 enabled for session mysession2
448 lttng enable-channel ustChannel -u -s mysession2
454 UST channel mychannel0 enabled for session mysession2
458 lttng disable-channel mychannel0,mychannel1 -k -s mysession2
464 Kernel channel mychannel0 disabled for session mysession2
465 Kernel channel mychannel1 disabled for session mysession2
469 lttng disable-channel ustChannel -u -s mysession2
475 UST channel mychannel0 enabled for session mysession2
480 ####################################################################
481 # Scenario: Test "lttng enable-events ..." with different inputs
482 ####################################################################
486 # Tracepoint test cases
489 lttng enable-event block_rq_remap,block_bio_remap,softirq_entry -k -s mysession2 --tracepoint
495 kernel event block_rq_remap created in channel channel0
496 kernel event block_bio_remap created in channel channel0
497 kernel event softirq_entry created in channel channel0
501 lttng enable-event -a -k -s mysession2 -c mychannel --tracepoint
507 All kernel tracepoints are enabled in channel channel0
511 lttng enable-event ust_tests_hello:tptest_sighandler -u -s mysession2 -c mychannel --tracepoint
517 UST event ust_tests_hello:tptest_sighandler created in channel mychannel
521 lttng enable-event -a -u -s mysession2 -c mychannel --tracepoint
527 All UST tracepoints are enabled in channel mychannel
533 lttng enable-event -a -k -s mysession2 --syscall
539 All kernel system calls are enabled in channel channel0
543 lttng enable-event -a -k -s mysession2 -c mychannel --syscall
549 All kernel system calls are enabled in channel mychannel
552 # dynamic probe/function probe test cases
555 lttng enable-event myevent0 -k -s mysession2 --function 0xc0101340
561 kernel event myevent0 created in channel mychannel
565 lttng enable-event myevent1 -k -s mysession2 -c mychannel --probe init_post
571 kernel event myevent1 created in channel mychannel
574 # log level test cases
577 lttng enable-event myevent4 -u -s mysession2 --loglevel-only TRACE_DEBUG
583 UST event myevent4 created in channel channel0
587 lttng enable-event myevent5 -u -s mysession2 -c mychannel --loglevel TRACE_DEBUG_FUNCTION
593 UST event myevent5 created in channel mychannel
598 ####################################################################
599 # Scenario: Test "lttng add-context -h" and lttng add-context ..." with different inputs
600 ####################################################################
612 usage: lttng add-context -t TYPE
614 If no channel and no event is given (-c/-e), the context
615 will be added to all events and all channels.
616 Otherwise the context will be added only to the channel (-c)
617 and/or event (-e) indicated.
618 Exactly one domain (-k/--kernel or -u/--userspace) must be specified.
621 -h, --help Show this help
622 --list-options Simple listing of options
623 -s, --session NAME Apply to session name
624 -c, --channel NAME Apply to channel
625 -e, --event NAME Apply to event
626 -k, --kernel Apply to the kernel tracer
627 -u, --userspace Apply to the user-space tracer
628 -t, --type TYPE Context type. You can repeat that option on
629 the command line to specify multiple contexts at once.
630 (--kernel preempts --userspace)
631 TYPE can be one of the strings below:
632 pid, procname, prio, nice, vpid, tid, pthread_id,
633 vtid, ppid, vppid, perf:cpu-cycles, perf:cycles
635 This command will add the context information 'prio' and two perf
636 counters (hardware branch misses and cache misses), to all events
637 in the trace data output:
638 # lttng add-context -k -t prio -t perf:branch-misses -t perf:cache-misses
643 lttng add-context -s mysession2 -c mychannel -e ust_tests_hello:tptest_sighandler -u -t prio -t pid
649 UST context prio added to event ust_tests_hello:tptest_sighandle channel mychannel
650 UST context pid added to event sched_kthread_stop_ret channel mychannel
664 usage: lttng add-context -t TYPE
666 If no channel and no event is given (-c/-e), the context
667 will be added to all events and all channels.
668 Otherwise the context will be added only to the channel (-c)
669 and/or event (-e) indicated.
670 Exactly one domain (-k/--kernel or -u/--userspace) must be specified.
673 -h, --help Show this help
674 --list-options Simple listing of options
675 -s, --session NAME Apply to session name
676 -c, --channel NAME Apply to channel
677 -e, --event NAME Apply to event
678 -k, --kernel Apply to the kernel tracer
679 -u, --userspace Apply to the user-space tracer
680 -t, --type TYPE Context type. You can repeat that option on
681 the command line to specify multiple contexts at once.
682 (--kernel preempts --userspace)
683 TYPE can be one of the strings below:
684 pid, procname, prio, nice, vpid, tid, pthread_id,
685 vtid, ppid, vppid, perf:cpu-cycles, perf:cycles
687 This command will add the context information 'prio' and two perf
688 counters (hardware branch misses and cache misses), to all events
689 in the trace data output:
690 # lttng add-context -k -t prio -t perf:branch-misses -t perf:cache-misses
695 lttng add-context -s mysession2 -c mychannel -e ust_tests_hello:tptest_sighandler -u -t prio -t pid
701 UST context prio added to event ust_tests_hello:tptest_sighandle channel mychannel
702 UST context pid added to event sched_kthread_stop_ret channel mychannel
710 lttng calibrate -k --function
716 Kernel calibration done
720 lttng calibrate -u --function
726 Kernel calibration done