Commit | Line | Data |
---|---|---|
d132bcc7 BH |
1 | #################################################################### |
2 | # Copyright (c) 2012 Ericsson | |
3 | # | |
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 | |
8 | # | |
9 | # Contributors: | |
10 | # Bernd Hufmann - Initial API and implementation | |
11 | #################################################################### | |
12 | #################################################################### | |
13 | # Scenario: Test lttng not installed | |
14 | #################################################################### | |
15 | <SCENARIO> | |
16 | LttngNotInstalled | |
17 | <COMMAND_INPUT> | |
18 | lttng list | |
19 | </COMMAND_INPUT> | |
20 | <COMMAND_RESULT> | |
21 | 1 | |
22 | </COMMAND_RESULT> | |
23 | <COMMAND_OUTPUT> | |
24 | Command not found | |
25 | </COMMAND_OUTPUT> | |
26 | </SCENARIO> | |
27 | ||
276c17e7 BH |
28 | #################################################################### |
29 | # Scenario: Test lttng version | |
30 | #################################################################### | |
31 | <SCENARIO> | |
32 | LttngVersion | |
33 | <COMMAND_INPUT> | |
34 | lttng version | |
35 | </COMMAND_INPUT> | |
36 | <COMMAND_RESULT> | |
37 | 0 | |
38 | </COMMAND_RESULT> | |
39 | <COMMAND_OUTPUT> | |
40 | lttng version 2.0.0 - Annedd'ale | |
41 | Web site: http://lttng.org/ | |
42 | ||
43 | lttng is free software and under the GPL license and part LGPL | |
44 | </COMMAND_OUTPUT> | |
45 | </SCENARIO> | |
46 | ||
47 | #################################################################### | |
48 | # Scenario: Test lttng version (unsupported version) | |
49 | #################################################################### | |
50 | <SCENARIO> | |
51 | LttngUnsupportedVersion | |
52 | <COMMAND_INPUT> | |
53 | lttng version | |
54 | </COMMAND_INPUT> | |
55 | <COMMAND_RESULT> | |
56 | 0 | |
57 | </COMMAND_RESULT> | |
58 | <COMMAND_OUTPUT> | |
59 | lttng version 200.0.0 - Annedd'ale | |
60 | Web site: http://lttng.org/ | |
61 | ||
62 | lttng is free software and under the GPL license and part LGPL | |
63 | </COMMAND_OUTPUT> | |
64 | </SCENARIO> | |
65 | ||
66 | ||
67 | #################################################################### | |
68 | # Scenario: Test lttng version (noversion) | |
69 | #################################################################### | |
70 | <SCENARIO> | |
71 | LttngNoVersion | |
72 | <COMMAND_INPUT> | |
73 | lttng version | |
74 | </COMMAND_INPUT> | |
75 | <COMMAND_RESULT> | |
76 | 0 | |
77 | </COMMAND_RESULT> | |
78 | <COMMAND_OUTPUT> | |
79 | Web site: http://lttng.org/ | |
80 | ||
81 | lttng is free software and under the GPL license and part LGPL | |
82 | </COMMAND_OUTPUT> | |
83 | </SCENARIO> | |
84 | ||
d132bcc7 BH |
85 | #################################################################### |
86 | # Scenario: Test no sessions available | |
87 | #################################################################### | |
88 | <SCENARIO> | |
89 | NoSessionAvailable | |
90 | <COMMAND_INPUT> | |
91 | lttng list | |
92 | </COMMAND_INPUT> | |
93 | <COMMAND_RESULT> | |
94 | 0 | |
95 | </COMMAND_RESULT> | |
96 | <COMMAND_OUTPUT> | |
97 | Currently no available tracing session | |
98 | </COMMAND_OUTPUT> | |
99 | </SCENARIO> | |
100 | ||
101 | #################################################################### | |
102 | # Scenario: Test get sessions | |
103 | #################################################################### | |
104 | <SCENARIO> | |
105 | GetSessionNames1 | |
106 | <COMMAND_INPUT> | |
107 | lttng list | |
108 | </COMMAND_INPUT> | |
109 | <COMMAND_RESULT> | |
110 | 0 | |
111 | </COMMAND_RESULT> | |
112 | <COMMAND_OUTPUT> | |
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] | |
116 | ||
117 | Use lttng list <session_name> for more details | |
118 | </COMMAND_OUTPUT> | |
119 | </SCENARIO> | |
120 | ||
121 | #################################################################### | |
122 | # Scenario: Test lttng list <name> where session doesn't exist | |
123 | #################################################################### | |
124 | <SCENARIO> | |
125 | GetSessionNameNotExist | |
126 | <COMMAND_INPUT> | |
127 | lttng list test | |
128 | </COMMAND_INPUT> | |
129 | <COMMAND_RESULT> | |
130 | 1 | |
131 | </COMMAND_RESULT> | |
132 | <COMMAND_OUTPUT> | |
133 | Session test not found | |
134 | Error: Session name not found | |
135 | </COMMAND_OUTPUT> | |
136 | </SCENARIO> | |
137 | ||
138 | #################################################################### | |
139 | # Scenario: Test lttng list with garbage output | |
140 | #################################################################### | |
141 | <SCENARIO> | |
142 | GetSessionGarbageOut | |
143 | <COMMAND_INPUT> | |
144 | lttng list | |
145 | </COMMAND_INPUT> | |
146 | <COMMAND_RESULT> | |
147 | 0 | |
148 | </COMMAND_RESULT> | |
149 | <COMMAND_OUTPUT> | |
150 | asdfaereafsdcv 12333456434&*89**(())(^%$* | |
151 | @#$%^&*()@#$%^&*()0834523094578kj;djkfs | |
152 | a;sdf094v5u dsafj;sd9 | |
153 | </COMMAND_OUTPUT> | |
154 | </SCENARIO> | |
155 | ||
156 | #################################################################### | |
157 | # Scenario: Test lttng list <name> with sample outputs | |
158 | #################################################################### | |
159 | <SCENARIO> | |
160 | GetSession1 | |
161 | <COMMAND_INPUT> | |
162 | lttng list mysession | |
163 | </COMMAND_INPUT> | |
164 | <COMMAND_RESULT> | |
165 | 0 | |
166 | </COMMAND_RESULT> | |
167 | <COMMAND_OUTPUT> | |
168 | Tracing session mysession: [active] | |
169 | Trace path: /home/user/lttng-traces/mysession-20120129-084256 | |
170 | ||
171 | === Domain: Kernel === | |
172 | ||
173 | Channels: | |
174 | ------------- | |
175 | - channel0: [enabled] | |
176 | ||
177 | Attributes: | |
178 | overwrite mode: 0 | |
179 | subbufers size: 262144 | |
180 | number of subbufers: 4 | |
181 | switch timer interval: 0 | |
182 | read timer interval: 200 | |
183 | output: splice() | |
184 | ||
185 | Events: | |
186 | block_rq_remap (loglevel: TRACE_EMERG (0)) (type: tracepoint) [enabled] | |
187 | block_bio_remap (loglevel: TRACE_EMERG (0)) (type: tracepoint) [disabled] | |
188 | ||
189 | - channel1: [disabled] | |
190 | ||
191 | Attributes: | |
192 | overwrite mode: 1 | |
193 | subbufers size: 524288 | |
194 | number of subbufers: 4 | |
195 | switch timer interval: 100 | |
196 | read timer interval: 400 | |
197 | output: splice() | |
198 | ||
199 | Events: | |
200 | None | |
201 | ||
202 | === Domain: UST global === | |
203 | ||
204 | Channels: | |
205 | ------------- | |
206 | - mychannel1: [disabled] | |
207 | ||
208 | Attributes: | |
209 | overwrite mode: 1 | |
210 | subbufers size: 8192 | |
211 | number of subbufers: 8 | |
212 | switch timer interval: 200 | |
213 | read timer interval: 100 | |
214 | output: mmap() | |
215 | ||
216 | Events: | |
217 | None | |
218 | ||
219 | - channel0: [enabled] | |
220 | ||
221 | Attributes: | |
222 | overwrite mode: 0 | |
223 | subbufers size: 4096 | |
224 | number of subbufers: 4 | |
225 | switch timer interval: 0 | |
226 | read timer interval: 200 | |
227 | output: mmap() | |
228 | ||
229 | Events: | |
230 | ust_tests_hello:tptest_sighandler (loglevel: TRACE_DEBUG_LINE (13)) (type: tracepoint) [disabled] | |
231 | * (type: tracepoint) [enabled] | |
232 | ||
233 | </COMMAND_OUTPUT> | |
234 | <COMMAND_INPUT> | |
235 | lttng list mysession1 | |
236 | </COMMAND_INPUT> | |
237 | <COMMAND_RESULT> | |
238 | 0 | |
239 | </COMMAND_RESULT> | |
240 | <COMMAND_OUTPUT> | |
241 | Tracing session mysession1: [inactive] | |
242 | Trace path: /home/user/lttng-traces/mysession1-20120203-133225 | |
243 | ||
244 | </COMMAND_OUTPUT> | |
245 | </SCENARIO> | |
246 | ||
247 | ||
248 | #################################################################### | |
249 | # Scenario: Test "lttng list -k" with sample output | |
250 | #################################################################### | |
251 | <SCENARIO> | |
252 | GetKernelProvider1 | |
253 | <COMMAND_INPUT> | |
254 | lttng list -k | |
255 | </COMMAND_INPUT> | |
256 | <COMMAND_RESULT> | |
257 | 0 | |
258 | </COMMAND_RESULT> | |
259 | <COMMAND_OUTPUT> | |
260 | Kernel events | |
261 | ------------- | |
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) | |
265 | ||
266 | </COMMAND_OUTPUT> | |
267 | </SCENARIO> | |
268 | ||
269 | #################################################################### | |
270 | # Scenario: Test "lttng list -u" with sample output | |
271 | #################################################################### | |
272 | <SCENARIO> | |
273 | GetUstProvider1 | |
274 | <COMMAND_INPUT> | |
275 | lttng list -u | |
276 | </COMMAND_INPUT> | |
277 | <COMMAND_RESULT> | |
278 | 0 | |
279 | </COMMAND_RESULT> | |
280 | <COMMAND_OUTPUT> | |
281 | UST events: | |
282 | ------------- | |
283 | ||
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) | |
287 | ||
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) | |
291 | ||
292 | </COMMAND_OUTPUT> | |
293 | </SCENARIO> | |
294 | ||
295 | #################################################################### | |
296 | # Scenario: Test "lttng list -u" with no UST provider available | |
297 | #################################################################### | |
298 | <SCENARIO> | |
299 | GetUstProvider2 | |
300 | <COMMAND_INPUT> | |
301 | lttng list -u | |
302 | </COMMAND_INPUT> | |
303 | <COMMAND_RESULT> | |
304 | 0 | |
305 | </COMMAND_RESULT> | |
306 | <COMMAND_OUTPUT> | |
307 | UST events: | |
308 | ------------- | |
309 | None | |
310 | ||
311 | </COMMAND_OUTPUT> | |
312 | </SCENARIO> | |
313 | ||
314 | #################################################################### | |
315 | # Scenario: Test "lttng create <session> | |
316 | #################################################################### | |
317 | <SCENARIO> | |
318 | CreateSession1 | |
319 | <COMMAND_INPUT> | |
320 | lttng create mysession2 | |
321 | </COMMAND_INPUT> | |
322 | <COMMAND_RESULT> | |
323 | 0 | |
324 | </COMMAND_RESULT> | |
325 | <COMMAND_OUTPUT> | |
326 | Session mysession2 created. | |
327 | Traces will be written in /home/user/lttng-traces/mysession2-20120209-095418 | |
328 | </COMMAND_OUTPUT> | |
329 | </SCENARIO> | |
330 | ||
331 | #################################################################### | |
332 | # Scenario: Test "lttng create <session> with different variants | |
333 | # and errors | |
334 | #################################################################### | |
335 | <SCENARIO> | |
336 | CreateSessionVariants | |
337 | <COMMAND_INPUT> | |
338 | lttng create alreadyExist | |
339 | </COMMAND_INPUT> | |
340 | <COMMAND_RESULT> | |
341 | 1 | |
342 | </COMMAND_RESULT> | |
343 | <COMMAND_OUTPUT> | |
344 | Error: Session name already exist | |
345 | </COMMAND_OUTPUT> | |
346 | ||
347 | <COMMAND_INPUT> | |
348 | lttng create "session with spaces" | |
349 | </COMMAND_INPUT> | |
350 | <COMMAND_RESULT> | |
351 | 0 | |
352 | </COMMAND_RESULT> | |
353 | <COMMAND_OUTPUT> | |
354 | Session session with spaces created. | |
355 | Traces will be written in /home/user/lttng-traces/session with spaces-20120209-095418 | |
356 | </COMMAND_OUTPUT> | |
357 | ||
358 | <COMMAND_INPUT> | |
359 | lttng create wrongName | |
360 | </COMMAND_INPUT> | |
361 | <COMMAND_RESULT> | |
362 | 0 | |
363 | </COMMAND_RESULT> | |
364 | <COMMAND_OUTPUT> | |
365 | Session auto created. | |
366 | Traces will be written in /home/user/lttng-traces/auto-20120209-095418 | |
367 | </COMMAND_OUTPUT> | |
368 | ||
369 | <COMMAND_INPUT> | |
370 | lttng create wrongPath -o /home/user/hallo | |
371 | </COMMAND_INPUT> | |
372 | <COMMAND_RESULT> | |
373 | 0 | |
374 | </COMMAND_RESULT> | |
375 | <COMMAND_OUTPUT> | |
376 | Session wrongPath created. | |
377 | Traces will be written in /home/user/lttng-traces/wrongPath-20120209-095418 | |
378 | </COMMAND_OUTPUT> | |
379 | ||
380 | <COMMAND_INPUT> | |
381 | lttng create pathWithSpaces -o "/home/user/hallo user/here" | |
382 | </COMMAND_INPUT> | |
383 | <COMMAND_RESULT> | |
384 | 0 | |
385 | </COMMAND_RESULT> | |
386 | <COMMAND_OUTPUT> | |
387 | Session pathWithSpaces created. | |
388 | Traces will be written in /home/user/hallo user/here/pathWithSpaces-20120209-095418 | |
389 | </COMMAND_OUTPUT> | |
390 | </SCENARIO> | |
391 | ||
392 | #################################################################### | |
393 | # Scenario: Test "lttng destroy <session> | |
394 | #################################################################### | |
395 | ||
396 | <SCENARIO> | |
397 | DestroySession1 | |
398 | <COMMAND_INPUT> | |
399 | lttng destroy mysession2 | |
400 | </COMMAND_INPUT> | |
401 | <COMMAND_RESULT> | |
402 | 0 | |
403 | </COMMAND_RESULT> | |
404 | <COMMAND_OUTPUT> | |
405 | Session mysession2 destroyed. | |
406 | </COMMAND_OUTPUT> | |
407 | </SCENARIO> | |
408 | ||
409 | #################################################################### | |
410 | # Scenario: Test "lttng enable-channel ..." with different inputs | |
411 | #################################################################### | |
412 | ||
413 | <SCENARIO> | |
414 | ChannelHandling | |
415 | <COMMAND_INPUT> | |
416 | lttng enable-channel mychannel0,mychannel1 -k -s mysession2 --overwrite --subbuf-size 16384 --num-subbuf 2 --switch-timer 200 --read-timer 100 | |
417 | </COMMAND_INPUT> | |
418 | <COMMAND_RESULT> | |
419 | 0 | |
420 | </COMMAND_RESULT> | |
421 | <COMMAND_OUTPUT> | |
422 | Kernel channel mychannel0 enabled for session mysession2 | |
423 | Kernel channel mychannel1 enabled for session mysession2 | |
424 | </COMMAND_OUTPUT> | |
425 | ||
426 | <COMMAND_INPUT> | |
427 | lttng enable-channel ustChannel -u -s mysession2 --overwrite --subbuf-size 32768 --num-subbuf 1 --switch-timer 100 --read-timer 200 | |
428 | </COMMAND_INPUT> | |
429 | <COMMAND_RESULT> | |
430 | 0 | |
431 | </COMMAND_RESULT> | |
432 | <COMMAND_OUTPUT> | |
433 | UST channel channel0 enabled for session mysession2 | |
434 | </COMMAND_OUTPUT> | |
435 | ||
436 | <COMMAND_INPUT> | |
437 | lttng enable-channel mychannel0,mychannel1 -k -s mysession2 | |
438 | </COMMAND_INPUT> | |
439 | <COMMAND_RESULT> | |
440 | 0 | |
441 | </COMMAND_RESULT> | |
442 | <COMMAND_OUTPUT> | |
443 | Kernel channel mychannel0 enabled for session mysession2 | |
444 | Kernel channel mychannel1 enabled for session mysession2 | |
445 | </COMMAND_OUTPUT> | |
446 | ||
447 | <COMMAND_INPUT> | |
448 | lttng enable-channel ustChannel -u -s mysession2 | |
449 | </COMMAND_INPUT> | |
450 | <COMMAND_RESULT> | |
451 | 0 | |
452 | </COMMAND_RESULT> | |
453 | <COMMAND_OUTPUT> | |
454 | UST channel mychannel0 enabled for session mysession2 | |
455 | </COMMAND_OUTPUT> | |
456 | ||
457 | <COMMAND_INPUT> | |
458 | lttng disable-channel mychannel0,mychannel1 -k -s mysession2 | |
459 | </COMMAND_INPUT> | |
460 | <COMMAND_RESULT> | |
461 | 0 | |
462 | </COMMAND_RESULT> | |
463 | <COMMAND_OUTPUT> | |
464 | Kernel channel mychannel0 disabled for session mysession2 | |
465 | Kernel channel mychannel1 disabled for session mysession2 | |
466 | </COMMAND_OUTPUT> | |
467 | ||
468 | <COMMAND_INPUT> | |
469 | lttng disable-channel ustChannel -u -s mysession2 | |
470 | </COMMAND_INPUT> | |
471 | <COMMAND_RESULT> | |
472 | 0 | |
473 | </COMMAND_RESULT> | |
474 | <COMMAND_OUTPUT> | |
475 | UST channel mychannel0 enabled for session mysession2 | |
476 | </COMMAND_OUTPUT> | |
477 | </SCENARIO> | |
478 | ||
479 | ||
480 | #################################################################### | |
481 | # Scenario: Test "lttng enable-events ..." with different inputs | |
482 | #################################################################### | |
483 | <SCENARIO> | |
484 | EventHandling | |
485 | ||
486 | # Tracepoint test cases | |
487 | ||
488 | <COMMAND_INPUT> | |
489 | lttng enable-event block_rq_remap,block_bio_remap,softirq_entry -k -s mysession2 --tracepoint | |
490 | </COMMAND_INPUT> | |
491 | <COMMAND_RESULT> | |
492 | 0 | |
493 | </COMMAND_RESULT> | |
494 | <COMMAND_OUTPUT> | |
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 | |
498 | </COMMAND_OUTPUT> | |
499 | ||
500 | <COMMAND_INPUT> | |
501 | lttng enable-event -a -k -s mysession2 -c mychannel --tracepoint | |
502 | </COMMAND_INPUT> | |
503 | <COMMAND_RESULT> | |
504 | 0 | |
505 | </COMMAND_RESULT> | |
506 | <COMMAND_OUTPUT> | |
507 | All kernel tracepoints are enabled in channel channel0 | |
508 | </COMMAND_OUTPUT> | |
509 | ||
510 | <COMMAND_INPUT> | |
511 | lttng enable-event ust_tests_hello:tptest_sighandler -u -s mysession2 -c mychannel --tracepoint | |
512 | </COMMAND_INPUT> | |
513 | <COMMAND_RESULT> | |
514 | 0 | |
515 | </COMMAND_RESULT> | |
516 | <COMMAND_OUTPUT> | |
517 | UST event ust_tests_hello:tptest_sighandler created in channel mychannel | |
518 | </COMMAND_OUTPUT> | |
519 | ||
520 | <COMMAND_INPUT> | |
521 | lttng enable-event -a -u -s mysession2 -c mychannel --tracepoint | |
522 | </COMMAND_INPUT> | |
523 | <COMMAND_RESULT> | |
524 | 0 | |
525 | </COMMAND_RESULT> | |
526 | <COMMAND_OUTPUT> | |
527 | All UST tracepoints are enabled in channel mychannel | |
528 | </COMMAND_OUTPUT> | |
529 | ||
530 | # Syscall test cases | |
531 | ||
532 | <COMMAND_INPUT> | |
533 | lttng enable-event -a -k -s mysession2 --syscall | |
534 | </COMMAND_INPUT> | |
535 | <COMMAND_RESULT> | |
536 | 0 | |
537 | </COMMAND_RESULT> | |
538 | <COMMAND_OUTPUT> | |
539 | All kernel system calls are enabled in channel channel0 | |
540 | </COMMAND_OUTPUT> | |
541 | ||
542 | <COMMAND_INPUT> | |
543 | lttng enable-event -a -k -s mysession2 -c mychannel --syscall | |
544 | </COMMAND_INPUT> | |
545 | <COMMAND_RESULT> | |
546 | 0 | |
547 | </COMMAND_RESULT> | |
548 | <COMMAND_OUTPUT> | |
549 | All kernel system calls are enabled in channel mychannel | |
550 | </COMMAND_OUTPUT> | |
551 | ||
552 | # dynamic probe/function probe test cases | |
553 | ||
554 | <COMMAND_INPUT> | |
555 | lttng enable-event myevent0 -k -s mysession2 --function 0xc0101340 | |
556 | </COMMAND_INPUT> | |
557 | <COMMAND_RESULT> | |
558 | 0 | |
559 | </COMMAND_RESULT> | |
560 | <COMMAND_OUTPUT> | |
561 | kernel event myevent0 created in channel mychannel | |
562 | </COMMAND_OUTPUT> | |
563 | ||
564 | <COMMAND_INPUT> | |
565 | lttng enable-event myevent1 -k -s mysession2 -c mychannel --probe init_post | |
566 | </COMMAND_INPUT> | |
567 | <COMMAND_RESULT> | |
568 | 0 | |
569 | </COMMAND_RESULT> | |
570 | <COMMAND_OUTPUT> | |
571 | kernel event myevent1 created in channel mychannel | |
572 | </COMMAND_OUTPUT> | |
573 | ||
574 | # log level test cases | |
575 | ||
576 | <COMMAND_INPUT> | |
577 | lttng enable-event myevent4 -u -s mysession2 --loglevel-only TRACE_DEBUG | |
578 | </COMMAND_INPUT> | |
579 | <COMMAND_RESULT> | |
580 | 0 | |
581 | </COMMAND_RESULT> | |
582 | <COMMAND_OUTPUT> | |
583 | UST event myevent4 created in channel channel0 | |
584 | </COMMAND_OUTPUT> | |
585 | ||
586 | <COMMAND_INPUT> | |
587 | lttng enable-event myevent5 -u -s mysession2 -c mychannel --loglevel TRACE_DEBUG_FUNCTION | |
588 | </COMMAND_INPUT> | |
589 | <COMMAND_RESULT> | |
590 | 0 | |
591 | </COMMAND_RESULT> | |
592 | <COMMAND_OUTPUT> | |
593 | UST event myevent5 created in channel mychannel | |
594 | </COMMAND_OUTPUT> | |
595 | ||
596 | </SCENARIO> | |
597 | ||
4ea599a5 BH |
598 | #################################################################### |
599 | # Scenario: Test "lttng add-context -h" and lttng add-context ..." with different inputs | |
600 | #################################################################### | |
601 | ||
602 | <SCENARIO> | |
603 | ContextHandling | |
604 | ||
605 | <COMMAND_INPUT> | |
606 | lttng add-context -h | |
607 | </COMMAND_INPUT> | |
608 | <COMMAND_RESULT> | |
609 | 0 | |
610 | </COMMAND_RESULT> | |
611 | <COMMAND_OUTPUT> | |
612 | usage: lttng add-context -t TYPE | |
613 | ||
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. | |
619 | ||
620 | Options: | |
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 | |
634 | Example: | |
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 | |
639 | ||
640 | </COMMAND_OUTPUT> | |
641 | ||
642 | <COMMAND_INPUT> | |
643 | lttng add-context -s mysession2 -c mychannel -e ust_tests_hello:tptest_sighandler -u -t prio -t pid | |
644 | </COMMAND_INPUT> | |
645 | <COMMAND_RESULT> | |
646 | 0 | |
647 | </COMMAND_RESULT> | |
648 | <COMMAND_OUTPUT> | |
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 | |
651 | </COMMAND_OUTPUT> | |
652 | </SCENARIO> | |
653 | ||
654 | <SCENARIO> | |
655 | ContextErrorHandling | |
656 | ||
657 | <COMMAND_INPUT> | |
658 | lttng add-context -h | |
659 | </COMMAND_INPUT> | |
660 | <COMMAND_RESULT> | |
661 | 1 | |
662 | </COMMAND_RESULT> | |
663 | <COMMAND_OUTPUT> | |
664 | usage: lttng add-context -t TYPE | |
d132bcc7 | 665 | |
4ea599a5 BH |
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. | |
671 | ||
672 | Options: | |
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 | |
686 | Example: | |
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 | |
691 | ||
692 | </COMMAND_OUTPUT> | |
693 | ||
694 | <COMMAND_INPUT> | |
695 | lttng add-context -s mysession2 -c mychannel -e ust_tests_hello:tptest_sighandler -u -t prio -t pid | |
696 | </COMMAND_INPUT> | |
697 | <COMMAND_RESULT> | |
698 | 1 | |
699 | </COMMAND_RESULT> | |
700 | <COMMAND_OUTPUT> | |
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 | |
703 | </COMMAND_OUTPUT> | |
704 | ||
705 | </SCENARIO> | |
706 | ||
707 | <SCENARIO> | |
708 | CalibrateHandling | |
709 | <COMMAND_INPUT> | |
710 | lttng calibrate -k --function | |
711 | </COMMAND_INPUT> | |
712 | <COMMAND_RESULT> | |
713 | 0 | |
714 | </COMMAND_RESULT> | |
715 | <COMMAND_OUTPUT> | |
716 | Kernel calibration done | |
717 | </COMMAND_OUTPUT> | |
718 | ||
719 | <COMMAND_INPUT> | |
720 | lttng calibrate -u --function | |
721 | </COMMAND_INPUT> | |
722 | <COMMAND_RESULT> | |
723 | 1 | |
724 | </COMMAND_RESULT> | |
725 | <COMMAND_OUTPUT> | |
726 | Kernel calibration done | |
727 | </COMMAND_OUTPUT> | |
728 | ||
729 | </SCENARIO> |