1 package org
.eclipse
.linuxtools
.lttng
.stubs
.service
.shells
;
3 import java
.util
.ArrayList
;
6 import org
.eclipse
.core
.commands
.ExecutionException
;
7 import org
.eclipse
.core
.runtime
.IProgressMonitor
;
8 import org
.eclipse
.linuxtools
.lttng
.ui
.views
.control
.service
.CommandResult
;
9 import org
.eclipse
.linuxtools
.lttng
.ui
.views
.control
.service
.ICommandResult
;
11 public class SessionNamesShell
extends TestCommandShell
{
12 @SuppressWarnings("nls")
14 public ICommandResult
executeCommand(String command
, IProgressMonitor monitor
, boolean checkReturnValue
) throws ExecutionException
{
15 if ("lttng list ".equals(command
)) {
16 String
[] output
= new String
[5];
17 output
[0] = String
.valueOf("Available tracing sessions:");
18 output
[1] = String
.valueOf(" 1) mysession1 (/home/user/lttng-traces/mysession1-20120123-083928) [inactive]");
19 output
[2] = String
.valueOf(" 2) mysession (/home/user/lttng-traces/mysession-20120123-083318) [inactive]");
20 output
[3] = String
.valueOf("");
21 output
[4] = String
.valueOf(" Use lttng list <session_name> for more details");
22 // test constructor with null pointer parameter
23 CommandResult result
= new CommandResult(0, null);
25 result
.setOutput(output
);
27 } else if ("lttng list mysession".equals(command
)) {
28 List
<String
> list
= new ArrayList
<String
>();
29 list
.add("Tracing session mysession: [active]");
30 list
.add(" Trace path: /home/user/lttng-traces/mysession-20120129-084256");
32 list
.add("=== Domain: Kernel ===");
34 list
.add("Channels:");
35 list
.add("-------------");
36 list
.add("- channel0: [enabled]");
38 list
.add(" Attributes:");
39 list
.add(" overwrite mode: 0");
40 list
.add(" subbufers size: 262144");
41 list
.add(" number of subbufers: 4");
42 list
.add(" switch timer interval: 0");
43 list
.add(" read timer interval: 200");
44 list
.add(" output: splice()");
47 list
.add(" block_rq_remap (loglevel: TRACE_EMERG (0)) (type: tracepoint) [enabled]");
48 list
.add(" block_bio_remap (loglevel: TRACE_EMERG (0)) (type: tracepoint) [disabled]");
50 list
.add("- channel1: [disabled]");
52 list
.add(" Attributes:");
53 list
.add(" overwrite mode: 1");
54 list
.add(" subbufers size: 524288");
55 list
.add(" number of subbufers: 4");
56 list
.add(" switch timer interval: 100");
57 list
.add(" read timer interval: 400");
58 list
.add(" output: splice()");
63 list
.add("=== Domain: UST global ===");
65 list
.add("Channels:");
66 list
.add("-------------");
67 list
.add("- mychannel1: [disabled]");
69 list
.add(" Attributes:");
70 list
.add(" overwrite mode: 1");
71 list
.add(" subbufers size: 8192");
72 list
.add(" number of subbufers: 8");
73 list
.add(" switch timer interval: 200");
74 list
.add(" read timer interval: 100");
75 list
.add(" output: mmap()");
80 list
.add("- channel0: [enabled]");
82 list
.add(" Attributes:");
83 list
.add(" overwrite mode: 0");
84 list
.add(" subbufers size: 4096");
85 list
.add(" number of subbufers: 4");
86 list
.add(" switch timer interval: 0");
87 list
.add(" read timer interval: 200");
88 list
.add(" output: mmap()");
91 list
.add(" ust_tests_hello:tptest_sighandler (loglevel: TRACE_DEBUG_LINE (13)) (type: tracepoint) [disabled]");
92 list
.add(" * (type: tracepoint) [enabled]");
94 return new CommandResult(0, list
.toArray(new String
[list
.size()]));
95 } else if ("lttng list -u".equals(command
)) {
96 List
<String
> list
= new ArrayList
<String
>();
97 list
.add("UST events:");
98 list
.add("-------------");
100 list
.add("PID: 9379 - Name: /home/user/git/lttng-ust/tests/hello.cxx/.libs/lt-hello");
101 list
.add(" ust_tests_hello:tptest_sighandler (loglevel: TRACE_DEBUG_MODULE (10)) (type: tracepoint)");
102 list
.add(" ust_tests_hello:tptest (loglevel: TRACE_INFO (6)) (type: tracepoint)");
104 list
.add("PID: 4852 - Name: /home/user/git/lttng-ust/tests/hello.cxx/.libs/lt-hello");
105 list
.add(" ust_tests_hello:tptest_sighandler (loglevel: TRACE_WARNING (4)) (type: tracepoint)");
106 list
.add(" ust_tests_hello:tptest (loglevel: TRACE_DEBUG_FUNCTION (12)) (type: tracepoint)");
108 return new CommandResult(0, list
.toArray(new String
[list
.size()]));
109 } else if ("lttng list -k".equals(command
)) {
110 List
<String
> list
= new ArrayList
<String
>();
111 list
.add("Kernel events:");
112 list
.add("-------------");
113 list
.add(" sched_kthread_stop (loglevel: TRACE_EMERG (0)) (type: tracepoint)");
114 list
.add(" sched_kthread_stop_ret (loglevel: TRACE_EMERG (0)) (type: tracepoint)");
115 list
.add(" sched_wakeup_new (loglevel: TRACE_EMERG (0)) (type: tracepoint)");
117 return new CommandResult(0, list
.toArray(new String
[list
.size()]));
118 } else if ("lttng list mysession1".equals(command
)) {
119 List
<String
> list
= new ArrayList
<String
>();
120 list
.add("Tracing session mysession1: [inactive]");
121 list
.add(" Trace path: /home/user/lttng-traces/mysession1-20120203-133225");
123 return new CommandResult(0, list
.toArray(new String
[list
.size()]));
126 String
[] output
= new String
[1];
127 output
[0] = String
.valueOf("Command not found");
128 return new CommandResult(1, output
);
This page took 0.033721 seconds and 6 git commands to generate.