#################################################################### # Copyright (c) 2012 Ericsson # # All rights reserved. This program and the accompanying materials are # made available under the terms of the Eclipse Public License v1.0 which # accompanies this distribution, and is available at # http://www.eclipse.org/legal/epl-v10.html # # Contributors: # Bernd Hufmann - Initial API and implementation #################################################################### #################################################################### # Scenario: Test lttng not installed #################################################################### LttngNotInstalled lttng list 1 Command not found #################################################################### # Scenario: Test no sessions available #################################################################### NoSessionAvailable lttng list 0 Currently no available tracing session #################################################################### # Scenario: Test get sessions #################################################################### GetSessionNames1 lttng list 0 Available tracing sessions: 1) mysession1 (/home/user/lttng-traces/mysession1-20120123-083928) [inactive] 2) mysession (/home/user/lttng-traces/mysession-20120123-083318) [inactive] Use lttng list for more details #################################################################### # Scenario: Test lttng list where session doesn't exist #################################################################### GetSessionNameNotExist lttng list test 1 Session test not found Error: Session name not found #################################################################### # Scenario: Test lttng list with garbage output #################################################################### GetSessionGarbageOut lttng list 0 asdfaereafsdcv 12333456434&*89**(())(^%$* @#$%^&*()@#$%^&*()0834523094578kj;djkfs a;sdf094v5u dsafj;sd9 #################################################################### # Scenario: Test lttng list with sample outputs #################################################################### GetSession1 lttng list mysession 0 Tracing session mysession: [active] Trace path: /home/user/lttng-traces/mysession-20120129-084256 === Domain: Kernel === Channels: ------------- - channel0: [enabled] Attributes: overwrite mode: 0 subbufers size: 262144 number of subbufers: 4 switch timer interval: 0 read timer interval: 200 output: splice() Events: block_rq_remap (loglevel: TRACE_EMERG (0)) (type: tracepoint) [enabled] block_bio_remap (loglevel: TRACE_EMERG (0)) (type: tracepoint) [disabled] - channel1: [disabled] Attributes: overwrite mode: 1 subbufers size: 524288 number of subbufers: 4 switch timer interval: 100 read timer interval: 400 output: splice() Events: None === Domain: UST global === Channels: ------------- - mychannel1: [disabled] Attributes: overwrite mode: 1 subbufers size: 8192 number of subbufers: 8 switch timer interval: 200 read timer interval: 100 output: mmap() Events: None - channel0: [enabled] Attributes: overwrite mode: 0 subbufers size: 4096 number of subbufers: 4 switch timer interval: 0 read timer interval: 200 output: mmap() Events: ust_tests_hello:tptest_sighandler (loglevel: TRACE_DEBUG_LINE (13)) (type: tracepoint) [disabled] * (type: tracepoint) [enabled] lttng list mysession1 0 Tracing session mysession1: [inactive] Trace path: /home/user/lttng-traces/mysession1-20120203-133225 #################################################################### # Scenario: Test "lttng list -k" with sample output #################################################################### GetKernelProvider1 lttng list -k 0 Kernel events ------------- sched_kthread_stop (loglevel: TRACE_EMERG (0)) (type: tracepoint) sched_kthread_stop_ret (loglevel: TRACE_EMERG (0)) (type: tracepoint) sched_wakeup_new (loglevel: TRACE_EMERG (0)) (type: tracepoint) #################################################################### # Scenario: Test "lttng list -u" with sample output #################################################################### GetUstProvider1 lttng list -u 0 UST events: ------------- PID: 9379 - Name: /home/user/git/lttng-ust/tests/hello.cxx/.libs/lt-hello ust_tests_hello:tptest_sighandler (loglevel: TRACE_DEBUG_MODULE (10)) (type: tracepoint) ust_tests_hello:tptest (loglevel: TRACE_INFO (6)) (type: tracepoint) PID: 4852 - Name: /home/user/git/lttng-ust/tests/hello.cxx/.libs/lt-hello ust_tests_hello:tptest_sighandler (loglevel: TRACE_WARNING (4)) (type: tracepoint) ust_tests_hello:tptest (loglevel: TRACE_DEBUG_FUNCTION (12)) (type: tracepoint) #################################################################### # Scenario: Test "lttng list -u" with no UST provider available #################################################################### GetUstProvider2 lttng list -u 0 UST events: ------------- None #################################################################### # Scenario: Test "lttng create #################################################################### CreateSession1 lttng create mysession2 0 Session mysession2 created. Traces will be written in /home/user/lttng-traces/mysession2-20120209-095418 #################################################################### # Scenario: Test "lttng create with different variants # and errors #################################################################### CreateSessionVariants lttng create alreadyExist 1 Error: Session name already exist lttng create "session with spaces" 0 Session session with spaces created. Traces will be written in /home/user/lttng-traces/session with spaces-20120209-095418 lttng create wrongName 0 Session auto created. Traces will be written in /home/user/lttng-traces/auto-20120209-095418 lttng create wrongPath -o /home/user/hallo 0 Session wrongPath created. Traces will be written in /home/user/lttng-traces/wrongPath-20120209-095418 lttng create pathWithSpaces -o "/home/user/hallo user/here" 0 Session pathWithSpaces created. Traces will be written in /home/user/hallo user/here/pathWithSpaces-20120209-095418 #################################################################### # Scenario: Test "lttng destroy #################################################################### DestroySession1 lttng destroy mysession2 0 Session mysession2 destroyed. #################################################################### # Scenario: Test "lttng enable-channel ..." with different inputs #################################################################### ChannelHandling lttng enable-channel mychannel0,mychannel1 -k -s mysession2 --overwrite --subbuf-size 16384 --num-subbuf 2 --switch-timer 200 --read-timer 100 0 Kernel channel mychannel0 enabled for session mysession2 Kernel channel mychannel1 enabled for session mysession2 lttng enable-channel ustChannel -u -s mysession2 --overwrite --subbuf-size 32768 --num-subbuf 1 --switch-timer 100 --read-timer 200 0 UST channel channel0 enabled for session mysession2 lttng enable-channel mychannel0,mychannel1 -k -s mysession2 0 Kernel channel mychannel0 enabled for session mysession2 Kernel channel mychannel1 enabled for session mysession2 lttng enable-channel ustChannel -u -s mysession2 0 UST channel mychannel0 enabled for session mysession2 lttng disable-channel mychannel0,mychannel1 -k -s mysession2 0 Kernel channel mychannel0 disabled for session mysession2 Kernel channel mychannel1 disabled for session mysession2 lttng disable-channel ustChannel -u -s mysession2 0 UST channel mychannel0 enabled for session mysession2 #################################################################### # Scenario: Test "lttng enable-events ..." with different inputs #################################################################### EventHandling # Tracepoint test cases lttng enable-event block_rq_remap,block_bio_remap,softirq_entry -k -s mysession2 --tracepoint 0 kernel event block_rq_remap created in channel channel0 kernel event block_bio_remap created in channel channel0 kernel event softirq_entry created in channel channel0 lttng enable-event -a -k -s mysession2 -c mychannel --tracepoint 0 All kernel tracepoints are enabled in channel channel0 lttng enable-event ust_tests_hello:tptest_sighandler -u -s mysession2 -c mychannel --tracepoint 0 UST event ust_tests_hello:tptest_sighandler created in channel mychannel lttng enable-event -a -u -s mysession2 -c mychannel --tracepoint 0 All UST tracepoints are enabled in channel mychannel # Syscall test cases lttng enable-event -a -k -s mysession2 --syscall 0 All kernel system calls are enabled in channel channel0 lttng enable-event -a -k -s mysession2 -c mychannel --syscall 0 All kernel system calls are enabled in channel mychannel # dynamic probe/function probe test cases lttng enable-event myevent0 -k -s mysession2 --function 0xc0101340 0 kernel event myevent0 created in channel mychannel lttng enable-event myevent1 -k -s mysession2 -c mychannel --probe init_post 0 kernel event myevent1 created in channel mychannel # log level test cases lttng enable-event myevent4 -u -s mysession2 --loglevel-only TRACE_DEBUG 0 UST event myevent4 created in channel channel0 lttng enable-event myevent5 -u -s mysession2 -c mychannel --loglevel TRACE_DEBUG_FUNCTION 0 UST event myevent5 created in channel mychannel #################################################################### # Scenario: Test "lttng add-context -h" and lttng add-context ..." with different inputs #################################################################### ContextHandling lttng add-context -h 0 usage: lttng add-context -t TYPE If no channel and no event is given (-c/-e), the context will be added to all events and all channels. Otherwise the context will be added only to the channel (-c) and/or event (-e) indicated. Exactly one domain (-k/--kernel or -u/--userspace) must be specified. Options: -h, --help Show this help --list-options Simple listing of options -s, --session NAME Apply to session name -c, --channel NAME Apply to channel -e, --event NAME Apply to event -k, --kernel Apply to the kernel tracer -u, --userspace Apply to the user-space tracer -t, --type TYPE Context type. You can repeat that option on the command line to specify multiple contexts at once. (--kernel preempts --userspace) TYPE can be one of the strings below: pid, procname, prio, nice, vpid, tid, pthread_id, vtid, ppid, vppid, perf:cpu-cycles, perf:cycles Example: This command will add the context information 'prio' and two perf counters (hardware branch misses and cache misses), to all events in the trace data output: # lttng add-context -k -t prio -t perf:branch-misses -t perf:cache-misses lttng add-context -s mysession2 -c mychannel -e ust_tests_hello:tptest_sighandler -u -t prio -t pid 0 UST context prio added to event ust_tests_hello:tptest_sighandle channel mychannel UST context pid added to event sched_kthread_stop_ret channel mychannel ContextErrorHandling lttng add-context -h 1 usage: lttng add-context -t TYPE If no channel and no event is given (-c/-e), the context will be added to all events and all channels. Otherwise the context will be added only to the channel (-c) and/or event (-e) indicated. Exactly one domain (-k/--kernel or -u/--userspace) must be specified. Options: -h, --help Show this help --list-options Simple listing of options -s, --session NAME Apply to session name -c, --channel NAME Apply to channel -e, --event NAME Apply to event -k, --kernel Apply to the kernel tracer -u, --userspace Apply to the user-space tracer -t, --type TYPE Context type. You can repeat that option on the command line to specify multiple contexts at once. (--kernel preempts --userspace) TYPE can be one of the strings below: pid, procname, prio, nice, vpid, tid, pthread_id, vtid, ppid, vppid, perf:cpu-cycles, perf:cycles Example: This command will add the context information 'prio' and two perf counters (hardware branch misses and cache misses), to all events in the trace data output: # lttng add-context -k -t prio -t perf:branch-misses -t perf:cache-misses lttng add-context -s mysession2 -c mychannel -e ust_tests_hello:tptest_sighandler -u -t prio -t pid 1 UST context prio added to event ust_tests_hello:tptest_sighandle channel mychannel UST context pid added to event sched_kthread_stop_ret channel mychannel CalibrateHandling lttng calibrate -k --function 0 Kernel calibration done lttng calibrate -u --function 1 Kernel calibration done