Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBernd Hufmann2014-12-19 16:27:19 +0000
committerMarc-Andre Laperle2014-12-23 20:09:59 +0000
commitc8f6254ae6b86c43336d1ead9b083c349737b23f (patch)
treed1ee563faad762cbc7310774b8964498f04e4738
parent780db5f29a8622cdf6cba69adb8f8b6849a47182 (diff)
downloadorg.eclipse.linuxtools-c8f6254ae6b86c43336d1ead9b083c349737b23f.tar.gz
org.eclipse.linuxtools-c8f6254ae6b86c43336d1ead9b083c349737b23f.tar.xz
org.eclipse.linuxtools-c8f6254ae6b86c43336d1ead9b083c349737b23f.zip
[lttng control] Use List<String> for control commands (Bug 455382)
By doing this, it's not necessary to surround commands with wildcards and filters with quotes which made these commands fail using org.eclipse.remote/Built-in SSH and org.eclipse.remote.Local. For the PTP RSE adapter for org.eclipse.remote, the user has to enter quotes otherwise the command will fail. The UI was changed to allow quotes in the text boxes. Change-Id: I2185c5b658f635ff491a6022fab206c208ca5d8f Signed-off-by: Bernd Hufmann <Bernd.Hufmann@ericsson.com> Reviewed-on: https://git.eclipse.org/r/38578 Tested-by: Hudson CI Reviewed-by: Marc-Andre Laperle <marc-andre.laperle@ericsson.com> Tested-by: Marc-Andre Laperle <marc-andre.laperle@ericsson.com>
-rw-r--r--lttng/org.eclipse.linuxtools.lttng2.control.ui.tests/stubs/org/eclipse/linuxtools/internal/lttng2/control/stubs/shells/LTTngToolsFileShell.java18
-rw-r--r--lttng/org.eclipse.linuxtools.lttng2.control.ui.tests/stubs/org/eclipse/linuxtools/internal/lttng2/control/stubs/shells/TestCommandShell.java8
-rw-r--r--lttng/org.eclipse.linuxtools.lttng2.control.ui.tests/testfiles/CreateSessionTest.cfg4
-rw-r--r--lttng/org.eclipse.linuxtools.lttng2.control.ui.tests/testfiles/CreateSessionTest2.cfg12
-rw-r--r--lttng/org.eclipse.linuxtools.lttng2.control.ui.tests/testfiles/CreateSessionTestMi.cfg6
-rw-r--r--lttng/org.eclipse.linuxtools.lttng2.control.ui.tests/testfiles/CreateTreeTest.cfg94
-rw-r--r--lttng/org.eclipse.linuxtools.lttng2.control.ui.tests/testfiles/CreateTreeTest2.cfg12
-rw-r--r--lttng/org.eclipse.linuxtools.lttng2.control.ui.tests/testfiles/LTTngServiceMiTest.cfg124
-rw-r--r--lttng/org.eclipse.linuxtools.lttng2.control.ui.tests/testfiles/LTTngServiceTest.cfg134
-rw-r--r--lttng/org.eclipse.linuxtools.lttng2.control.ui.tests/testfiles/ListInfoTest.cfg10
-rw-r--r--lttng/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/dialogs/EnableUstEventsComposite.java2
-rw-r--r--lttng/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/remote/CommandShell.java16
-rw-r--r--lttng/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/remote/ICommandShell.java4
-rw-r--r--lttng/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/service/LTTngControlService.java444
-rw-r--r--lttng/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/service/LTTngControlServiceConstants.java114
-rw-r--r--lttng/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/service/LTTngControlServiceFactory.java17
-rw-r--r--lttng/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/service/LTTngControlServiceMI.java57
17 files changed, 542 insertions, 534 deletions
diff --git a/lttng/org.eclipse.linuxtools.lttng2.control.ui.tests/stubs/org/eclipse/linuxtools/internal/lttng2/control/stubs/shells/LTTngToolsFileShell.java b/lttng/org.eclipse.linuxtools.lttng2.control.ui.tests/stubs/org/eclipse/linuxtools/internal/lttng2/control/stubs/shells/LTTngToolsFileShell.java
index 879beefb57..a4c3201cc5 100644
--- a/lttng/org.eclipse.linuxtools.lttng2.control.ui.tests/stubs/org/eclipse/linuxtools/internal/lttng2/control/stubs/shells/LTTngToolsFileShell.java
+++ b/lttng/org.eclipse.linuxtools.lttng2.control.ui.tests/stubs/org/eclipse/linuxtools/internal/lttng2/control/stubs/shells/LTTngToolsFileShell.java
@@ -29,6 +29,7 @@ import org.eclipse.core.commands.ExecutionException;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.linuxtools.internal.lttng2.control.ui.views.remote.CommandResult;
import org.eclipse.linuxtools.internal.lttng2.control.ui.views.remote.ICommandResult;
+import org.eclipse.linuxtools.internal.lttng2.control.ui.views.service.LTTngControlService;
@SuppressWarnings("javadoc")
public class LTTngToolsFileShell extends TestCommandShell {
@@ -47,7 +48,7 @@ public class LTTngToolsFileShell extends TestCommandShell {
private final static String ERROR_OUTPUT_END_KEY = "</COMMAND_ERROR_OUTPUT>";
private final static String COMMENT_KEY = "#.*";
- private final static Pattern LTTNG_LIST_SESSION_PATTERN = Pattern.compile("lttng\\s+list\\s+(.+)");
+ private final static Pattern LTTNG_LIST_SESSION_PATTERN = Pattern.compile("lttng\\s+list\\s+(.+)");
private final static String LTTNG_LIST_PROVIDER_PATTERN = "lttng\\s+list\\s+(-u|-k)";
// ------------------------------------------------------------------------
@@ -61,6 +62,7 @@ public class LTTngToolsFileShell extends TestCommandShell {
/**
* Parse a scenario file with the format:
+ *
* <pre>
* &lt;SCENARIO&gt;
* ScenarioName
@@ -90,7 +92,8 @@ public class LTTngToolsFileShell extends TestCommandShell {
*
* Note: 1) There can be many scenarios per file
* 2) There can be many (Command-CommandResult-CommandOutput) triples per scenario
- * 3) Lines starting with # will be ignored (comments)
+ * 3) Lines starting with # will be ignored (comments)
+ *
* <pre>
* @param scenariofile - path to scenario file
* @throws Exception
@@ -236,12 +239,13 @@ public class LTTngToolsFileShell extends TestCommandShell {
}
@Override
- public synchronized ICommandResult executeCommand(String command, IProgressMonitor monitor) throws ExecutionException {
+ public synchronized ICommandResult executeCommand(List<String> command, IProgressMonitor monitor) throws ExecutionException {
Map<String, ICommandResult> commands = fScenarioMap.get(fScenario);
- String fullCommand = command;
+ String commandLine = LTTngControlService.toCommandString(command);
+ String fullCommand = commandLine;
- Matcher matcher = LTTNG_LIST_SESSION_PATTERN.matcher(command);
- if (matcher.matches() && !command.matches(LTTNG_LIST_PROVIDER_PATTERN)) {
+ Matcher matcher = LTTNG_LIST_SESSION_PATTERN.matcher(commandLine);
+ if (matcher.matches() && !commandLine.matches(LTTNG_LIST_PROVIDER_PATTERN)) {
String sessionName = matcher.group(1).trim();
Integer i = fSessionNameMap.get(sessionName);
if (i != null) {
@@ -265,7 +269,7 @@ public class LTTngToolsFileShell extends TestCommandShell {
result.setErrorOutput(output);
result.setResult(1);
return result;
- }
+ }
// ------------------------------------------------------------------------
// Helper methods
diff --git a/lttng/org.eclipse.linuxtools.lttng2.control.ui.tests/stubs/org/eclipse/linuxtools/internal/lttng2/control/stubs/shells/TestCommandShell.java b/lttng/org.eclipse.linuxtools.lttng2.control.ui.tests/stubs/org/eclipse/linuxtools/internal/lttng2/control/stubs/shells/TestCommandShell.java
index bc31d8e841..3a03fe7ba2 100644
--- a/lttng/org.eclipse.linuxtools.lttng2.control.ui.tests/stubs/org/eclipse/linuxtools/internal/lttng2/control/stubs/shells/TestCommandShell.java
+++ b/lttng/org.eclipse.linuxtools.lttng2.control.ui.tests/stubs/org/eclipse/linuxtools/internal/lttng2/control/stubs/shells/TestCommandShell.java
@@ -12,6 +12,8 @@
**********************************************************************/
package org.eclipse.linuxtools.internal.lttng2.control.stubs.shells;
+import java.util.List;
+
import org.eclipse.core.commands.ExecutionException;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.linuxtools.internal.lttng2.control.ui.views.remote.CommandResult;
@@ -37,10 +39,10 @@ public class TestCommandShell implements ICommandShell {
}
@Override
- public ICommandResult executeCommand(String command, IProgressMonitor monitor) throws ExecutionException {
+ public ICommandResult executeCommand(List<String> command, IProgressMonitor monitor) throws ExecutionException {
if (fIsConnected) {
-
+ return new CommandResult(0, new String[0], new String[0]);
}
- return new CommandResult(0, new String[0], new String[0]);
+ return new CommandResult(1, new String[0], new String[0]);
}
}
diff --git a/lttng/org.eclipse.linuxtools.lttng2.control.ui.tests/testfiles/CreateSessionTest.cfg b/lttng/org.eclipse.linuxtools.lttng2.control.ui.tests/testfiles/CreateSessionTest.cfg
index 9b06e93148..85bca758be 100644
--- a/lttng/org.eclipse.linuxtools.lttng2.control.ui.tests/testfiles/CreateSessionTest.cfg
+++ b/lttng/org.eclipse.linuxtools.lttng2.control.ui.tests/testfiles/CreateSessionTest.cfg
@@ -15,7 +15,7 @@
<SCENARIO>
Initialize
<COMMAND_INPUT>
-lttng version
+lttng version
</COMMAND_INPUT>
<COMMAND_RESULT>
0
@@ -28,7 +28,7 @@ lttng is free software and under the GPL license and part LGPL
</COMMAND_OUTPUT>
<COMMAND_INPUT>
-lttng list
+lttng list
</COMMAND_INPUT>
<COMMAND_RESULT>
0
diff --git a/lttng/org.eclipse.linuxtools.lttng2.control.ui.tests/testfiles/CreateSessionTest2.cfg b/lttng/org.eclipse.linuxtools.lttng2.control.ui.tests/testfiles/CreateSessionTest2.cfg
index 808a51f369..c37a01ade5 100644
--- a/lttng/org.eclipse.linuxtools.lttng2.control.ui.tests/testfiles/CreateSessionTest2.cfg
+++ b/lttng/org.eclipse.linuxtools.lttng2.control.ui.tests/testfiles/CreateSessionTest2.cfg
@@ -15,7 +15,7 @@
<SCENARIO>
Initialize
<COMMAND_INPUT>
-lttng version
+lttng version
</COMMAND_INPUT>
<COMMAND_RESULT>
0
@@ -31,7 +31,7 @@ lttng is free software and under the GPL license and part LGPL
</COMMAND_OUTPUT>
<COMMAND_INPUT>
-lttng list
+lttng list
</COMMAND_INPUT>
<COMMAND_RESULT>
0
@@ -56,7 +56,7 @@ Kernel events
</COMMAND_OUTPUT>
<COMMAND_INPUT>
-lttng list -u -f
+lttng list -u -f
</COMMAND_INPUT>
<COMMAND_RESULT>
0
@@ -82,7 +82,7 @@ PID: 4852 - Name: /home/user/git/lttng-ust/tests/hello.cxx/.libs/lt-hello
<SCENARIO>
ScenCreateSession
<COMMAND_INPUT>
-lttng create mysession --snapshot
+lttng create mysession --snapshot
</COMMAND_INPUT>
<COMMAND_RESULT>
0
@@ -106,7 +106,7 @@ Tracing session mysession: [inactive snapshot]
</COMMAND_OUTPUT>
#------------------------------------------------------------------------------
<COMMAND_INPUT>
-lttng snapshot list-output -s mysession
+lttng snapshot list-output -s mysession
</COMMAND_INPUT>
<COMMAND_RESULT>
0
@@ -127,7 +127,7 @@ Tracing started for session mysession.
</COMMAND_OUTPUT>
#------------------------------------------------------------------------------
<COMMAND_INPUT>
-lttng snapshot record -s mysession
+lttng snapshot record -s mysession
</COMMAND_INPUT>
<COMMAND_RESULT>
0
diff --git a/lttng/org.eclipse.linuxtools.lttng2.control.ui.tests/testfiles/CreateSessionTestMi.cfg b/lttng/org.eclipse.linuxtools.lttng2.control.ui.tests/testfiles/CreateSessionTestMi.cfg
index b841a5c8b1..99d0f84faf 100644
--- a/lttng/org.eclipse.linuxtools.lttng2.control.ui.tests/testfiles/CreateSessionTestMi.cfg
+++ b/lttng/org.eclipse.linuxtools.lttng2.control.ui.tests/testfiles/CreateSessionTestMi.cfg
@@ -15,7 +15,7 @@
<SCENARIO>
Initialize
<COMMAND_INPUT>
-lttng --mi xml version
+lttng --mi xml version
</COMMAND_INPUT>
<COMMAND_RESULT>
0
@@ -41,7 +41,7 @@ lttng --mi xml version
</COMMAND_OUTPUT>
<COMMAND_INPUT>
-lttng --mi xml list
+lttng --mi xml list
</COMMAND_INPUT>
<COMMAND_RESULT>
0
@@ -107,7 +107,7 @@ lttng --mi xml list -k
</COMMAND_OUTPUT>
<COMMAND_INPUT>
-lttng --mi xml list -u -f
+lttng --mi xml list -u -f
</COMMAND_INPUT>
<COMMAND_RESULT>
0
diff --git a/lttng/org.eclipse.linuxtools.lttng2.control.ui.tests/testfiles/CreateTreeTest.cfg b/lttng/org.eclipse.linuxtools.lttng2.control.ui.tests/testfiles/CreateTreeTest.cfg
index f3cc92d8f0..f11a133b01 100644
--- a/lttng/org.eclipse.linuxtools.lttng2.control.ui.tests/testfiles/CreateTreeTest.cfg
+++ b/lttng/org.eclipse.linuxtools.lttng2.control.ui.tests/testfiles/CreateTreeTest.cfg
@@ -15,7 +15,7 @@
<SCENARIO>
Initialize
<COMMAND_INPUT>
-lttng version
+lttng version
</COMMAND_INPUT>
<COMMAND_RESULT>
0
@@ -28,7 +28,7 @@ lttng is free software and under the GPL license and part LGPL
</COMMAND_OUTPUT>
<COMMAND_INPUT>
-lttng list
+lttng list
</COMMAND_INPUT>
<COMMAND_RESULT>
0
@@ -184,7 +184,7 @@ Scenario1
<COMMAND_INPUT>
-lttng enable-event sched_kthread_stop,sched_kthread_stop_ret -k -s mysession --tracepoint
+lttng enable-event sched_kthread_stop,sched_kthread_stop_ret -k -s mysession --tracepoint
</COMMAND_INPUT>
<COMMAND_RESULT>
0
@@ -225,7 +225,7 @@ Channels:
</COMMAND_OUTPUT>
<COMMAND_INPUT>
-lttng disable-event sched_kthread_stop_ret,sched_kthread_stop -k -s mysession -c channel0
+lttng disable-event sched_kthread_stop_ret,sched_kthread_stop -k -s mysession -c channel0
</COMMAND_INPUT>
<COMMAND_RESULT>
0
@@ -236,7 +236,7 @@ kernel event sched_kthread_stop disabled in channel channel0
</COMMAND_OUTPUT>
<COMMAND_INPUT>
-lttng enable-event sched_kthread_stop -k -s mysession -c channel0 --tracepoint
+lttng enable-event sched_kthread_stop -k -s mysession -c channel0 --tracepoint
</COMMAND_INPUT>
<COMMAND_RESULT>
0
@@ -254,7 +254,7 @@ kernel event sched_kthread_stop enabled in channel channel0
Scenario2
<COMMAND_INPUT>
-lttng enable-channel mychannel -u -s mysession --subbuf-size 16384 --num-subbuf 2 --switch-timer 200 --read-timer 100
+lttng enable-channel mychannel -u -s mysession --subbuf-size 16384 --num-subbuf 2 --switch-timer 200 --read-timer 100
</COMMAND_INPUT>
<COMMAND_RESULT>
0
@@ -293,7 +293,7 @@ Channels:
</COMMAND_OUTPUT>
<COMMAND_INPUT>
-lttng enable-event ust_tests_hello:tptest_sighandler,ust_tests_hello:tptest -u -s mysession --tracepoint
+lttng enable-event ust_tests_hello:tptest_sighandler,ust_tests_hello:tptest -u -s mysession --tracepoint
</COMMAND_INPUT>
<COMMAND_RESULT>
0
@@ -334,7 +334,7 @@ Channels:
</COMMAND_OUTPUT>
<COMMAND_INPUT>
-lttng disable-event ust_tests_hello:tptest -u -s mysession -c mychannel
+lttng disable-event ust_tests_hello:tptest -u -s mysession -c mychannel
</COMMAND_INPUT>
<COMMAND_RESULT>
0
@@ -344,7 +344,7 @@ kernel event ust_tests_hello:tptest in channel mychannel
</COMMAND_OUTPUT>
<COMMAND_INPUT>
-lttng enable-event ust_tests_hello:tptest -u -s mysession -c mychannel --tracepoint
+lttng enable-event ust_tests_hello:tptest -u -s mysession -c mychannel --tracepoint
</COMMAND_INPUT>
<COMMAND_RESULT>
0
@@ -359,7 +359,7 @@ kernel event ust_tests_hello:tptest enabled in channel mychannel
Scenario3
<COMMAND_INPUT>
-lttng enable-channel mychannel -k -s mysession --overwrite --subbuf-size 16384 --num-subbuf 4 --switch-timer 100 --read-timer 200
+lttng enable-channel mychannel -k -s mysession --overwrite --subbuf-size 16384 --num-subbuf 4 --switch-timer 100 --read-timer 200
</COMMAND_INPUT>
<COMMAND_RESULT>
0
@@ -398,7 +398,7 @@ Channels:
</COMMAND_OUTPUT>
<COMMAND_INPUT>
-lttng enable-channel mychannel2 -k -s mysession --subbuf-size 32768 --num-subbuf 2 --switch-timer 100 --read-timer 200
+lttng enable-channel mychannel2 -k -s mysession --subbuf-size 32768 --num-subbuf 2 --switch-timer 100 --read-timer 200
</COMMAND_INPUT>
<COMMAND_RESULT>
0
@@ -451,7 +451,7 @@ Channels:
<COMMAND_INPUT>
-lttng disable-channel mychannel,mychannel2 -k -s mysession
+lttng disable-channel mychannel,mychannel2 -k -s mysession
</COMMAND_INPUT>
<COMMAND_RESULT>
0
@@ -462,7 +462,7 @@ Kernel channel mychannel2 disabled for session mysession
</COMMAND_OUTPUT>
<COMMAND_INPUT>
-lttng enable-channel mychannel,mychannel2 -k -s mysession
+lttng enable-channel mychannel,mychannel2 -k -s mysession
</COMMAND_INPUT>
<COMMAND_RESULT>
0
@@ -473,7 +473,7 @@ Kernel channel mychannel2 enabled for session mysession
</COMMAND_OUTPUT>
<COMMAND_INPUT>
-lttng enable-event sched_kthread_stop,sched_kthread_stop_ret -k -s mysession --tracepoint
+lttng enable-event sched_kthread_stop,sched_kthread_stop_ret -k -s mysession --tracepoint
</COMMAND_INPUT>
<COMMAND_RESULT>
0
@@ -540,7 +540,7 @@ Channels:
</COMMAND_OUTPUT>
<COMMAND_INPUT>
-lttng enable-event sched_wakeup_new -k -s mysession --tracepoint
+lttng enable-event sched_wakeup_new -k -s mysession --tracepoint
</COMMAND_INPUT>
<COMMAND_RESULT>
0
@@ -607,7 +607,7 @@ Channels:
</COMMAND_OUTPUT>
<COMMAND_INPUT>
-lttng enable-event -a -k -s mysession -c mychannel2 --tracepoint
+lttng enable-event -a -k -s mysession -c mychannel2 --tracepoint
</COMMAND_INPUT>
<COMMAND_RESULT>
0
@@ -676,7 +676,7 @@ Channels:
</COMMAND_OUTPUT>
<COMMAND_INPUT>
-lttng enable-event -a -k -s mysession -c mychannel --syscall
+lttng enable-event -a -k -s mysession -c mychannel --syscall
</COMMAND_INPUT>
<COMMAND_RESULT>
0
@@ -745,7 +745,7 @@ Channels:
</COMMAND_OUTPUT>
<COMMAND_INPUT>
-lttng enable-event -a -k -s mysession --syscall
+lttng enable-event -a -k -s mysession --syscall
</COMMAND_INPUT>
<COMMAND_RESULT>
0
@@ -815,7 +815,7 @@ Channels:
</COMMAND_OUTPUT>
<COMMAND_INPUT>
-lttng enable-event -a -k -s mysession --syscall
+lttng enable-event -a -k -s mysession --syscall
</COMMAND_INPUT>
<COMMAND_RESULT>
0
@@ -885,7 +885,7 @@ Channels:
</COMMAND_OUTPUT>
<COMMAND_INPUT>
-lttng enable-event myevent1 -k -s mysession --probe 0xc0101280
+lttng enable-event myevent1 -k -s mysession --probe 0xc0101280
</COMMAND_INPUT>
<COMMAND_RESULT>
0
@@ -957,7 +957,7 @@ Channels:
</COMMAND_OUTPUT>
<COMMAND_INPUT>
-lttng enable-event myevent2 -k -s mysession -c channel0 --probe init_post
+lttng enable-event myevent2 -k -s mysession -c channel0 --probe init_post
</COMMAND_INPUT>
<COMMAND_RESULT>
0
@@ -1032,7 +1032,7 @@ Channels:
</COMMAND_OUTPUT>
<COMMAND_INPUT>
-lttng enable-event myevent3 -k -s mysession --probe init_post:0x1000
+lttng enable-event myevent3 -k -s mysession --probe init_post:0x1000
</COMMAND_INPUT>
<COMMAND_RESULT>
0
@@ -1110,7 +1110,7 @@ Channels:
</COMMAND_OUTPUT>
<COMMAND_INPUT>
-lttng enable-event myevent4 -k -s mysession --function create_dev
+lttng enable-event myevent4 -k -s mysession --function create_dev
</COMMAND_INPUT>
<COMMAND_RESULT>
0
@@ -1191,7 +1191,7 @@ Channels:
</COMMAND_OUTPUT>
<COMMAND_INPUT>
-lttng enable-event myevent5 -k -s mysession --function create_dev:0x2000
+lttng enable-event myevent5 -k -s mysession --function create_dev:0x2000
</COMMAND_INPUT>
<COMMAND_RESULT>
0
@@ -1275,7 +1275,7 @@ Channels:
</COMMAND_OUTPUT>
<COMMAND_INPUT>
-lttng enable-event myevent -k -s mysession -c mychannel --function create_dev:0x2000
+lttng enable-event myevent -k -s mysession -c mychannel --function create_dev:0x2000
</COMMAND_INPUT>
<COMMAND_RESULT>
0
@@ -1362,7 +1362,7 @@ Channels:
</COMMAND_OUTPUT>
<COMMAND_INPUT>
-lttng list
+lttng list
</COMMAND_INPUT>
<COMMAND_RESULT>
0
@@ -1487,7 +1487,7 @@ Channels:
</COMMAND_OUTPUT>
<COMMAND_INPUT>
-lttng add-context -h
+lttng add-context -h
</COMMAND_INPUT>
<COMMAND_RESULT>
0
@@ -1549,12 +1549,12 @@ 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 -k -t prio -t perf:branch-misses -t perf:cache-misses
</COMMAND_OUTPUT>
<COMMAND_INPUT>
-lttng add-context -s mysession -k -t prio -t perf:branch-misses -t perf:cache-misses
+lttng add-context -s mysession -k -t prio -t perf:branch-misses -t perf:cache-misses
</COMMAND_INPUT>
<COMMAND_RESULT>
0
@@ -1643,7 +1643,7 @@ Channels:
</COMMAND_OUTPUT>
<COMMAND_INPUT>
-lttng add-context -h
+lttng add-context -h
</COMMAND_INPUT>
<COMMAND_RESULT>
0
@@ -1705,12 +1705,12 @@ 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 -k -t prio -t perf:branch-misses -t perf:cache-misses
</COMMAND_OUTPUT>
<COMMAND_INPUT>
-lttng add-context -s mysession -c mychannel -k -t prio -t perf:branch-misses -t perf:cache-misses
+lttng add-context -s mysession -c mychannel -k -t prio -t perf:branch-misses -t perf:cache-misses
</COMMAND_INPUT>
<COMMAND_RESULT>
0
@@ -1799,7 +1799,7 @@ Channels:
</COMMAND_OUTPUT>
<COMMAND_INPUT>
-lttng add-context -h
+lttng add-context -h
</COMMAND_INPUT>
<COMMAND_RESULT>
0
@@ -1861,12 +1861,12 @@ 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 -k -t prio -t perf:branch-misses -t perf:cache-misses
</COMMAND_OUTPUT>
<COMMAND_INPUT>
-lttng add-context -s mysession -c channel0 -e sched_kthread_stop_ret -k -t prio -t perf:branch-misses -t perf:cache-misses
+lttng add-context -s mysession -c channel0 -e sched_kthread_stop_ret -k -t prio -t perf:branch-misses -t perf:cache-misses
</COMMAND_INPUT>
<COMMAND_RESULT>
0
@@ -1955,7 +1955,7 @@ Channels:
</COMMAND_OUTPUT>
<COMMAND_INPUT>
-lttng calibrate -k --function
+lttng calibrate -k --function
</COMMAND_INPUT>
<COMMAND_RESULT>
0
@@ -1970,7 +1970,7 @@ Kernel calibration done
Scenario4
<COMMAND_INPUT>
-lttng enable-channel mychannel -u -s mysession --overwrite --subbuf-size 16384 --num-subbuf 4 --switch-timer 100 --read-timer 200
+lttng enable-channel mychannel -u -s mysession --overwrite --subbuf-size 16384 --num-subbuf 4 --switch-timer 100 --read-timer 200
</COMMAND_INPUT>
<COMMAND_RESULT>
0
@@ -2009,7 +2009,7 @@ Channels:
</COMMAND_OUTPUT>
<COMMAND_INPUT>
-lttng enable-channel mychannel2 -u -s mysession --subbuf-size 32768 --num-subbuf 2 --switch-timer 100 --read-timer 200
+lttng enable-channel mychannel2 -u -s mysession --subbuf-size 32768 --num-subbuf 2 --switch-timer 100 --read-timer 200
</COMMAND_INPUT>
<COMMAND_RESULT>
0
@@ -2061,7 +2061,7 @@ Channels:
</COMMAND_OUTPUT>
<COMMAND_INPUT>
-lttng enable-event ust_tests_hello:tptest_sighandler -u -s mysession --tracepoint
+lttng enable-event ust_tests_hello:tptest_sighandler -u -s mysession --tracepoint
</COMMAND_INPUT>
<COMMAND_RESULT>
0
@@ -2126,7 +2126,7 @@ Channels:
</COMMAND_OUTPUT>
<COMMAND_INPUT>
-lttng enable-event ust_tests_hello:tptest -u -s mysession --tracepoint
+lttng enable-event ust_tests_hello:tptest -u -s mysession --tracepoint
</COMMAND_INPUT>
<COMMAND_RESULT>
0
@@ -2192,7 +2192,7 @@ Channels:
</COMMAND_OUTPUT>
<COMMAND_INPUT>
-lttng enable-event -a -u -s mysession -c mychannel2 --tracepoint
+lttng enable-event -a -u -s mysession -c mychannel2 --tracepoint
</COMMAND_INPUT>
<COMMAND_RESULT>
0
@@ -2258,7 +2258,7 @@ Channels:
</COMMAND_OUTPUT>
<COMMAND_INPUT>
-lttng enable-event "ust*" -u -s mysession -c mychannel --tracepoint
+lttng enable-event ust* -u -s mysession -c mychannel --tracepoint
</COMMAND_INPUT>
<COMMAND_RESULT>
0
@@ -2324,7 +2324,7 @@ Channels:
</COMMAND_OUTPUT>
<COMMAND_INPUT>
-lttng enable-event "ust*" -u -s mysession --tracepoint
+lttng enable-event ust* -u -s mysession --tracepoint
</COMMAND_INPUT>
<COMMAND_RESULT>
0
@@ -2391,7 +2391,7 @@ Channels:
</COMMAND_OUTPUT>
<COMMAND_INPUT>
-lttng enable-event "u*" -u -s mysession --tracepoint
+lttng enable-event "u*" -u -s mysession --tracepoint
</COMMAND_INPUT>
<COMMAND_RESULT>
0
@@ -2460,7 +2460,7 @@ Channels:
<COMMAND_INPUT>
-lttng enable-event myevent1 -u -s mysession --loglevel TRACE_WARNING
+lttng enable-event myevent1 -u -s mysession --loglevel TRACE_WARNING
</COMMAND_INPUT>
<COMMAND_RESULT>
0
@@ -2529,7 +2529,7 @@ Channels:
</COMMAND_OUTPUT>
<COMMAND_INPUT>
-lttng enable-event myevent2 -u -s mysession --loglevel-only TRACE_DEBUG_FUNCTION
+lttng enable-event myevent2 -u -s mysession --loglevel-only TRACE_DEBUG_FUNCTION
</COMMAND_INPUT>
<COMMAND_RESULT>
0
@@ -2599,7 +2599,7 @@ Channels:
</COMMAND_OUTPUT>
<COMMAND_INPUT>
-lttng enable-event myevent0 -u -s mysession -c mychannel --loglevel-only TRACE_DEBUG_FUNCTION
+lttng enable-event myevent0 -u -s mysession -c mychannel --loglevel-only TRACE_DEBUG_FUNCTION
</COMMAND_INPUT>
<COMMAND_RESULT>
0
diff --git a/lttng/org.eclipse.linuxtools.lttng2.control.ui.tests/testfiles/CreateTreeTest2.cfg b/lttng/org.eclipse.linuxtools.lttng2.control.ui.tests/testfiles/CreateTreeTest2.cfg
index 929dc44a25..b7b88bce57 100644
--- a/lttng/org.eclipse.linuxtools.lttng2.control.ui.tests/testfiles/CreateTreeTest2.cfg
+++ b/lttng/org.eclipse.linuxtools.lttng2.control.ui.tests/testfiles/CreateTreeTest2.cfg
@@ -15,7 +15,7 @@
<SCENARIO>
Initialize
<COMMAND_INPUT>
-lttng version
+lttng version
</COMMAND_INPUT>
<COMMAND_RESULT>
0
@@ -28,7 +28,7 @@ lttng is free software and under the GPL license and part LGPL
</COMMAND_OUTPUT>
<COMMAND_INPUT>
-lttng list
+lttng list
</COMMAND_INPUT>
<COMMAND_RESULT>
0
@@ -53,7 +53,7 @@ Kernel events
</COMMAND_OUTPUT>
<COMMAND_INPUT>
-lttng list -u -f
+lttng list -u -f
</COMMAND_INPUT>
<COMMAND_RESULT>
0
@@ -112,7 +112,7 @@ Session my destroyed.
</COMMAND_OUTPUT>
<COMMAND_INPUT>
-lttng enable-channel mychannel -u -s mysession --buffers-uid
+lttng enable-channel mychannel -u -s mysession --buffers-uid
</COMMAND_INPUT>
<COMMAND_RESULT>
0
@@ -193,7 +193,7 @@ Session mysession destroyed.
</COMMAND_OUTPUT>
<COMMAND_INPUT>
-lttng enable-channel mychannel -u -s mysession --buffers-pid
+lttng enable-channel mychannel -u -s mysession --buffers-pid
</COMMAND_INPUT>
<COMMAND_RESULT>
0
@@ -274,7 +274,7 @@ Session mysession destroyed.
</COMMAND_OUTPUT>
<COMMAND_INPUT>
-lttng enable-channel mychannel -u -s mysession -C 1024 -W 10
+lttng enable-channel mychannel -u -s mysession -C 1024 -W 10
</COMMAND_INPUT>
<COMMAND_RESULT>
0
diff --git a/lttng/org.eclipse.linuxtools.lttng2.control.ui.tests/testfiles/LTTngServiceMiTest.cfg b/lttng/org.eclipse.linuxtools.lttng2.control.ui.tests/testfiles/LTTngServiceMiTest.cfg
index f0dc0dea36..0b32f13d58 100644
--- a/lttng/org.eclipse.linuxtools.lttng2.control.ui.tests/testfiles/LTTngServiceMiTest.cfg
+++ b/lttng/org.eclipse.linuxtools.lttng2.control.ui.tests/testfiles/LTTngServiceMiTest.cfg
@@ -15,7 +15,7 @@
<SCENARIO>
LttngNotInstalled
<COMMAND_INPUT>
-lttng --mi xml list
+lttng --mi xml list
</COMMAND_INPUT>
<COMMAND_RESULT>
1
@@ -33,7 +33,7 @@ Command not found
<SCENARIO>
LttngVersion
<COMMAND_INPUT>
-lttng version
+lttng version
</COMMAND_INPUT>
<COMMAND_RESULT>
0
@@ -53,7 +53,7 @@ lttng is free software and under the GPL license and part LGPL
<SCENARIO>
LttngVersionWithPrompt
<COMMAND_INPUT>
-lttng version
+lttng version
</COMMAND_INPUT>
<COMMAND_RESULT>
0
@@ -72,7 +72,7 @@ lttng is free software and under the GPL license and part LGPL
<SCENARIO>
LttngUnsupportedVersion
<COMMAND_INPUT>
-lttng version
+lttng version
</COMMAND_INPUT>
<COMMAND_RESULT>
0
@@ -92,7 +92,7 @@ lttng is free software and under the GPL license and part LGPL
<SCENARIO>
LttngNoVersion
<COMMAND_INPUT>
-lttng version
+lttng version
</COMMAND_INPUT>
<COMMAND_RESULT>
0
@@ -110,7 +110,7 @@ lttng is free software and under the GPL license and part LGPL
<SCENARIO>
NoSessionAvailable
<COMMAND_INPUT>
-lttng --mi xml list
+lttng --mi xml list
</COMMAND_INPUT>
<COMMAND_RESULT>
0
@@ -127,7 +127,7 @@ lttng --mi xml list
<SCENARIO>
GetSessionNames1
<COMMAND_INPUT>
-lttng --mi xml list
+lttng --mi xml list
</COMMAND_INPUT>
<COMMAND_RESULT>
0
@@ -185,7 +185,7 @@ Error: Command error
<SCENARIO>
GetSessionNameNotExistVerbose
<COMMAND_INPUT>
-lttng --mi xml -vvv list test
+lttng --mi xml -vvv list test
</COMMAND_INPUT>
<COMMAND_RESULT>
1
@@ -206,7 +206,7 @@ Error: Command error
<SCENARIO>
GetSessionGarbageOut
<COMMAND_INPUT>
-lttng --mi xml list
+lttng --mi xml list
</COMMAND_INPUT>
<COMMAND_RESULT>
0
@@ -486,7 +486,7 @@ Error: Unable to list kernel events
<SCENARIO>
GetUstProvider1
<COMMAND_INPUT>
-lttng --mi xml list -u -f
+lttng --mi xml list -u -f
</COMMAND_INPUT>
<COMMAND_RESULT>
0
@@ -599,7 +599,7 @@ lttng --mi xml list -u -f
<SCENARIO>
GetUstProvider2
<COMMAND_INPUT>
-lttng --mi xml list -u -f
+lttng --mi xml list -u -f
</COMMAND_INPUT>
<COMMAND_RESULT>
0
@@ -627,7 +627,7 @@ lttng --mi xml list -u -f
<SCENARIO>
ListWithNoUst1
<COMMAND_INPUT>
-lttng --mi xml list -u -f
+lttng --mi xml list -u -f
</COMMAND_INPUT>
<COMMAND_RESULT>
1
@@ -647,7 +647,7 @@ Error: Command error
<SCENARIO>
ListWithNoUst2
<COMMAND_INPUT>
-lttng --mi xml list -u -f
+lttng --mi xml list -u -f
</COMMAND_INPUT>
<COMMAND_RESULT>
1
@@ -667,7 +667,7 @@ Error: Command error
<SCENARIO>
ListWithNoUst3
<COMMAND_INPUT>
-lttng --mi xml list -u -f
+lttng --mi xml list -u -f
</COMMAND_INPUT>
<COMMAND_RESULT>
1
@@ -688,7 +688,7 @@ Error: Command Error
<SCENARIO>
GetUstProvider3
<COMMAND_INPUT>
-lttng --mi xml list -u -f
+lttng --mi xml list -u -f
</COMMAND_INPUT>
<COMMAND_RESULT>
0
@@ -866,7 +866,7 @@ Error: Session name already exists
</COMMAND_OUTPUT>
<COMMAND_INPUT>
-lttng --mi xml create "session with spaces"
+lttng --mi xml create session with spaces
</COMMAND_INPUT>
<COMMAND_RESULT>
0
@@ -935,7 +935,7 @@ lttng --mi xml create wrongPath -o /home/user/hallo
</COMMAND_OUTPUT>
<COMMAND_INPUT>
-lttng --mi xml create pathWithSpaces -o "/home/user/hallo user/here"
+lttng --mi xml create pathWithSpaces -o /home/user/hallo user/here
</COMMAND_INPUT>
<COMMAND_RESULT>
0
@@ -997,7 +997,7 @@ lttng --mi xml destroy mysession2
<SCENARIO>
ChannelHandling
<COMMAND_INPUT>
-lttng --mi xml enable-channel mychannel0,mychannel1 -k -s mysession2 --overwrite --subbuf-size 16384 --num-subbuf 2 --switch-timer 200 --read-timer 100 -C 0 -W 10
+lttng --mi xml enable-channel mychannel0,mychannel1 -k -s mysession2 --overwrite --subbuf-size 16384 --num-subbuf 2 --switch-timer 200 --read-timer 100 -C 0 -W 10
</COMMAND_INPUT>
<COMMAND_RESULT>
0
@@ -1008,7 +1008,7 @@ Kernel channel mychannel1 enabled for session mysession2
</COMMAND_OUTPUT>
<COMMAND_INPUT>
-lttng --mi xml enable-channel mychannel0,mychannel1 -k -s mysession2 --overwrite --subbuf-size 16384 --num-subbuf 2 --switch-timer 200 --read-timer 100
+lttng --mi xml enable-channel mychannel0,mychannel1 -k -s mysession2 --overwrite --subbuf-size 16384 --num-subbuf 2 --switch-timer 200 --read-timer 100
</COMMAND_INPUT>
<COMMAND_RESULT>
0
@@ -1058,7 +1058,7 @@ lttng --mi xml enable-channel mychannel0,mychannel1 -k -s mysession2 --overwrit
</COMMAND_OUTPUT>
<COMMAND_INPUT>
-lttng --mi xml enable-channel ustChannel -u -s mysession2 --overwrite --subbuf-size 32768 --num-subbuf 1 --switch-timer 100 --read-timer 200 -C 0 -W 20
+lttng --mi xml enable-channel ustChannel -u -s mysession2 --overwrite --subbuf-size 32768 --num-subbuf 1 --switch-timer 100 --read-timer 200 -C 0 -W 20
</COMMAND_INPUT>
<COMMAND_RESULT>
0
@@ -1068,7 +1068,7 @@ UST channel channel0 enabled for session mysession2
</COMMAND_OUTPUT>
<COMMAND_INPUT>
-lttng --mi xml enable-channel ustChannel -u -s mysession2 --overwrite --subbuf-size 32768 --num-subbuf 1 --switch-timer 100 --read-timer 200
+lttng --mi xml enable-channel ustChannel -u -s mysession2 --overwrite --subbuf-size 32768 --num-subbuf 1 --switch-timer 100 --read-timer 200
</COMMAND_INPUT>
<COMMAND_RESULT>
0
@@ -1102,7 +1102,7 @@ lttng --mi xml enable-channel ustChannel -u -s mysession2 --overwrite --subbuf
</COMMAND_OUTPUT>
<COMMAND_INPUT>
-lttng --mi xml enable-channel ustChannel -u -s mysession2 --overwrite --subbuf-size 32768 --num-subbuf 1 --switch-timer 100 --read-timer 200 --buffers-uid -C 0 -W 20
+lttng --mi xml enable-channel ustChannel -u -s mysession2 --overwrite --subbuf-size 32768 --num-subbuf 1 --switch-timer 100 --read-timer 200 --buffers-uid -C 0 -W 20
</COMMAND_INPUT>
<COMMAND_RESULT>
0
@@ -1112,7 +1112,7 @@ UST channel channel0 enabled for session mysession2
</COMMAND_OUTPUT>
<COMMAND_INPUT>
-lttng --mi xml enable-channel ustChannel -u -s mysession2 --overwrite --buffers-pid
+lttng --mi xml enable-channel ustChannel -u -s mysession2 --overwrite --buffers-pid
</COMMAND_INPUT>
<COMMAND_RESULT>
0
@@ -1146,7 +1146,7 @@ lttng --mi xml enable-channel ustChannel -u -s mysession2 --overwrite --buffer
</COMMAND_OUTPUT>
<COMMAND_INPUT>
-lttng --mi xml enable-channel ustChannel -u -s mysession2 --overwrite --subbuf-size 32768 --num-subbuf 2 --switch-timer 100 --read-timer 200 --buffers-uid
+lttng --mi xml enable-channel ustChannel -u -s mysession2 --overwrite --subbuf-size 32768 --num-subbuf 2 --switch-timer 100 --read-timer 200 --buffers-uid
</COMMAND_INPUT>
<COMMAND_RESULT>
0
@@ -1181,7 +1181,7 @@ lttng --mi xml enable-channel ustChannel -u -s mysession2 --overwrite --subbuf
<COMMAND_INPUT>
-lttng --mi xml enable-channel mychannel0,mychannel1 -k -s mysession2
+lttng --mi xml enable-channel mychannel0,mychannel1 -k -s mysession2
</COMMAND_INPUT>
<COMMAND_RESULT>
0
@@ -1231,7 +1231,7 @@ lttng --mi xml enable-channel mychannel0,mychannel1 -k -s mysession2
</COMMAND_OUTPUT>
<COMMAND_INPUT>
-lttng --mi xml enable-channel ustChannel -u -s mysession2
+lttng --mi xml enable-channel ustChannel -u -s mysession2
</COMMAND_INPUT>
<COMMAND_RESULT>
0
@@ -1265,7 +1265,7 @@ lttng --mi xml enable-channel ustChannel -u -s mysession2
</COMMAND_OUTPUT>
<COMMAND_INPUT>
-lttng --mi xml disable-channel mychannel0,mychannel1 -k -s mysession2
+lttng --mi xml disable-channel mychannel0,mychannel1 -k -s mysession2
</COMMAND_INPUT>
<COMMAND_RESULT>
0
@@ -1293,7 +1293,7 @@ lttng --mi xml disable-channel mychannel0,mychannel1 -k -s mysession2
</COMMAND_OUTPUT>
<COMMAND_INPUT>
-lttng --mi xml disable-channel ustChannel -u -s mysession2
+lttng --mi xml disable-channel ustChannel -u -s mysession2
</COMMAND_INPUT>
<COMMAND_RESULT>
0
@@ -1326,7 +1326,7 @@ EventHandling
# Tracepoint test cases
<COMMAND_INPUT>
-lttng --mi xml enable-event block_rq_remap,block_bio_remap,softirq_entry -k -s mysession2 --tracepoint
+lttng --mi xml enable-event block_rq_remap,block_bio_remap,softirq_entry -k -s mysession2 --tracepoint
</COMMAND_INPUT>
<COMMAND_RESULT>
0
@@ -1374,7 +1374,7 @@ lttng --mi xml enable-event block_rq_remap,block_bio_remap,softirq_entry -k -s
</COMMAND_OUTPUT>
<COMMAND_INPUT>
-lttng --mi xml enable-event -a -k -s mysession2 -c mychannel --tracepoint
+lttng --mi xml enable-event -a -k -s mysession2 -c mychannel --tracepoint
</COMMAND_INPUT>
<COMMAND_RESULT>
0
@@ -1402,7 +1402,7 @@ lttng --mi xml enable-event -a -k -s mysession2 -c mychannel --tracepoint
</COMMAND_OUTPUT>
<COMMAND_INPUT>
-lttng --mi xml enable-event ust_tests_hello:tptest_sighandler -u -s mysession2 -c mychannel --tracepoint
+lttng --mi xml enable-event ust_tests_hello:tptest_sighandler -u -s mysession2 -c mychannel --tracepoint
</COMMAND_INPUT>
<COMMAND_RESULT>
0
@@ -1428,7 +1428,7 @@ lttng --mi xml enable-event ust_tests_hello:tptest_sighandler -u -s mysession2
</COMMAND_OUTPUT>
<COMMAND_INPUT>
-lttng --mi xml enable-event ust_tests_hello:tptest_sighandler -u -s mysession2 -c mychannel --tracepoint --filter 'intfield==10'
+lttng --mi xml enable-event ust_tests_hello:tptest_sighandler -u -s mysession2 -c mychannel --tracepoint --filter intfield==10
</COMMAND_INPUT>
<COMMAND_RESULT>
0
@@ -1454,7 +1454,7 @@ lttng --mi xml enable-event ust_tests_hello:tptest_sighandler -u -s mysession2
</COMMAND_OUTPUT>
<COMMAND_INPUT>
-lttng --mi xml enable-event -a -u -s mysession2 -c mychannel --tracepoint
+lttng --mi xml enable-event -a -u -s mysession2 -c mychannel --tracepoint
</COMMAND_INPUT>
<COMMAND_RESULT>
0
@@ -1482,7 +1482,7 @@ lttng --mi xml enable-event -a -u -s mysession2 -c mychannel --tracepoint
# Syscall test cases
<COMMAND_INPUT>
-lttng --mi xml enable-event -a -k -s mysession2 --syscall
+lttng --mi xml enable-event -a -k -s mysession2 --syscall
</COMMAND_INPUT>
<COMMAND_RESULT>
0
@@ -1507,7 +1507,7 @@ lttng --mi xml enable-event -a -k -s mysession2 --syscall
</COMMAND_OUTPUT>
<COMMAND_INPUT>
-lttng --mi xml enable-event -a -k -s mysession2 -c mychannel --syscall
+lttng --mi xml enable-event -a -k -s mysession2 -c mychannel --syscall
</COMMAND_INPUT>
<COMMAND_RESULT>
0
@@ -1534,7 +1534,7 @@ lttng --mi xml enable-event -a -k -s mysession2 -c mychannel --syscall
# dynamic probe/function probe test cases
<COMMAND_INPUT>
-lttng --mi xml enable-event myevent0 -k -s mysession2 --function 0xc0101340
+lttng --mi xml enable-event myevent0 -k -s mysession2 --function 0xc0101340
</COMMAND_INPUT>
<COMMAND_RESULT>
0
@@ -1559,7 +1559,7 @@ lttng --mi xml enable-event myevent0 -k -s mysession2 --function 0xc0101340
</COMMAND_OUTPUT>
<COMMAND_INPUT>
-lttng --mi xml enable-event myevent1 -k -s mysession2 -c mychannel --probe init_post
+lttng --mi xml enable-event myevent1 -k -s mysession2 -c mychannel --probe init_post
</COMMAND_INPUT>
<COMMAND_RESULT>
0
@@ -1589,7 +1589,7 @@ lttng --mi xml enable-event myevent1 -k -s mysession2 -c mychannel --probe init
# log level test cases
<COMMAND_INPUT>
-lttng --mi xml enable-event myevent4 -u -s mysession2 --loglevel-only TRACE_DEBUG
+lttng --mi xml enable-event myevent4 -u -s mysession2 --loglevel-only TRACE_DEBUG
</COMMAND_INPUT>
<COMMAND_RESULT>
0
@@ -1617,7 +1617,7 @@ lttng --mi xml enable-event myevent4 -u -s mysession2 --loglevel-only TRACE_DEB
</COMMAND_OUTPUT>
<COMMAND_INPUT>
-lttng --mi xml enable-event myevent5 -u -s mysession2 -c mychannel --loglevel TRACE_DEBUG_FUNCTION
+lttng --mi xml enable-event myevent5 -u -s mysession2 -c mychannel --loglevel TRACE_DEBUG_FUNCTION
</COMMAND_INPUT>
<COMMAND_RESULT>
0
@@ -1647,14 +1647,14 @@ lttng --mi xml enable-event myevent5 -u -s mysession2 -c mychannel --loglevel T
</SCENARIO>
####################################################################
-# Scenario: Test "lttng add-context -h" and lttng --mi xml add-context ..." with different inputs
+# Scenario: Test "lttng add-context -h" and lttng --mi xml add-context ..." with different inputs
####################################################################
<SCENARIO>
ContextHandling
<COMMAND_INPUT>
-lttng --mi xml add-context -h
+lttng --mi xml add-context -h
</COMMAND_INPUT>
<COMMAND_RESULT>
0
@@ -1696,7 +1696,7 @@ in the trace data output:
</COMMAND_OUTPUT>
<COMMAND_INPUT>
-lttng --mi xml add-context -s mysession2 -c mychannel -e ust_tests_hello:tptest_sighandler -u -t prio -t pid
+lttng --mi xml add-context -s mysession2 -c mychannel -e ust_tests_hello:tptest_sighandler -u -t prio -t pid
</COMMAND_INPUT>
<COMMAND_RESULT>
0
@@ -1711,7 +1711,7 @@ UST context pid added to event sched_kthread_stop_ret channel mychannel
ContextErrorHandling
<COMMAND_INPUT>
-lttng --mi xml add-context -h
+lttng --mi xml add-context -h
</COMMAND_INPUT>
<COMMAND_RESULT>
1
@@ -1743,12 +1743,12 @@ 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 -k -t prio -t perf:branch-misses -t perf:cache-misses
</COMMAND_OUTPUT>
<COMMAND_INPUT>
-lttng --mi xml add-context -s mysession2 -c mychannel -e ust_tests_hello:tptest_sighandler -u -t prio -t pid
+lttng --mi xml add-context -s mysession2 -c mychannel -e ust_tests_hello:tptest_sighandler -u -t prio -t pid
</COMMAND_INPUT>
<COMMAND_RESULT>
1
@@ -1763,7 +1763,7 @@ UST context pid added to event sched_kthread_stop_ret channel mychannel
<SCENARIO>
CalibrateHandling
<COMMAND_INPUT>
-lttng --mi xml calibrate -k --function
+lttng --mi xml calibrate -k --function
</COMMAND_INPUT>
<COMMAND_RESULT>
0
@@ -1782,10 +1782,10 @@ lttng --mi xml calibrate -k --function
</COMMAND_OUTPUT>
<COMMAND_INPUT>
-lttng --mi xml calibrate -u --function
+lttng --mi xml calibrate -u --function
</COMMAND_INPUT>
<COMMAND_RESULT>
-0
+1
</COMMAND_RESULT>
<COMMAND_OUTPUT>
<?xml version="1.0" encoding="UTF-8"?>
@@ -1926,7 +1926,7 @@ lttng --mi xml destroy mysession
</COMMAND_OUTPUT>
<COMMAND_INPUT>
-lttng --mi xml -vvv create mysession -U net://172.0.0.1
+lttng --mi xml -vvv create mysession -U net://172.0.0.1
</COMMAND_INPUT>
<COMMAND_RESULT>
0
@@ -1949,7 +1949,7 @@ DEBUG1: Init config session in /home/bernd [in config_init() at conf.c:294]
<SCENARIO>
CreateSessionSnapshot
<COMMAND_INPUT>
-lttng --mi xml create mysession --snapshot
+lttng --mi xml create mysession --snapshot
</COMMAND_INPUT>
<COMMAND_RESULT>
0
@@ -1972,7 +1972,7 @@ lttng --mi xml create mysession --snapshot
</COMMAND_OUTPUT>
#------------------------------------------------------------------------------
<COMMAND_INPUT>
-lttng --mi xml snapshot list-output -s mysession
+lttng --mi xml snapshot list-output -s mysession
</COMMAND_INPUT>
<COMMAND_RESULT>
0
@@ -2005,7 +2005,7 @@ lttng --mi xml snapshot list-output -s mysession
</COMMAND_OUTPUT>
#------------------------------------------------------------------------------
<COMMAND_INPUT>
-lttng --mi xml list
+lttng --mi xml list
</COMMAND_INPUT>
<COMMAND_RESULT>
0
@@ -2029,7 +2029,7 @@ lttng --mi xml list
</COMMAND_OUTPUT>
#------------------------------------------------------------------------------
<COMMAND_INPUT>
-lttng --mi xml snapshot record -s mysession
+lttng --mi xml snapshot record -s mysession
</COMMAND_INPUT>
<COMMAND_RESULT>
0
@@ -2082,7 +2082,7 @@ Snapshot mode set. Every channel enabled for that session will be set in overwri
</COMMAND_OUTPUT>
#------------------------------------------------------------------------------
<COMMAND_INPUT>
-lttng --mi xml snapshot list-output -s mysession
+lttng --mi xml snapshot list-output -s mysession
</COMMAND_INPUT>
<COMMAND_RESULT>
0
@@ -2093,7 +2093,7 @@ Snapshot output list for session mysession
</COMMAND_OUTPUT>
#------------------------------------------------------------------------------
<COMMAND_INPUT>
-lttng --mi xml list
+lttng --mi xml list
</COMMAND_INPUT>
<COMMAND_RESULT>
0
@@ -2104,7 +2104,7 @@ lttng --mi xml list
</COMMAND_OUTPUT>
#------------------------------------------------------------------------------
<COMMAND_INPUT>
-lttng --mi xml snapshot record -s mysession
+lttng --mi xml snapshot record -s mysession
</COMMAND_INPUT>
<COMMAND_RESULT>
0
@@ -2145,7 +2145,7 @@ lttng --mi xml destroy mysession
<SCENARIO>
CreateSessionSnapshotErrors
<COMMAND_INPUT>
-lttng --mi xml snapshot list-output -s blabla
+lttng --mi xml snapshot list-output -s blabla
</COMMAND_INPUT>
<COMMAND_RESULT>
1
@@ -2168,7 +2168,7 @@ lttng --mi xml snapshot list-output -s blabla
#------------------------------------------------------------------------------
#next is not an error case but good to be tested
<COMMAND_INPUT>
-lttng --mi xml list
+lttng --mi xml list
</COMMAND_INPUT>
<COMMAND_RESULT>
0
@@ -2192,7 +2192,7 @@ lttng --mi xml list
</COMMAND_OUTPUT>
#------------------------------------------------------------------------------
<COMMAND_INPUT>
-lttng --mi xml snapshot record -s blabla
+lttng --mi xml snapshot record -s blabla
</COMMAND_INPUT>
<COMMAND_RESULT>
1
@@ -2215,7 +2215,7 @@ lttng --mi xml snapshot record -s blabla
</COMMAND_OUTPUT>
#------------------------------------------------------------------------------
<COMMAND_INPUT>
-lttng --mi xml snapshot record -s mysession
+lttng --mi xml snapshot record -s mysession
</COMMAND_INPUT>
<COMMAND_RESULT>
1
@@ -2245,7 +2245,7 @@ lttng --mi xml snapshot record -s mysession
<SCENARIO>
CreateSessionLive
<COMMAND_INPUT>
-lttng --mi xml create mysession --live -U net://127.0.0.1
+lttng --mi xml create mysession --live -U net://127.0.0.1
</COMMAND_INPUT>
<COMMAND_RESULT>
0
@@ -2268,7 +2268,7 @@ lttng --mi xml create mysession --live -U net://127.0.0.1
</COMMAND_OUTPUT>
#------------------------------------------------------------------------------
<COMMAND_INPUT>
-lttng --mi xml list
+lttng --mi xml list
</COMMAND_INPUT>
<COMMAND_RESULT>
0
diff --git a/lttng/org.eclipse.linuxtools.lttng2.control.ui.tests/testfiles/LTTngServiceTest.cfg b/lttng/org.eclipse.linuxtools.lttng2.control.ui.tests/testfiles/LTTngServiceTest.cfg
index 5c7dc89b4f..146aa09e82 100644
--- a/lttng/org.eclipse.linuxtools.lttng2.control.ui.tests/testfiles/LTTngServiceTest.cfg
+++ b/lttng/org.eclipse.linuxtools.lttng2.control.ui.tests/testfiles/LTTngServiceTest.cfg
@@ -15,7 +15,7 @@
<SCENARIO>
LttngNotInstalled
<COMMAND_INPUT>
-lttng list
+lttng list
</COMMAND_INPUT>
<COMMAND_RESULT>
1
@@ -33,7 +33,7 @@ Command not found
<SCENARIO>
LttngVersion
<COMMAND_INPUT>
-lttng version
+lttng version
</COMMAND_INPUT>
<COMMAND_RESULT>
0
@@ -53,7 +53,7 @@ lttng is free software and under the GPL license and part LGPL
<SCENARIO>
LttngVersionWithPrompt
<COMMAND_INPUT>
-lttng version
+lttng version
</COMMAND_INPUT>
<COMMAND_RESULT>
0
@@ -72,7 +72,7 @@ lttng is free software and under the GPL license and part LGPL
<SCENARIO>
LttngUnsupportedVersion
<COMMAND_INPUT>
-lttng version
+lttng version
</COMMAND_INPUT>
<COMMAND_RESULT>
0
@@ -92,7 +92,7 @@ lttng is free software and under the GPL license and part LGPL
<SCENARIO>
LttngNoVersion
<COMMAND_INPUT>
-lttng version
+lttng version
</COMMAND_INPUT>
<COMMAND_RESULT>
0
@@ -110,7 +110,7 @@ lttng is free software and under the GPL license and part LGPL
<SCENARIO>
NoSessionAvailable
<COMMAND_INPUT>
-lttng list
+lttng list
</COMMAND_INPUT>
<COMMAND_RESULT>
0
@@ -126,7 +126,7 @@ Currently no available tracing session
<SCENARIO>
GetSessionNames1
<COMMAND_INPUT>
-lttng list
+lttng list
</COMMAND_INPUT>
<COMMAND_RESULT>
0
@@ -165,7 +165,7 @@ Error: Session name not found
<SCENARIO>
GetSessionNameNotExistVerbose
<COMMAND_INPUT>
-lttng -vvv list test
+lttng -vvv list test
</COMMAND_INPUT>
<COMMAND_RESULT>
1
@@ -187,7 +187,7 @@ DEBUG1: Clean exit [in clean_exit() at lttng.c:165]
<SCENARIO>
GetSessionGarbageOut
<COMMAND_INPUT>
-lttng list
+lttng list
</COMMAND_INPUT>
<COMMAND_RESULT>
0
@@ -355,7 +355,7 @@ Error: Unable to list kernel events
<SCENARIO>
ListWithNoKernelVerbose
<COMMAND_INPUT>
-lttng -vvv list -k
+lttng -vvv list -k
</COMMAND_INPUT>
<COMMAND_RESULT>
1
@@ -440,7 +440,7 @@ Segmentation Fault
<SCENARIO>
ListWithNoUst2
<COMMAND_INPUT>
-lttng list -u -f
+lttng list -u -f
</COMMAND_INPUT>
<COMMAND_RESULT>
1
@@ -460,7 +460,7 @@ Error: Command Error
<SCENARIO>
ListWithNoUst3
<COMMAND_INPUT>
-lttng list -u -f
+lttng list -u -f
</COMMAND_INPUT>
<COMMAND_RESULT>
1
@@ -479,7 +479,7 @@ Error: Command Error
<SCENARIO>
ListWithNoUstVerbose
<COMMAND_INPUT>
-lttng -vvv list -u -f
+lttng -vvv list -u -f
</COMMAND_INPUT>
<COMMAND_RESULT>
1
@@ -503,7 +503,7 @@ DEBUG1: Clean exit [in clean_exit() at lttng.c:165]
<SCENARIO>
GetUstProvider3
<COMMAND_INPUT>
-lttng list -u -f
+lttng list -u -f
</COMMAND_INPUT>
<COMMAND_RESULT>
0
@@ -583,7 +583,7 @@ Error: Session name already exist
</COMMAND_OUTPUT>
<COMMAND_INPUT>
-lttng create "session with spaces"
+lttng create session with spaces
</COMMAND_INPUT>
<COMMAND_RESULT>
0
@@ -616,7 +616,7 @@ Traces will be written in /home/user/lttng-traces/wrongPath-20120209-095418
</COMMAND_OUTPUT>
<COMMAND_INPUT>
-lttng create pathWithSpaces -o "/home/user/hallo user/here"
+lttng create pathWithSpaces -o /home/user/hallo user/here
</COMMAND_INPUT>
<COMMAND_RESULT>
0
@@ -651,7 +651,7 @@ Session mysession2 destroyed.
<SCENARIO>
DestroySessionVerbose
<COMMAND_INPUT>
-lttng -vvv destroy mysession2
+lttng -vvv destroy mysession2
</COMMAND_INPUT>
<COMMAND_RESULT>
0
@@ -671,7 +671,7 @@ Session mysession2 destroyed at /home/eedbhu
<SCENARIO>
ChannelHandling
<COMMAND_INPUT>
-lttng enable-channel mychannel0,mychannel1 -k -s mysession2 --overwrite --subbuf-size 16384 --num-subbuf 2 --switch-timer 200 --read-timer 100 -C 0 -W 10
+lttng enable-channel mychannel0,mychannel1 -k -s mysession2 --overwrite --subbuf-size 16384 --num-subbuf 2 --switch-timer 200 --read-timer 100 -C 0 -W 10
</COMMAND_INPUT>
<COMMAND_RESULT>
0
@@ -682,7 +682,7 @@ Kernel channel mychannel1 enabled for session mysession2
</COMMAND_OUTPUT>
<COMMAND_INPUT>
-lttng enable-channel mychannel0,mychannel1 -k -s mysession2 --overwrite --subbuf-size 16384 --num-subbuf 2 --switch-timer 200 --read-timer 100
+lttng enable-channel mychannel0,mychannel1 -k -s mysession2 --overwrite --subbuf-size 16384 --num-subbuf 2 --switch-timer 200 --read-timer 100
</COMMAND_INPUT>
<COMMAND_RESULT>
0
@@ -693,7 +693,7 @@ Kernel channel mychannel1 enabled for session mysession2
</COMMAND_OUTPUT>
<COMMAND_INPUT>
-lttng enable-channel ustChannel -u -s mysession2 --overwrite --subbuf-size 32768 --num-subbuf 1 --switch-timer 100 --read-timer 200 -C 0 -W 20
+lttng enable-channel ustChannel -u -s mysession2 --overwrite --subbuf-size 32768 --num-subbuf 1 --switch-timer 100 --read-timer 200 -C 0 -W 20
</COMMAND_INPUT>
<COMMAND_RESULT>
0
@@ -703,7 +703,7 @@ UST channel channel0 enabled for session mysession2
</COMMAND_OUTPUT>
<COMMAND_INPUT>
-lttng enable-channel ustChannel -u -s mysession2 --overwrite --subbuf-size 32768 --num-subbuf 1 --switch-timer 100 --read-timer 200
+lttng enable-channel ustChannel -u -s mysession2 --overwrite --subbuf-size 32768 --num-subbuf 1 --switch-timer 100 --read-timer 200
</COMMAND_INPUT>
<COMMAND_RESULT>
0
@@ -713,7 +713,7 @@ UST channel channel0 enabled for session mysession2
</COMMAND_OUTPUT>
<COMMAND_INPUT>
-lttng enable-channel ustChannel -u -s mysession2 --overwrite --subbuf-size 32768 --num-subbuf 1 --switch-timer 100 --read-timer 200 --buffers-uid -C 0 -W 20
+lttng enable-channel ustChannel -u -s mysession2 --overwrite --subbuf-size 32768 --num-subbuf 1 --switch-timer 100 --read-timer 200 --buffers-uid -C 0 -W 20
</COMMAND_INPUT>
<COMMAND_RESULT>
0
@@ -723,7 +723,7 @@ UST channel channel0 enabled for session mysession2
</COMMAND_OUTPUT>
<COMMAND_INPUT>
-lttng enable-channel ustChannel -u -s mysession2 --overwrite --buffers-pid
+lttng enable-channel ustChannel -u -s mysession2 --overwrite --buffers-pid
</COMMAND_INPUT>
<COMMAND_RESULT>
0
@@ -733,7 +733,7 @@ UST channel ustChannel enabled for session mysession2
</COMMAND_OUTPUT>
<COMMAND_INPUT>
-lttng enable-channel ustChannel -u -s mysession2 --overwrite --subbuf-size 32768 --num-subbuf 1 --switch-timer 100 --read-timer 200 --buffers-uid
+lttng enable-channel ustChannel -u -s mysession2 --overwrite --subbuf-size 32768 --num-subbuf 1 --switch-timer 100 --read-timer 200 --buffers-uid
</COMMAND_INPUT>
<COMMAND_RESULT>
0
@@ -744,7 +744,7 @@ UST channel channel0 enabled for session mysession2
<COMMAND_INPUT>
-lttng enable-channel mychannel0,mychannel1 -k -s mysession2
+lttng enable-channel mychannel0,mychannel1 -k -s mysession2
</COMMAND_INPUT>
<COMMAND_RESULT>
0
@@ -755,7 +755,7 @@ Kernel channel mychannel1 enabled for session mysession2
</COMMAND_OUTPUT>
<COMMAND_INPUT>
-lttng enable-channel ustChannel -u -s mysession2
+lttng enable-channel ustChannel -u -s mysession2
</COMMAND_INPUT>
<COMMAND_RESULT>
0
@@ -765,7 +765,7 @@ UST channel mychannel0 enabled for session mysession2
</COMMAND_OUTPUT>
<COMMAND_INPUT>
-lttng disable-channel mychannel0,mychannel1 -k -s mysession2
+lttng disable-channel mychannel0,mychannel1 -k -s mysession2
</COMMAND_INPUT>
<COMMAND_RESULT>
0
@@ -776,7 +776,7 @@ Kernel channel mychannel1 disabled for session mysession2
</COMMAND_OUTPUT>
<COMMAND_INPUT>
-lttng disable-channel ustChannel -u -s mysession2
+lttng disable-channel ustChannel -u -s mysession2
</COMMAND_INPUT>
<COMMAND_RESULT>
0
@@ -796,7 +796,7 @@ EventHandling
# Tracepoint test cases
<COMMAND_INPUT>
-lttng enable-event block_rq_remap,block_bio_remap,softirq_entry -k -s mysession2 --tracepoint
+lttng enable-event block_rq_remap,block_bio_remap,softirq_entry -k -s mysession2 --tracepoint
</COMMAND_INPUT>
<COMMAND_RESULT>
0
@@ -808,7 +808,7 @@ kernel event softirq_entry created in channel channel0
</COMMAND_OUTPUT>
<COMMAND_INPUT>
-lttng enable-event -a -k -s mysession2 -c mychannel --tracepoint
+lttng enable-event -a -k -s mysession2 -c mychannel --tracepoint
</COMMAND_INPUT>
<COMMAND_RESULT>
0
@@ -818,7 +818,7 @@ All kernel tracepoints are enabled in channel channel0
</COMMAND_OUTPUT>
<COMMAND_INPUT>
-lttng enable-event ust_tests_hello:tptest_sighandler -u -s mysession2 -c mychannel --tracepoint
+lttng enable-event ust_tests_hello:tptest_sighandler -u -s mysession2 -c mychannel --tracepoint
</COMMAND_INPUT>
<COMMAND_RESULT>
0
@@ -828,7 +828,7 @@ UST event ust_tests_hello:tptest_sighandler created in channel mychannel
</COMMAND_OUTPUT>
<COMMAND_INPUT>
-lttng enable-event ust_tests_hello:tptest_sighandler -u -s mysession2 -c mychannel --tracepoint --filter 'intfield==10'
+lttng enable-event ust_tests_hello:tptest_sighandler -u -s mysession2 -c mychannel --tracepoint --filter intfield==10
</COMMAND_INPUT>
<COMMAND_RESULT>
0
@@ -838,7 +838,7 @@ UST event ust_tests_hello:tptest_sighandler created in channel mychannel
</COMMAND_OUTPUT>
<COMMAND_INPUT>
-lttng enable-event -a -u -s mysession2 -c mychannel --tracepoint
+lttng enable-event -a -u -s mysession2 -c mychannel --tracepoint
</COMMAND_INPUT>
<COMMAND_RESULT>
0
@@ -850,7 +850,7 @@ All UST tracepoints are enabled in channel mychannel
# Syscall test cases
<COMMAND_INPUT>
-lttng enable-event -a -k -s mysession2 --syscall
+lttng enable-event -a -k -s mysession2 --syscall
</COMMAND_INPUT>
<COMMAND_RESULT>
0
@@ -860,7 +860,7 @@ All kernel system calls are enabled in channel channel0
</COMMAND_OUTPUT>
<COMMAND_INPUT>
-lttng enable-event -a -k -s mysession2 -c mychannel --syscall
+lttng enable-event -a -k -s mysession2 -c mychannel --syscall
</COMMAND_INPUT>
<COMMAND_RESULT>
0
@@ -872,7 +872,7 @@ All kernel system calls are enabled in channel mychannel
# dynamic probe/function probe test cases
<COMMAND_INPUT>
-lttng enable-event myevent0 -k -s mysession2 --function 0xc0101340
+lttng enable-event myevent0 -k -s mysession2 --function 0xc0101340
</COMMAND_INPUT>
<COMMAND_RESULT>
0
@@ -882,7 +882,7 @@ kernel event myevent0 created in channel mychannel
</COMMAND_OUTPUT>
<COMMAND_INPUT>
-lttng enable-event myevent1 -k -s mysession2 -c mychannel --probe init_post
+lttng enable-event myevent1 -k -s mysession2 -c mychannel --probe init_post
</COMMAND_INPUT>
<COMMAND_RESULT>
0
@@ -894,7 +894,7 @@ kernel event myevent1 created in channel mychannel
# log level test cases
<COMMAND_INPUT>
-lttng enable-event myevent4 -u -s mysession2 --loglevel-only TRACE_DEBUG
+lttng enable-event myevent4 -u -s mysession2 --loglevel-only TRACE_DEBUG
</COMMAND_INPUT>
<COMMAND_RESULT>
0
@@ -904,7 +904,7 @@ UST event myevent4 created in channel channel0
</COMMAND_OUTPUT>
<COMMAND_INPUT>
-lttng enable-event myevent5 -u -s mysession2 -c mychannel --loglevel TRACE_DEBUG_FUNCTION
+lttng enable-event myevent5 -u -s mysession2 -c mychannel --loglevel TRACE_DEBUG_FUNCTION
</COMMAND_INPUT>
<COMMAND_RESULT>
0
@@ -923,7 +923,7 @@ UST event myevent5 created in channel mychannel
ContextHandling
<COMMAND_INPUT>
-lttng add-context -h
+lttng add-context -h
</COMMAND_INPUT>
<COMMAND_RESULT>
0
@@ -955,12 +955,12 @@ 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 -k -t prio -t perf:branch-misses -t perf:cache-misses
</COMMAND_OUTPUT>
<COMMAND_INPUT>
-lttng add-context -s mysession2 -c mychannel -e ust_tests_hello:tptest_sighandler -u -t prio -t pid
+lttng add-context -s mysession2 -c mychannel -e ust_tests_hello:tptest_sighandler -u -t prio -t pid
</COMMAND_INPUT>
<COMMAND_RESULT>
0
@@ -975,7 +975,7 @@ UST context pid added to event sched_kthread_stop_ret channel mychannel
ContextErrorHandling
<COMMAND_INPUT>
-lttng add-context -h
+lttng add-context -h
</COMMAND_INPUT>
<COMMAND_RESULT>
1
@@ -1007,12 +1007,12 @@ 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 -k -t prio -t perf:branch-misses -t perf:cache-misses
</COMMAND_OUTPUT>
<COMMAND_INPUT>
-lttng add-context -s mysession2 -c mychannel -e ust_tests_hello:tptest_sighandler -u -t prio -t pid
+lttng add-context -s mysession2 -c mychannel -e ust_tests_hello:tptest_sighandler -u -t prio -t pid
</COMMAND_INPUT>
<COMMAND_RESULT>
1
@@ -1027,7 +1027,7 @@ UST context pid added to event sched_kthread_stop_ret channel mychannel
<SCENARIO>
CalibrateHandling
<COMMAND_INPUT>
-lttng calibrate -k --function
+lttng calibrate -k --function
</COMMAND_INPUT>
<COMMAND_RESULT>
0
@@ -1037,7 +1037,7 @@ Kernel calibration done
</COMMAND_OUTPUT>
<COMMAND_INPUT>
-lttng calibrate -u --function
+lttng calibrate -u --function
</COMMAND_INPUT>
<COMMAND_RESULT>
1
@@ -1110,7 +1110,7 @@ Session mysession destroyed.
</COMMAND_OUTPUT>
<COMMAND_INPUT>
-lttng -vvv create mysession -U net://172.0.0.1
+lttng -vvv create mysession -U net://172.0.0.1
</COMMAND_INPUT>
<COMMAND_RESULT>
0
@@ -1133,7 +1133,7 @@ DEBUG1: Init config session in /home/bernd [in config_init() at conf.c:294]
<SCENARIO>
CreateSessionLttngVerbose2.1
<COMMAND_INPUT>
-lttng -vvv create mysession -U net://172.0.0.1
+lttng -vvv create mysession -U net://172.0.0.1
</COMMAND_INPUT>
<COMMAND_RESULT>
0
@@ -1149,7 +1149,7 @@ DEBUG1: Init config session in /home/bernd [in config_init() at conf.c:294]
</COMMAND_OUTPUT>
<COMMAND_INPUT>
-lttng -vvv destroy mysession
+lttng -vvv destroy mysession
</COMMAND_INPUT>
<COMMAND_RESULT>
0
@@ -1165,7 +1165,7 @@ Session mysession destroyed.
<SCENARIO>
CreateSessionSnapshot
<COMMAND_INPUT>
-lttng create mysession --snapshot
+lttng create mysession --snapshot
</COMMAND_INPUT>
<COMMAND_RESULT>
0
@@ -1177,7 +1177,7 @@ Snapshot mode set. Every channel enabled for that session will be set in overwri
</COMMAND_OUTPUT>
#------------------------------------------------------------------------------
<COMMAND_INPUT>
-lttng snapshot list-output -s mysession
+lttng snapshot list-output -s mysession
</COMMAND_INPUT>
<COMMAND_RESULT>
0
@@ -1188,7 +1188,7 @@ Snapshot output list for session mysession
</COMMAND_OUTPUT>
#------------------------------------------------------------------------------
<COMMAND_INPUT>
-lttng list
+lttng list
</COMMAND_INPUT>
<COMMAND_RESULT>
0
@@ -1199,7 +1199,7 @@ lttng list
</COMMAND_OUTPUT>
#------------------------------------------------------------------------------
<COMMAND_INPUT>
-lttng snapshot record -s mysession
+lttng snapshot record -s mysession
</COMMAND_INPUT>
<COMMAND_RESULT>
0
@@ -1237,7 +1237,7 @@ Snapshot mode set. Every channel enabled for that session will be set in overwri
</COMMAND_OUTPUT>
#------------------------------------------------------------------------------
<COMMAND_INPUT>
-lttng snapshot list-output -s mysession
+lttng snapshot list-output -s mysession
</COMMAND_INPUT>
<COMMAND_RESULT>
0
@@ -1248,7 +1248,7 @@ Snapshot output list for session mysession
</COMMAND_OUTPUT>
#------------------------------------------------------------------------------
<COMMAND_INPUT>
-lttng list
+lttng list
</COMMAND_INPUT>
<COMMAND_RESULT>
0
@@ -1259,7 +1259,7 @@ lttng list
</COMMAND_OUTPUT>
#------------------------------------------------------------------------------
<COMMAND_INPUT>
-lttng snapshot record -s mysession
+lttng snapshot record -s mysession
</COMMAND_INPUT>
<COMMAND_RESULT>
0
@@ -1285,7 +1285,7 @@ Session mysession destroyed.
<SCENARIO>
CreateSessionSnapshotErrors
<COMMAND_INPUT>
-lttng snapshot list-output -s blabla
+lttng snapshot list-output -s blabla
</COMMAND_INPUT>
<COMMAND_RESULT>
1
@@ -1298,7 +1298,7 @@ Error: Session name not found
#------------------------------------------------------------------------------
#next is not an error case but good to be tested
<COMMAND_INPUT>
-lttng list
+lttng list
</COMMAND_INPUT>
<COMMAND_RESULT>
0
@@ -1309,7 +1309,7 @@ lttng list
</COMMAND_OUTPUT>
#------------------------------------------------------------------------------
<COMMAND_INPUT>
-lttng snapshot record -s blabla
+lttng snapshot record -s blabla
</COMMAND_INPUT>
<COMMAND_RESULT>
1
@@ -1321,7 +1321,7 @@ lttng snapshot record -s blabla
</COMMAND_OUTPUT>
#------------------------------------------------------------------------------
<COMMAND_INPUT>
-lttng snapshot record -s mysession
+lttng snapshot record -s mysession
</COMMAND_INPUT>
<COMMAND_RESULT>
1
@@ -1340,7 +1340,7 @@ lttng snapshot record -s mysession
<SCENARIO>
CreateSessionLive
<COMMAND_INPUT>
-lttng create mysession --live -U net://127.0.0.1
+lttng create mysession --live -U net://127.0.0.1
</COMMAND_INPUT>
<COMMAND_RESULT>
0
@@ -1352,7 +1352,7 @@ Live timer set to 1000000 usec
</COMMAND_OUTPUT>
#------------------------------------------------------------------------------
<COMMAND_INPUT>
-lttng list
+lttng list
</COMMAND_INPUT>
<COMMAND_RESULT>
0
@@ -1426,7 +1426,7 @@ Error: Command error
<SCENARIO>
CreateSessionSnapshot2.5
<COMMAND_INPUT>
-lttng create mysession --snapshot
+lttng create mysession --snapshot
</COMMAND_INPUT>
<COMMAND_RESULT>
0
@@ -1438,7 +1438,7 @@ Snapshot mode set. Every channel enabled for that session will be set in overwri
</COMMAND_OUTPUT>
#------------------------------------------------------------------------------
<COMMAND_INPUT>
-lttng snapshot list-output -s mysession
+lttng snapshot list-output -s mysession
</COMMAND_INPUT>
<COMMAND_RESULT>
0
@@ -1449,7 +1449,7 @@ Snapshot output list for session mysession
</COMMAND_OUTPUT>
#------------------------------------------------------------------------------
<COMMAND_INPUT>
-lttng list
+lttng list
</COMMAND_INPUT>
<COMMAND_RESULT>
0
@@ -1460,7 +1460,7 @@ lttng list
</COMMAND_OUTPUT>
#------------------------------------------------------------------------------
<COMMAND_INPUT>
-lttng snapshot record -s mysession
+lttng snapshot record -s mysession
</COMMAND_INPUT>
<COMMAND_RESULT>
0
diff --git a/lttng/org.eclipse.linuxtools.lttng2.control.ui.tests/testfiles/ListInfoTest.cfg b/lttng/org.eclipse.linuxtools.lttng2.control.ui.tests/testfiles/ListInfoTest.cfg
index 4329c6f5bc..895bde3474 100644
--- a/lttng/org.eclipse.linuxtools.lttng2.control.ui.tests/testfiles/ListInfoTest.cfg
+++ b/lttng/org.eclipse.linuxtools.lttng2.control.ui.tests/testfiles/ListInfoTest.cfg
@@ -16,7 +16,7 @@
ListInfoTest
<COMMAND_INPUT>
-lttng version
+lttng version
</COMMAND_INPUT>
<COMMAND_RESULT>
0
@@ -29,7 +29,7 @@ lttng is free software and under the GPL license and part LGPL
</COMMAND_OUTPUT>
<COMMAND_INPUT>
-lttng list
+lttng list
</COMMAND_INPUT>
<COMMAND_RESULT>
0
@@ -151,7 +151,7 @@ Kernel events
</COMMAND_OUTPUT>
<COMMAND_INPUT>
-lttng list -u -f
+lttng list -u -f
</COMMAND_INPUT>
<COMMAND_RESULT>
0
@@ -186,7 +186,7 @@ PID: 4852 - Name: /home/user/git/lttng-ust/tests/hello.cxx/.libs/lt-hello
ListInfoTestNoKernel
<COMMAND_INPUT>
-lttng version
+lttng version
</COMMAND_INPUT>
<COMMAND_RESULT>
0
@@ -199,7 +199,7 @@ lttng is free software and under the GPL license and part LGPL
</COMMAND_OUTPUT>
<COMMAND_INPUT>
-lttng list
+lttng list
</COMMAND_INPUT>
<COMMAND_RESULT>
0
diff --git a/lttng/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/dialogs/EnableUstEventsComposite.java b/lttng/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/dialogs/EnableUstEventsComposite.java
index 41e198100b..f706bcb13b 100644
--- a/lttng/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/dialogs/EnableUstEventsComposite.java
+++ b/lttng/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/dialogs/EnableUstEventsComposite.java
@@ -329,7 +329,7 @@ public class EnableUstEventsComposite extends Composite implements IEnableUstEve
String tempWildcard = fWildcardText.getText();
if (tempWildcard.isEmpty() ||
tempWildcard.matches("\\s*") || //$NON-NLS-1$
- (!tempWildcard.matches("^[\\s]{0,}$") && !tempWildcard.matches("^[a-zA-Z0-9\\-\\_\\*]{1,}$"))) { //$NON-NLS-1$ //$NON-NLS-2$
+ (!tempWildcard.matches("^[\\s]{0,}$") && !tempWildcard.matches("^[a-zA-Z0-9\\-\\_\\*\\\\\\']{1,}$"))) { //$NON-NLS-1$ //$NON-NLS-2$
MessageDialog.openError(getShell(),
Messages.TraceControl_EnableEventsDialogTitle,
Messages.TraceControl_InvalidWildcardError + " (" + tempWildcard + ") \n"); //$NON-NLS-1$ //$NON-NLS-2$
diff --git a/lttng/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/remote/CommandShell.java b/lttng/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/remote/CommandShell.java
index 886141f041..de58332ad5 100644
--- a/lttng/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/remote/CommandShell.java
+++ b/lttng/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/remote/CommandShell.java
@@ -14,6 +14,7 @@
package org.eclipse.linuxtools.internal.lttng2.control.ui.views.remote;
import java.io.IOException;
+import java.util.List;
import java.util.concurrent.Callable;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
@@ -86,7 +87,7 @@ public class CommandShell implements ICommandShell {
}
@Override
- public ICommandResult executeCommand(final String command, final IProgressMonitor monitor) throws ExecutionException {
+ public ICommandResult executeCommand(final List<String> command, final IProgressMonitor monitor) throws ExecutionException {
if (fConnection.isOpen()) {
FutureTask<CommandResult> future = new FutureTask<>(new Callable<CommandResult>() {
@Override
@@ -135,20 +136,21 @@ public class CommandShell implements ICommandShell {
throw new ExecutionException(Messages.TraceControl_ShellNotConnected, null);
}
- private IRemoteProcess startRemoteProcess(boolean wrapCommand, String command) throws IOException {
- String outputCommand = command;
+ private IRemoteProcess startRemoteProcess(boolean wrapCommand, List<String> command) throws IOException {
if (wrapCommand) {
StringBuilder formattedCommand = new StringBuilder();
formattedCommand.append(SHELL_ECHO_CMD).append(BEGIN_TAG);
formattedCommand.append(CMD_SEPARATOR);
- formattedCommand.append(command);
+ for(String cmd : command) {
+ formattedCommand.append(cmd).append(' ');
+ }
formattedCommand.append(CMD_SEPARATOR);
formattedCommand.append(SHELL_ECHO_CMD).append(END_TAG).append(CMD_RESULT_VAR);
- outputCommand = formattedCommand.toString();
+ String[] args = formattedCommand.toString().trim().split("\\s+"); //$NON-NLS-1$
+ return fConnection.getProcessBuilder(args).start();
}
- String[] args = outputCommand.trim().split("\\s+"); //$NON-NLS-1$
- return fConnection.getProcessBuilder(args).start();
+ return fConnection.getProcessBuilder(command).start();
}
private boolean isBackedByShell() throws InterruptedException {
diff --git a/lttng/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/remote/ICommandShell.java b/lttng/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/remote/ICommandShell.java
index 33b28a8f34..80d381b06a 100644
--- a/lttng/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/remote/ICommandShell.java
+++ b/lttng/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/remote/ICommandShell.java
@@ -12,6 +12,8 @@
**********************************************************************/
package org.eclipse.linuxtools.internal.lttng2.control.ui.views.remote;
+import java.util.List;
+
import org.eclipse.core.commands.ExecutionException;
import org.eclipse.core.runtime.IProgressMonitor;
@@ -48,6 +50,6 @@ public interface ICommandShell {
* @throws ExecutionException
* If the command fails
*/
- ICommandResult executeCommand(String command,
+ ICommandResult executeCommand(List<String> command,
IProgressMonitor monitor) throws ExecutionException;
}
diff --git a/lttng/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/service/LTTngControlService.java b/lttng/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/service/LTTngControlService.java
index 123b99c4cf..97012e35df 100644
--- a/lttng/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/service/LTTngControlService.java
+++ b/lttng/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/service/LTTngControlService.java
@@ -16,6 +16,7 @@
package org.eclipse.linuxtools.internal.lttng2.control.ui.views.service;
import java.util.ArrayList;
+import java.util.Arrays;
import java.util.Iterator;
import java.util.List;
import java.util.regex.Matcher;
@@ -146,9 +147,9 @@ public class LTTngControlService implements ILttngControlService {
@Override
public String[] getSessionNames(IProgressMonitor monitor) throws ExecutionException {
- StringBuffer command = createCommand(LTTngControlServiceConstants.COMMAND_LIST);
+ List<String> command = createCommand(LTTngControlServiceConstants.COMMAND_LIST);
- ICommandResult result = executeCommand(command.toString(), monitor);
+ ICommandResult result = executeCommand(command, monitor);
// Output:
// Available tracing sessions:
@@ -193,8 +194,8 @@ public class LTTngControlService implements ILttngControlService {
@Override
public ISessionInfo getSession(String sessionName, IProgressMonitor monitor) throws ExecutionException {
- StringBuffer command = createCommand(LTTngControlServiceConstants.COMMAND_LIST, sessionName);
- ICommandResult result = executeCommand(command.toString(), monitor);
+ List<String> command = createCommand(LTTngControlServiceConstants.COMMAND_LIST, sessionName);
+ ICommandResult result = executeCommand(command, monitor);
int index = 0;
@@ -296,8 +297,8 @@ public class LTTngControlService implements ILttngControlService {
@Override
public ISnapshotInfo getSnapshotInfo(String sessionName, IProgressMonitor monitor) throws ExecutionException {
- StringBuffer command = createCommand(LTTngControlServiceConstants.COMMAND_LIST_SNAPSHOT_OUTPUT, LTTngControlServiceConstants.OPTION_SESSION, sessionName);
- ICommandResult result = executeCommand(command.toString(), monitor);
+ List<String> command = createCommand(LTTngControlServiceConstants.COMMAND_SNAPSHOT, LTTngControlServiceConstants.COMMAND_LIST_SNAPSHOT_OUTPUT, LTTngControlServiceConstants.OPTION_SESSION, sessionName);
+ ICommandResult result = executeCommand(command, monitor);
int index = 0;
@@ -331,8 +332,8 @@ public class LTTngControlService implements ILttngControlService {
@Override
public List<IBaseEventInfo> getKernelProvider(IProgressMonitor monitor) throws ExecutionException {
- StringBuffer command = createCommand(LTTngControlServiceConstants.COMMAND_LIST_KERNEL);
- ICommandResult result = executeCommand(command.toString(), monitor, false);
+ List<String> command = createCommand(LTTngControlServiceConstants.COMMAND_LIST, LTTngControlServiceConstants.OPTION_KERNEL);
+ ICommandResult result = executeCommand(command, monitor, false);
List<IBaseEventInfo> events = new ArrayList<>();
@@ -349,7 +350,7 @@ public class LTTngControlService implements ILttngControlService {
}
if (isError(result)) {
- throw new ExecutionException(Messages.TraceControl_CommandError + " " + command.toString() + "\n" + formatOutput(result)); //$NON-NLS-1$ //$NON-NLS-2$
+ throw new ExecutionException(Messages.TraceControl_CommandError + " " + toCommandString(command) + "\n" + formatOutput(result)); //$NON-NLS-1$ //$NON-NLS-2$
}
// Kernel events:
@@ -366,13 +367,13 @@ public class LTTngControlService implements ILttngControlService {
@Override
public List<IUstProviderInfo> getUstProvider(IProgressMonitor monitor) throws ExecutionException {
- StringBuffer command = createCommand(LTTngControlServiceConstants.COMMAND_LIST_UST);
+ List<String> command = createCommand(LTTngControlServiceConstants.COMMAND_LIST, LTTngControlServiceConstants.OPTION_UST);
if (isVersionSupported("2.1.0")) { //$NON-NLS-1$
- command.append(LTTngControlServiceConstants.OPTION_FIELDS);
+ command.add(LTTngControlServiceConstants.OPTION_FIELDS);
}
- ICommandResult result = executeCommand(command.toString(), monitor, false);
+ ICommandResult result = executeCommand(command, monitor, false);
List<IUstProviderInfo> allProviders = new ArrayList<>();
// Workaround for versions 2.0.x which causes a segmentation fault for
@@ -395,7 +396,7 @@ public class LTTngControlService implements ILttngControlService {
}
if (isError(result)) {
- throw new ExecutionException(Messages.TraceControl_CommandError + " " + command.toString() + "\n" + formatOutput(result)); //$NON-NLS-1$ //$NON-NLS-2$
+ throw new ExecutionException(Messages.TraceControl_CommandError + " " + toCommandString(command) + "\n" + formatOutput(result)); //$NON-NLS-1$ //$NON-NLS-2$
}
// Note that field print-outs exists for version >= 2.1.0
@@ -447,9 +448,9 @@ public class LTTngControlService implements ILttngControlService {
return createStreamedSession(sessionInfo, monitor);
}
- StringBuffer command = prepareSessionCreationCommand(sessionInfo);
+ List<String> command = prepareSessionCreationCommand(sessionInfo);
- ICommandResult result = executeCommand(command.toString(), monitor);
+ ICommandResult result = executeCommand(command, monitor);
// Session myssession2 created.
// Traces will be written in
@@ -476,7 +477,7 @@ public class LTTngControlService implements ILttngControlService {
// Verify session name
if ((name == null) || (!"".equals(sessionInfo.getName()) && !name.equals(sessionInfo.getName()))) { //$NON-NLS-1$
// Unexpected name returned
- throw new ExecutionException(Messages.TraceControl_CommandError + " " + command + "\n" + //$NON-NLS-1$ //$NON-NLS-2$
+ throw new ExecutionException(Messages.TraceControl_CommandError + " " + toCommandString(command) + "\n" + //$NON-NLS-1$ //$NON-NLS-2$
Messages.TraceControl_UnexpectedNameError + ": " + name); //$NON-NLS-1$
}
@@ -485,7 +486,7 @@ public class LTTngControlService implements ILttngControlService {
if (!sessionInfo.isSnapshotSession() &&
((path == null) || ((sessionInfo.getSessionPath() != null) && (!path.contains(sessionInfo.getSessionPath()))))) {
// Unexpected path
- throw new ExecutionException(Messages.TraceControl_CommandError + " " + command + "\n" + //$NON-NLS-1$ //$NON-NLS-2$
+ throw new ExecutionException(Messages.TraceControl_CommandError + " " + toCommandString(command) + "\n" + //$NON-NLS-1$ //$NON-NLS-2$
Messages.TraceControl_UnexpectedPathError + ": " + name); //$NON-NLS-1$
}
@@ -508,28 +509,29 @@ public class LTTngControlService implements ILttngControlService {
* the session to create
* @return the basic command for command creation
*/
- protected StringBuffer prepareSessionCreationCommand(ISessionInfo sessionInfo) {
- String newName = formatParameter(sessionInfo.getName());
- String newPath = formatParameter(sessionInfo.getSessionPath());
-
- StringBuffer command = createCommand(LTTngControlServiceConstants.COMMAND_CREATE_SESSION, newName);
+ protected List<String> prepareSessionCreationCommand(ISessionInfo sessionInfo) {
+ List<String> command = createCommand(LTTngControlServiceConstants.COMMAND_CREATE_SESSION);
+ if (!sessionInfo.getName().isEmpty()) {
+ command.add(sessionInfo.getName());
+ }
+ String newPath = sessionInfo.getSessionPath();
if (newPath != null && !"".equals(newPath)) { //$NON-NLS-1$
- command.append(LTTngControlServiceConstants.OPTION_OUTPUT_PATH);
- command.append(newPath);
+ command.add(LTTngControlServiceConstants.OPTION_OUTPUT_PATH);
+ command.add(newPath);
}
if (sessionInfo.isSnapshotSession()) {
- command.append(LTTngControlServiceConstants.OPTION_SNAPSHOT);
+ command.add(LTTngControlServiceConstants.OPTION_SNAPSHOT);
}
return command;
}
private ISessionInfo createStreamedSession(ISessionInfo sessionInfo, IProgressMonitor monitor) throws ExecutionException {
- StringBuffer command = prepareStreamedSessionCreationCommand(sessionInfo);
+ List<String> command = prepareStreamedSessionCreationCommand(sessionInfo);
- ICommandResult result = executeCommand(command.toString(), monitor);
+ ICommandResult result = executeCommand(command, monitor);
// Verify output
String[] output = result.getOutput();
@@ -555,7 +557,7 @@ public class LTTngControlService implements ILttngControlService {
// Verify session name
if ((name == null) || (!"".equals(sessionInfo.getName()) && !name.equals(sessionInfo.getName()))) { //$NON-NLS-1$
// Unexpected name returned
- throw new ExecutionException(Messages.TraceControl_CommandError + " " + command + "\n" + //$NON-NLS-1$ //$NON-NLS-2$
+ throw new ExecutionException(Messages.TraceControl_CommandError + " " + toCommandString(command) + "\n" + //$NON-NLS-1$ //$NON-NLS-2$
Messages.TraceControl_UnexpectedNameError + ": " + name); //$NON-NLS-1$
}
@@ -567,7 +569,7 @@ public class LTTngControlService implements ILttngControlService {
if (sessionInfo.getNetworkUrl() != null) {
if (!sessionInfo.isSnapshotSession() && (path == null)) {
// Unexpected path
- throw new ExecutionException(Messages.TraceControl_CommandError + " " + command + "\n" + //$NON-NLS-1$ //$NON-NLS-2$
+ throw new ExecutionException(Messages.TraceControl_CommandError + " " + toCommandString(command) + "\n" + //$NON-NLS-1$ //$NON-NLS-2$
Messages.TraceControl_UnexpectedPathError + ": " + name); //$NON-NLS-1$
}
@@ -596,39 +598,40 @@ public class LTTngControlService implements ILttngControlService {
* the session to create
* @return the basic command for command creation
*/
- protected StringBuffer prepareStreamedSessionCreationCommand(ISessionInfo sessionInfo) {
- String newName = formatParameter(sessionInfo.getName());
- StringBuffer command = createCommand(LTTngControlServiceConstants.COMMAND_CREATE_SESSION, newName);
+ protected List<String> prepareStreamedSessionCreationCommand(ISessionInfo sessionInfo) {
+ List<String> command = createCommand(LTTngControlServiceConstants.COMMAND_CREATE_SESSION);
+ if (!sessionInfo.getName().isEmpty()) {
+ command.add(sessionInfo.getName());
+ }
if (sessionInfo.isSnapshotSession()) {
- command.append(LTTngControlServiceConstants.OPTION_SNAPSHOT);
+ command.add(LTTngControlServiceConstants.OPTION_SNAPSHOT);
} else if (sessionInfo.isLive()) {
- command.append(LTTngControlServiceConstants.OPTION_LIVE);
+ command.add(LTTngControlServiceConstants.OPTION_LIVE);
if (sessionInfo.getLiveDelay() != LTTngControlServiceConstants.UNUSED_VALUE) {
- command.append(sessionInfo.getLiveDelay());
+ command.add(String.valueOf(sessionInfo.getLiveDelay()));
}
}
if (sessionInfo.getNetworkUrl() != null) {
- command.append(LTTngControlServiceConstants.OPTION_NETWORK_URL);
- command.append(sessionInfo.getNetworkUrl());
+ command.add(LTTngControlServiceConstants.OPTION_NETWORK_URL);
+ command.add(sessionInfo.getNetworkUrl());
} else {
- command.append(LTTngControlServiceConstants.OPTION_CONTROL_URL);
- command.append(sessionInfo.getControlUrl());
+ command.add(LTTngControlServiceConstants.OPTION_CONTROL_URL);
+ command.add(sessionInfo.getControlUrl());
- command.append(LTTngControlServiceConstants.OPTION_DATA_URL);
- command.append(sessionInfo.getDataUrl());
+ command.add(LTTngControlServiceConstants.OPTION_DATA_URL);
+ command.add(sessionInfo.getDataUrl());
}
return command;
}
@Override
public void destroySession(String sessionName, IProgressMonitor monitor) throws ExecutionException {
- String newName = formatParameter(sessionName);
- StringBuffer command = createCommand(LTTngControlServiceConstants.COMMAND_DESTROY_SESSION, newName);
+ List<String> command = createCommand(LTTngControlServiceConstants.COMMAND_DESTROY_SESSION, sessionName);
- ICommandResult result = executeCommand(command.toString(), monitor, false);
+ ICommandResult result = executeCommand(command, monitor, false);
String[] errorOutput = result.getErrorOutput();
boolean isError = isError(result);
@@ -640,7 +643,7 @@ public class LTTngControlService implements ILttngControlService {
}
if (isError) {
- throw new ExecutionException(Messages.TraceControl_CommandError + " " + command.toString() + "\n" + formatOutput(result)); //$NON-NLS-1$ //$NON-NLS-2$
+ throw new ExecutionException(Messages.TraceControl_CommandError + " " + toCommandString(command) + "\n" + formatOutput(result)); //$NON-NLS-1$ //$NON-NLS-2$
}
// Session <sessionName> destroyed
@@ -649,21 +652,18 @@ public class LTTngControlService implements ILttngControlService {
@Override
public void startSession(String sessionName, IProgressMonitor monitor) throws ExecutionException {
- String newSessionName = formatParameter(sessionName);
+ List<String> command = createCommand(LTTngControlServiceConstants.COMMAND_START_SESSION, sessionName);
- StringBuffer command = createCommand(LTTngControlServiceConstants.COMMAND_START_SESSION, newSessionName);
-
- executeCommand(command.toString(), monitor);
+ executeCommand(command, monitor);
// Session <sessionName> started
}
@Override
public void stopSession(String sessionName, IProgressMonitor monitor) throws ExecutionException {
- String newSessionName = formatParameter(sessionName);
- StringBuffer command = createCommand(LTTngControlServiceConstants.COMMAND_STOP_SESSION, newSessionName);
+ List<String> command = createCommand(LTTngControlServiceConstants.COMMAND_STOP_SESSION, sessionName);
- executeCommand(command.toString(), monitor);
+ executeCommand(command, monitor);
// Session <sessionName> stopped
@@ -677,56 +677,49 @@ public class LTTngControlService implements ILttngControlService {
return;
}
- StringBuffer command = createCommand(LTTngControlServiceConstants.COMMAND_ENABLE_CHANNEL);
+ List<String> command = createCommand(LTTngControlServiceConstants.COMMAND_ENABLE_CHANNEL);
- for (Iterator<String> iterator = channelNames.iterator(); iterator.hasNext();) {
- String channel = iterator.next();
- command.append(channel);
- if (iterator.hasNext()) {
- command.append(',');
- }
- }
+ command.add(toCsv(channelNames));
if (isKernel) {
- command.append(LTTngControlServiceConstants.OPTION_KERNEL);
+ command.add(LTTngControlServiceConstants.OPTION_KERNEL);
} else {
- command.append(LTTngControlServiceConstants.OPTION_UST);
+ command.add(LTTngControlServiceConstants.OPTION_UST);
}
- String newSessionName = formatParameter(sessionName);
- command.append(LTTngControlServiceConstants.OPTION_SESSION);
- command.append(newSessionName);
+ command.add(LTTngControlServiceConstants.OPTION_SESSION);
+ command.add(sessionName);
if (info != null) {
// --discard Discard event when buffers are full (default)
// --overwrite Flight recorder mode
if (info.isOverwriteMode()) {
- command.append(LTTngControlServiceConstants.OPTION_OVERWRITE);
+ command.add(LTTngControlServiceConstants.OPTION_OVERWRITE);
}
// --subbuf-size SIZE Subbuffer size in bytes
// (default: 4096, kernel default: 262144)
if (info.getSubBufferSize() != LTTngControlServiceConstants.UNUSED_VALUE) {
- command.append(LTTngControlServiceConstants.OPTION_SUB_BUFFER_SIZE);
- command.append(String.valueOf(info.getSubBufferSize()));
+ command.add(LTTngControlServiceConstants.OPTION_SUB_BUFFER_SIZE);
+ command.add(String.valueOf(info.getSubBufferSize()));
}
// --num-subbuf NUM Number of subbufers
if (info.getNumberOfSubBuffers() != LTTngControlServiceConstants.UNUSED_VALUE) {
- command.append(LTTngControlServiceConstants.OPTION_NUM_SUB_BUFFERS);
- command.append(String.valueOf(info.getNumberOfSubBuffers()));
+ command.add(LTTngControlServiceConstants.OPTION_NUM_SUB_BUFFERS);
+ command.add(String.valueOf(info.getNumberOfSubBuffers()));
}
// --switch-timer USEC Switch timer interval in usec
if (info.getSwitchTimer() != LTTngControlServiceConstants.UNUSED_VALUE) {
- command.append(LTTngControlServiceConstants.OPTION_SWITCH_TIMER);
- command.append(String.valueOf(info.getSwitchTimer()));
+ command.add(LTTngControlServiceConstants.OPTION_SWITCH_TIMER);
+ command.add(String.valueOf(info.getSwitchTimer()));
}
// --read-timer USEC Read timer interval in usec
if (info.getReadTimer() != LTTngControlServiceConstants.UNUSED_VALUE) {
- command.append(LTTngControlServiceConstants.OPTION_READ_TIMER);
- command.append(String.valueOf(info.getReadTimer()));
+ command.add(LTTngControlServiceConstants.OPTION_READ_TIMER);
+ command.add(String.valueOf(info.getReadTimer()));
}
if (isVersionSupported("2.2.0")) { //$NON-NLS-1$
@@ -734,28 +727,28 @@ public class LTTngControlService implements ILttngControlService {
// same buffers --buffers-pid Buffers are allocated per PID
if (!isKernel) {
if (info.getBufferType() == BufferType.BUFFER_PER_PID) {
- command.append(LTTngControlServiceConstants.OPTION_PER_PID_BUFFERS);
+ command.add(LTTngControlServiceConstants.OPTION_PER_PID_BUFFERS);
} else if (info.getBufferType() == BufferType.BUFFER_PER_UID) {
- command.append(LTTngControlServiceConstants.OPTION_PER_UID_BUFFERS);
+ command.add(LTTngControlServiceConstants.OPTION_PER_UID_BUFFERS);
}
}
// -C SIZE Maximum size of trace files in bytes
if (info.getMaxSizeTraceFiles() != LTTngControlServiceConstants.UNUSED_VALUE) {
- command.append(LTTngControlServiceConstants.OPTION_MAX_SIZE_TRACE_FILES);
- command.append(String.valueOf(info.getMaxSizeTraceFiles()));
+ command.add(LTTngControlServiceConstants.OPTION_MAX_SIZE_TRACE_FILES);
+ command.add(String.valueOf(info.getMaxSizeTraceFiles()));
}
// -W NUM Maximum number of trace files
if (info.getMaxNumberTraceFiles() != LTTngControlServiceConstants.UNUSED_VALUE) {
- command.append(LTTngControlServiceConstants.OPTION_MAX_TRACE_FILES);
- command.append(String.valueOf(info.getMaxNumberTraceFiles()));
+ command.add(LTTngControlServiceConstants.OPTION_MAX_TRACE_FILES);
+ command.add(String.valueOf(info.getMaxNumberTraceFiles()));
}
}
}
- executeCommand(command.toString(), monitor);
+ executeCommand(command, monitor);
}
@@ -767,162 +760,139 @@ public class LTTngControlService implements ILttngControlService {
return;
}
- StringBuffer command = createCommand(LTTngControlServiceConstants.COMMAND_DISABLE_CHANNEL);
+ List<String> command = createCommand(LTTngControlServiceConstants.COMMAND_DISABLE_CHANNEL);
- for (Iterator<String> iterator = channelNames.iterator(); iterator.hasNext();) {
- String channel = iterator.next();
- command.append(channel);
- if (iterator.hasNext()) {
- command.append(',');
- }
- }
+ command.add(toCsv(channelNames));
if (isKernel) {
- command.append(LTTngControlServiceConstants.OPTION_KERNEL);
+ command.add(LTTngControlServiceConstants.OPTION_KERNEL);
} else {
- command.append(LTTngControlServiceConstants.OPTION_UST);
+ command.add(LTTngControlServiceConstants.OPTION_UST);
}
- String newSessionName = formatParameter(sessionName);
- command.append(LTTngControlServiceConstants.OPTION_SESSION);
- command.append(newSessionName);
+ command.add(LTTngControlServiceConstants.OPTION_SESSION);
+ command.add(sessionName);
- executeCommand(command.toString(), monitor);
+ executeCommand(command, monitor);
}
@Override
public void enableEvents(String sessionName, String channelName, List<String> eventNames, boolean isKernel, String filterExpression, IProgressMonitor monitor) throws ExecutionException {
- StringBuffer command = createCommand(LTTngControlServiceConstants.COMMAND_ENABLE_EVENT);
+ List<String> command = createCommand(LTTngControlServiceConstants.COMMAND_ENABLE_EVENT);
if (eventNames == null || eventNames.isEmpty()) {
- command.append(LTTngControlServiceConstants.OPTION_ALL);
+ command.add(LTTngControlServiceConstants.OPTION_ALL);
} else {
-
- StringBuffer eventNameParameter = new StringBuffer();
- for (Iterator<String> iterator = eventNames.iterator(); iterator.hasNext();) {
- String event = iterator.next();
- eventNameParameter.append(event);
- if (iterator.hasNext()) {
- eventNameParameter.append(',');
- }
- }
- command.append(formatParameter(eventNameParameter.toString()));
+ command.add(toCsv(eventNames));
}
if (isKernel) {
- command.append(LTTngControlServiceConstants.OPTION_KERNEL);
+ command.add(LTTngControlServiceConstants.OPTION_KERNEL);
} else {
- command.append(LTTngControlServiceConstants.OPTION_UST);
+ command.add(LTTngControlServiceConstants.OPTION_UST);
}
- String newSessionName = formatParameter(sessionName);
-
- command.append(LTTngControlServiceConstants.OPTION_SESSION);
- command.append(newSessionName);
+ command.add(LTTngControlServiceConstants.OPTION_SESSION);
+ command.add(sessionName);
if (channelName != null) {
- command.append(LTTngControlServiceConstants.OPTION_CHANNEL);
- command.append(channelName);
+ command.add(LTTngControlServiceConstants.OPTION_CHANNEL);
+ command.add(channelName);
}
- command.append(LTTngControlServiceConstants.OPTION_TRACEPOINT);
+ command.add(LTTngControlServiceConstants.OPTION_TRACEPOINT);
if (filterExpression != null) {
- command.append(LTTngControlServiceConstants.OPTION_FILTER);
- command.append('\'');
- command.append(filterExpression);
- command.append('\'');
+ command.add(LTTngControlServiceConstants.OPTION_FILTER);
+ command.add(filterExpression);
}
- executeCommand(command.toString(), monitor);
+ executeCommand(command, monitor);
}
@Override
public void enableSyscalls(String sessionName, String channelName, IProgressMonitor monitor) throws ExecutionException {
- StringBuffer command = createCommand(LTTngControlServiceConstants.COMMAND_ENABLE_EVENT);
+ List<String> command = createCommand(LTTngControlServiceConstants.COMMAND_ENABLE_EVENT);
- command.append(LTTngControlServiceConstants.OPTION_ALL);
- command.append(LTTngControlServiceConstants.OPTION_KERNEL);
+ command.add(LTTngControlServiceConstants.OPTION_ALL);
+ command.add(LTTngControlServiceConstants.OPTION_KERNEL);
- String newSessionName = formatParameter(sessionName);
- command.append(LTTngControlServiceConstants.OPTION_SESSION);
- command.append(newSessionName);
+ command.add(LTTngControlServiceConstants.OPTION_SESSION);
+ command.add(sessionName);
if (channelName != null) {
- command.append(LTTngControlServiceConstants.OPTION_CHANNEL);
- command.append(channelName);
+ command.add(LTTngControlServiceConstants.OPTION_CHANNEL);
+ command.add(channelName);
}
- command.append(LTTngControlServiceConstants.OPTION_SYSCALL);
+ command.add(LTTngControlServiceConstants.OPTION_SYSCALL);
- executeCommand(command.toString(), monitor);
+ executeCommand(command, monitor);
}
@Override
public void enableProbe(String sessionName, String channelName, String eventName, boolean isFunction, String probe, IProgressMonitor monitor) throws ExecutionException {
- StringBuffer command = createCommand(LTTngControlServiceConstants.COMMAND_ENABLE_EVENT);
+ List<String> command = createCommand(LTTngControlServiceConstants.COMMAND_ENABLE_EVENT);
- command.append(eventName);
- command.append(LTTngControlServiceConstants.OPTION_KERNEL);
+ command.add(eventName);
+ command.add(LTTngControlServiceConstants.OPTION_KERNEL);
- String newSessionName = formatParameter(sessionName);
- command.append(LTTngControlServiceConstants.OPTION_SESSION);
- command.append(newSessionName);
+ command.add(LTTngControlServiceConstants.OPTION_SESSION);
+ command.add(sessionName);
if (channelName != null) {
- command.append(LTTngControlServiceConstants.OPTION_CHANNEL);
- command.append(channelName);
+ command.add(LTTngControlServiceConstants.OPTION_CHANNEL);
+ command.add(channelName);
}
if (isFunction) {
- command.append(LTTngControlServiceConstants.OPTION_FUNCTION_PROBE);
+ command.add(LTTngControlServiceConstants.OPTION_FUNCTION_PROBE);
} else {
- command.append(LTTngControlServiceConstants.OPTION_PROBE);
+ command.add(LTTngControlServiceConstants.OPTION_PROBE);
}
- command.append(probe);
+ command.add(probe);
- executeCommand(command.toString(), monitor);
+ executeCommand(command, monitor);
}
@Override
public void enableLogLevel(String sessionName, String channelName, String eventName, LogLevelType logLevelType, TraceLogLevel level, String filterExpression, IProgressMonitor monitor) throws ExecutionException {
- StringBuffer command = createCommand(LTTngControlServiceConstants.COMMAND_ENABLE_EVENT);
+ List<String> command = createCommand(LTTngControlServiceConstants.COMMAND_ENABLE_EVENT);
- command.append(eventName);
- command.append(LTTngControlServiceConstants.OPTION_UST);
+ command.add(eventName);
+ command.add(LTTngControlServiceConstants.OPTION_UST);
- String newSessionName = formatParameter(sessionName);
- command.append(LTTngControlServiceConstants.OPTION_SESSION);
- command.append(newSessionName);
+ command.add(LTTngControlServiceConstants.OPTION_SESSION);
+ command.add(sessionName);
if (channelName != null) {
- command.append(LTTngControlServiceConstants.OPTION_CHANNEL);
- command.append(channelName);
+ command.add(LTTngControlServiceConstants.OPTION_CHANNEL);
+ command.add(channelName);
}
if (logLevelType == LogLevelType.LOGLEVEL) {
- command.append(LTTngControlServiceConstants.OPTION_LOGLEVEL);
+ command.add(LTTngControlServiceConstants.OPTION_LOGLEVEL);
} else if (logLevelType == LogLevelType.LOGLEVEL_ONLY) {
- command.append(LTTngControlServiceConstants.OPTION_LOGLEVEL_ONLY);
+ command.add(LTTngControlServiceConstants.OPTION_LOGLEVEL_ONLY);
} else {
return;
}
- command.append(level.getInName());
+ command.add(level.getInName());
- executeCommand(command.toString(), monitor);
+ executeCommand(command, monitor);
}
@Override
public void disableEvent(String sessionName, String channelName, List<String> eventNames, boolean isKernel, IProgressMonitor monitor) throws ExecutionException {
- StringBuffer command = createCommand(LTTngControlServiceConstants.COMMAND_DISABLE_EVENT);
+ List<String> command = createCommand(LTTngControlServiceConstants.COMMAND_DISABLE_EVENT);
if (eventNames == null) {
- command.append(LTTngControlServiceConstants.OPTION_ALL);
+ command.add(LTTngControlServiceConstants.OPTION_ALL);
} else {
// no events to disable
if (eventNames.isEmpty()) {
@@ -937,33 +907,32 @@ public class LTTngControlService implements ILttngControlService {
eventNameParameter.append(',');
}
}
- command.append(formatParameter(eventNameParameter.toString()));
+ command.add(eventNameParameter.toString());
}
if (isKernel) {
- command.append(LTTngControlServiceConstants.OPTION_KERNEL);
+ command.add(LTTngControlServiceConstants.OPTION_KERNEL);
} else {
- command.append(LTTngControlServiceConstants.OPTION_UST);
+ command.add(LTTngControlServiceConstants.OPTION_UST);
}
- String newSessionName = formatParameter(sessionName);
- command.append(LTTngControlServiceConstants.OPTION_SESSION);
- command.append(newSessionName);
+ command.add(LTTngControlServiceConstants.OPTION_SESSION);
+ command.add(sessionName);
if (channelName != null) {
- command.append(LTTngControlServiceConstants.OPTION_CHANNEL);
- command.append(channelName);
+ command.add(LTTngControlServiceConstants.OPTION_CHANNEL);
+ command.add(channelName);
}
- executeCommand(command.toString(), monitor);
+ executeCommand(command, monitor);
}
@Override
public List<String> getContextList(IProgressMonitor monitor) throws ExecutionException {
- StringBuffer command = createCommand(LTTngControlServiceConstants.COMMAND_ADD_CONTEXT, LTTngControlServiceConstants.OPTION_HELP);
+ List<String> command = createCommand(LTTngControlServiceConstants.COMMAND_ADD_CONTEXT, LTTngControlServiceConstants.OPTION_HELP);
- ICommandResult result = executeCommand(command.toString(), monitor);
+ ICommandResult result = executeCommand(command, monitor);
String[] output = result.getOutput();
@@ -994,76 +963,81 @@ public class LTTngControlService implements ILttngControlService {
@Override
public void addContexts(String sessionName, String channelName, String eventName, boolean isKernel, List<String> contextNames, IProgressMonitor monitor) throws ExecutionException {
- StringBuffer command = createCommand(LTTngControlServiceConstants.COMMAND_ADD_CONTEXT);
+ List<String> command = createCommand(LTTngControlServiceConstants.COMMAND_ADD_CONTEXT);
- String newSessionName = formatParameter(sessionName);
- command.append(LTTngControlServiceConstants.OPTION_SESSION);
- command.append(newSessionName);
+ command.add(LTTngControlServiceConstants.OPTION_SESSION);
+ command.add(sessionName);
if (channelName != null) {
- command.append(LTTngControlServiceConstants.OPTION_CHANNEL);
- command.append(channelName);
+ command.add(LTTngControlServiceConstants.OPTION_CHANNEL);
+ command.add(channelName);
}
if (eventName != null) {
- command.append(LTTngControlServiceConstants.OPTION_EVENT);
- command.append(eventName);
+ command.add(LTTngControlServiceConstants.OPTION_EVENT);
+ command.add(eventName);
}
if (isKernel) {
- command.append(LTTngControlServiceConstants.OPTION_KERNEL);
+ command.add(LTTngControlServiceConstants.OPTION_KERNEL);
} else {
- command.append(LTTngControlServiceConstants.OPTION_UST);
+ command.add(LTTngControlServiceConstants.OPTION_UST);
}
for (Iterator<String> iterator = contextNames.iterator(); iterator.hasNext();) {
String context = iterator.next();
- command.append(LTTngControlServiceConstants.OPTION_CONTEXT_TYPE);
- command.append(context);
+ command.add(LTTngControlServiceConstants.OPTION_CONTEXT_TYPE);
+ command.add(context);
}
- executeCommand(command.toString(), monitor);
+ executeCommand(command, monitor);
}
@Override
public void calibrate(boolean isKernel, IProgressMonitor monitor) throws ExecutionException {
- StringBuffer command = createCommand(LTTngControlServiceConstants.COMMAND_CALIBRATE);
+ List<String> command = createCommand(LTTngControlServiceConstants.COMMAND_CALIBRATE);
if (isKernel) {
- command.append(LTTngControlServiceConstants.OPTION_KERNEL);
+ command.add(LTTngControlServiceConstants.OPTION_KERNEL);
} else {
- command.append(LTTngControlServiceConstants.OPTION_UST);
+ command.add(LTTngControlServiceConstants.OPTION_UST);
}
- command.append(LTTngControlServiceConstants.OPTION_FUNCTION_PROBE);
+ command.add(LTTngControlServiceConstants.OPTION_FUNCTION_PROBE);
- executeCommand(command.toString(), monitor);
+ executeCommand(command, monitor);
}
@Override
public void recordSnapshot(String sessionName, IProgressMonitor monitor)
throws ExecutionException {
- StringBuffer command = createCommand(LTTngControlServiceConstants.COMMAND_RECORD_SNAPSHOT);
+ List<String> command = createCommand(LTTngControlServiceConstants.COMMAND_SNAPSHOT, LTTngControlServiceConstants.COMMAND_RECORD_SNAPSHOT);
- String newSessionName = formatParameter(sessionName);
- command.append(LTTngControlServiceConstants.OPTION_SESSION);
- command.append(newSessionName);
+ String newSessionName = sessionName;
+ command.add(LTTngControlServiceConstants.OPTION_SESSION);
+ command.add(newSessionName);
- executeCommand(command.toString(), monitor);
+ executeCommand(command, monitor);
}
@Override
- public void runCommands(IProgressMonitor monitor, List<String> commands) throws ExecutionException {
- for (String command : commands) {
+ public void runCommands(IProgressMonitor monitor, List<String> commandLines) throws ExecutionException {
+ for (String commandLine : commandLines) {
if (monitor.isCanceled()) {
return;
}
- if (command.isEmpty() || command.startsWith("#")) { //$NON-NLS-1$
+ if (commandLine.isEmpty() || commandLine.startsWith("#")) { //$NON-NLS-1$
continue;
}
- executeCommand(command, monitor);
+ String[] args = commandLine.split("\\s+"); //$NON-NLS-1$
+ List<String> command = Arrays.asList(args);
+ ICommandResult result = executeCommand(command, monitor);
+
+ if (isError(result)) {
+ throw new ExecutionException(Messages.TraceControl_CommandError + " " + toCommandString(command) + "\n" + formatOutput(result)); //$NON-NLS-1$ //$NON-NLS-2$
+ }
}
}
@@ -1127,6 +1101,38 @@ public class LTTngControlService implements ILttngControlService {
}
/**
+ * Creates a single command string from a command line list.
+ * @param command
+ * command line list
+ * @return single command string
+ */
+ public static String toCommandString(List<String> command) {
+ StringBuilder builder = new StringBuilder();
+ for (String segment : command) {
+ builder.append(segment).append(' ');
+ }
+ return builder.toString().trim();
+ }
+
+ /**
+ * Creates a comma separated string from list of names
+ * @param names
+ * List of name to convert
+ * @return comma separated string
+ */
+ protected String toCsv(List<String> names) {
+ StringBuilder csvString = new StringBuilder();
+ for (Iterator<String> iterator = names.iterator(); iterator.hasNext();) {
+ String name = iterator.next();
+ csvString.append(name);
+ if (iterator.hasNext()) {
+ csvString.append(',');
+ }
+ }
+ return csvString.toString();
+ }
+
+ /**
* Parses the domain information.
*
* @param output
@@ -1459,39 +1465,23 @@ public class LTTngControlService implements ILttngControlService {
}
/**
- * Formats a command parameter for the command execution i.e. adds quotes at
- * the beginning and end if necessary.
- *
- * @param parameter
- * - parameter to format
- * @return formated parameter
- */
- protected String formatParameter(String parameter) {
- if (parameter != null) {
- StringBuffer newString = new StringBuffer();
- newString.append(parameter);
-
- if (parameter.contains(" ") || parameter.contains("*")) { //$NON-NLS-1$ //$NON-NLS-2$
- newString.insert(0, "\""); //$NON-NLS-1$
- newString.append("\""); //$NON-NLS-1$
- }
- return newString.toString();
- }
- return null;
- }
-
- /**
* @param strings
* array of string that makes up a command line
* @return string buffer with created command line
*/
- protected StringBuffer createCommand(String... strings) {
- StringBuffer command = new StringBuffer();
- command.append(LTTngControlServiceConstants.CONTROL_COMMAND);
- command.append(getTracingGroupOption());
- command.append(getVerboseOption());
+ protected List<String> createCommand(String... strings) {
+ List<String> command = new ArrayList<>();
+ command.add(LTTngControlServiceConstants.CONTROL_COMMAND);
+ String groupOption = getTracingGroupOption();
+ if (!groupOption.isEmpty()) {
+ command.add(groupOption);
+ }
+ String verboseOption = getVerboseOption();
+ if (!verboseOption.isEmpty()) {
+ command.add(verboseOption);
+ }
for (String string : strings) {
- command.append(string);
+ command.add(string);
}
return command;
}
@@ -1537,7 +1527,7 @@ public class LTTngControlService implements ILttngControlService {
* @throws ExecutionException
* If the command fails
*/
- protected ICommandResult executeCommand(String command,
+ protected ICommandResult executeCommand(List<String> command,
IProgressMonitor monitor) throws ExecutionException {
return executeCommand(command, monitor, true);
}
@@ -1556,11 +1546,11 @@ public class LTTngControlService implements ILttngControlService {
* @throws ExecutionException
* in case of error result
*/
- protected ICommandResult executeCommand(String command,
+ protected ICommandResult executeCommand(List<String> command,
IProgressMonitor monitor, boolean checkForError)
throws ExecutionException {
if (ControlPreferences.getInstance().isLoggingEnabled()) {
- ControlCommandLogger.log(command);
+ ControlCommandLogger.log(toCommandString(command));
}
ICommandResult result = fCommandShell.executeCommand(command, monitor);
@@ -1571,7 +1561,7 @@ public class LTTngControlService implements ILttngControlService {
if (checkForError && isError(result)) {
throw new ExecutionException(Messages.TraceControl_CommandError
- + " " + command.toString() + "\n" + formatOutput(result)); //$NON-NLS-1$ //$NON-NLS-2$
+ + " " + toCommandString(command) + "\n" + formatOutput(result)); //$NON-NLS-1$ //$NON-NLS-2$
}
return result;
diff --git a/lttng/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/service/LTTngControlServiceConstants.java b/lttng/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/service/LTTngControlServiceConstants.java
index bd5856e92d..f0d842ae0a 100644
--- a/lttng/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/service/LTTngControlServiceConstants.java
+++ b/lttng/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/service/LTTngControlServiceConstants.java
@@ -64,75 +64,71 @@ public interface LTTngControlServiceConstants {
/**
* The lttng tools machine interface command.
*/
- static final String CONTROL_COMMAND_MI = CONTROL_COMMAND + " --mi"; //$NON-NLS-1$
+ static final String CONTROL_COMMAND_MI_OPTION = "--mi"; //$NON-NLS-1$
/**
* The lttng tools XML machine interface command.
*/
- static final String CONTROL_COMMAND_MI_XML = CONTROL_COMMAND_MI + " xml"; //$NON-NLS-1$
+ static final String CONTROL_COMMAND_MI_XML = "xml"; //$NON-NLS-1$
/**
* Command: lttng version.
*/
- static final String COMMAND_VERSION = " version "; //$NON-NLS-1$
+ static final String COMMAND_VERSION = "version"; //$NON-NLS-1$
/**
* Command: lttng list.
*/
- static final String COMMAND_LIST = " list "; //$NON-NLS-1$
- /**
- * Command to list kernel tracer information.
- */
- static final String COMMAND_LIST_KERNEL = COMMAND_LIST + "-k"; //$NON-NLS-1$
- /**
- * Command to list user space trace information.
- */
- static final String COMMAND_LIST_UST = COMMAND_LIST + "-u"; //$NON-NLS-1$
+ static final String COMMAND_LIST = "list"; //$NON-NLS-1$
/**
* Command to create a session.
*/
- static final String COMMAND_CREATE_SESSION = " create "; //$NON-NLS-1$
+ static final String COMMAND_CREATE_SESSION = "create"; //$NON-NLS-1$
/**
* Command to destroy a session.
*/
- static final String COMMAND_DESTROY_SESSION = " destroy "; //$NON-NLS-1$
+ static final String COMMAND_DESTROY_SESSION = "destroy"; //$NON-NLS-1$
/**
* Command to destroy a session.
*/
- static final String COMMAND_START_SESSION = " start "; //$NON-NLS-1$
+ static final String COMMAND_START_SESSION = "start"; //$NON-NLS-1$
/**
* Command to destroy a session.
*/
- static final String COMMAND_STOP_SESSION = " stop "; //$NON-NLS-1$
+ static final String COMMAND_STOP_SESSION = "stop"; //$NON-NLS-1$
/**
* Command to enable a channel.
*/
- static final String COMMAND_ENABLE_CHANNEL = " enable-channel "; //$NON-NLS-1$
+ static final String COMMAND_ENABLE_CHANNEL = "enable-channel"; //$NON-NLS-1$
/**
* Command to disable a channel.
*/
- static final String COMMAND_DISABLE_CHANNEL = " disable-channel "; //$NON-NLS-1$
+ static final String COMMAND_DISABLE_CHANNEL = "disable-channel"; //$NON-NLS-1$
/**
* Command to enable a event.
*/
- static final String COMMAND_ENABLE_EVENT = " enable-event "; //$NON-NLS-1$
+ static final String COMMAND_ENABLE_EVENT = "enable-event"; //$NON-NLS-1$
/**
* Command to disable a event.
*/
- static final String COMMAND_DISABLE_EVENT = " disable-event "; //$NON-NLS-1$
+ static final String COMMAND_DISABLE_EVENT = "disable-event"; //$NON-NLS-1$
/**
* Command to add a context to channels and/or events
*/
- static final String COMMAND_ADD_CONTEXT = " add-context "; //$NON-NLS-1$
+ static final String COMMAND_ADD_CONTEXT = "add-context"; //$NON-NLS-1$
+ /**
+ * Command to execute calibrate command to quantify LTTng overhead
+ */
+ static final String COMMAND_CALIBRATE = "calibrate"; //$NON-NLS-1$
/**
* Command to execute calibrate command to quantify LTTng overhead
*/
- static final String COMMAND_CALIBRATE = " calibrate "; //$NON-NLS-1$
+ static final String COMMAND_SNAPSHOT = "snapshot"; //$NON-NLS-1$
/**
* Command to execute calibrate command to quantify LTTng overhead
*/
- static final String COMMAND_LIST_SNAPSHOT_OUTPUT = " snapshot list-output "; //$NON-NLS-1$
+ static final String COMMAND_LIST_SNAPSHOT_OUTPUT = "list-output"; //$NON-NLS-1$
/**
* Command to execute calibrate command to quantify LTTng overhead
*/
- static final String COMMAND_RECORD_SNAPSHOT = " snapshot record "; //$NON-NLS-1$
+ static final String COMMAND_RECORD_SNAPSHOT = "record"; //$NON-NLS-1$
// ------------------------------------------------------------------------
// Command line options constants
@@ -140,143 +136,143 @@ public interface LTTngControlServiceConstants {
/**
* Command line option to add tracing group of user.
*/
- static final String OPTION_TRACING_GROUP = " -g "; //$NON-NLS-1$
+ static final String OPTION_TRACING_GROUP = "-g"; //$NON-NLS-1$
/**
* Command line option for verbose output.
*/
- static final String OPTION_VERBOSE = " -v "; //$NON-NLS-1$
+ static final String OPTION_VERBOSE = "-v"; //$NON-NLS-1$
/**
* Command line option for verbose output.
*/
- static final String OPTION_VERY_VERBOSE = " -vv "; //$NON-NLS-1$
+ static final String OPTION_VERY_VERBOSE = "-vv"; //$NON-NLS-1$
/**
* Command line option for verbose output.
*/
- static final String OPTION_VERY_VERY_VERBOSE = " -vvv "; //$NON-NLS-1$
+ static final String OPTION_VERY_VERY_VERBOSE = "-vvv"; //$NON-NLS-1$
/**
* Command line option for output path.
*/
- static final String OPTION_OUTPUT_PATH = " -o "; //$NON-NLS-1$
+ static final String OPTION_OUTPUT_PATH = "-o"; //$NON-NLS-1$
/**
* Command line option for output path.
*/
- static final String OPTION_SNAPSHOT = " --snapshot "; //$NON-NLS-1$
+ static final String OPTION_SNAPSHOT = "--snapshot"; //$NON-NLS-1$
/**
* Command line option for live
*/
- static final String OPTION_LIVE = " --live "; //$NON-NLS-1$
+ static final String OPTION_LIVE = "--live"; //$NON-NLS-1$
/**
* Command line option for kernel tracer.
*/
- static final String OPTION_KERNEL = " -k "; //$NON-NLS-1$
+ static final String OPTION_KERNEL = "-k"; //$NON-NLS-1$
/**
* Command line option for UST tracer.
*/
- static final String OPTION_UST = " -u "; //$NON-NLS-1$
+ static final String OPTION_UST = "-u"; //$NON-NLS-1$
/**
* Command line option for specifying a session.
*/
- static final String OPTION_SESSION = " -s "; //$NON-NLS-1$
+ static final String OPTION_SESSION = "-s"; //$NON-NLS-1$
/**
* Command line option for specifying a channel.
*/
- static final String OPTION_CHANNEL = " -c "; //$NON-NLS-1$
+ static final String OPTION_CHANNEL = "-c"; //$NON-NLS-1$
/**
* Command line option for specifying a event.
*/
- static final String OPTION_EVENT = " -e "; //$NON-NLS-1$
+ static final String OPTION_EVENT = "-e"; //$NON-NLS-1$
/**
* Command line option for specifying all events.
*/
- static final String OPTION_ALL = " -a "; //$NON-NLS-1$
+ static final String OPTION_ALL = "-a"; //$NON-NLS-1$
/**
* Command line option for specifying a context.
*/
- static final String OPTION_CONTEXT_TYPE = " -t "; //$NON-NLS-1$
+ static final String OPTION_CONTEXT_TYPE = "-t"; //$NON-NLS-1$
/**
* Command line option for specifying tracepoint events.
*/
- static final String OPTION_TRACEPOINT = " --tracepoint "; //$NON-NLS-1$
+ static final String OPTION_TRACEPOINT = "--tracepoint"; //$NON-NLS-1$
/**
* Command line option for specifying syscall events.
*/
- static final String OPTION_SYSCALL = " --syscall "; //$NON-NLS-1$
+ static final String OPTION_SYSCALL = "--syscall"; //$NON-NLS-1$
/**
* Command line option for specifying a dynamic probe.
*/
- static final String OPTION_PROBE = " --probe "; //$NON-NLS-1$
+ static final String OPTION_PROBE = "--probe"; //$NON-NLS-1$
/**
* Command line option for specifying a dynamic function entry/return probe.
*/
- static final String OPTION_FUNCTION_PROBE = " --function "; //$NON-NLS-1$
+ static final String OPTION_FUNCTION_PROBE = "--function"; //$NON-NLS-1$
/**
* Command line option for specifying a log level range.
*/
- static final String OPTION_LOGLEVEL = " --loglevel "; //$NON-NLS-1$
+ static final String OPTION_LOGLEVEL = "--loglevel"; //$NON-NLS-1$
/**
* Command line option for specifying a specific log level.
*/
- static final String OPTION_LOGLEVEL_ONLY = " --loglevel-only "; //$NON-NLS-1$
+ static final String OPTION_LOGLEVEL_ONLY = "--loglevel-only"; //$NON-NLS-1$
/**
* Optional command line option for configuring a channel's overwrite mode.
*/
- static final String OPTION_OVERWRITE = " --overwrite "; //$NON-NLS-1$
+ static final String OPTION_OVERWRITE = "--overwrite"; //$NON-NLS-1$
/**
* Optional command line option for configuring a channel's number of sub buffers.
*/
- static final String OPTION_NUM_SUB_BUFFERS = " --num-subbuf "; //$NON-NLS-1$
+ static final String OPTION_NUM_SUB_BUFFERS = "--num-subbuf"; //$NON-NLS-1$
/**
* Optional command line option for configuring a channel's sub buffer size.
*/
- static final String OPTION_SUB_BUFFER_SIZE = " --subbuf-size "; //$NON-NLS-1$
+ static final String OPTION_SUB_BUFFER_SIZE = "--subbuf-size"; //$NON-NLS-1$
/**
* Optional command line option for configuring a channel's switch timer interval.
*/
- static final String OPTION_SWITCH_TIMER = " --switch-timer "; //$NON-NLS-1$
+ static final String OPTION_SWITCH_TIMER = "--switch-timer"; //$NON-NLS-1$
/**
* Optional command line option for configuring a channel's read timer interval.
*/
- static final String OPTION_READ_TIMER = " --read-timer "; //$NON-NLS-1$
+ static final String OPTION_READ_TIMER = "--read-timer"; //$NON-NLS-1$
/**
* Command line option for printing the help of a specif command
*/
- static final String OPTION_HELP = " -h "; //$NON-NLS-1$
+ static final String OPTION_HELP = "-h"; //$NON-NLS-1$
/**
* Command line option for listing the fields of UST tracepoints
*/
- static final String OPTION_FIELDS = " -f "; //$NON-NLS-1$
+ static final String OPTION_FIELDS = "-f"; //$NON-NLS-1$
/**
* Command line option for configuring event's filter
*/
- static final String OPTION_FILTER = " --filter "; //$NON-NLS-1$
+ static final String OPTION_FILTER = "--filter"; //$NON-NLS-1$
/**
* Command line option for configuring the streaming network URL (common for control and data channel).
*/
- static final String OPTION_NETWORK_URL = " -U "; //$NON-NLS-1$
+ static final String OPTION_NETWORK_URL = "-U"; //$NON-NLS-1$
/**
* Command line option for configuring the streaming control URL.
*/
- static final String OPTION_CONTROL_URL = " -C "; //$NON-NLS-1$
+ static final String OPTION_CONTROL_URL = "-C"; //$NON-NLS-1$
/**
* Command line option for configuring the streaming data URL.
*/
- static final String OPTION_DATA_URL = " -D "; //$NON-NLS-1$
+ static final String OPTION_DATA_URL = "-D"; //$NON-NLS-1$
/**
* Command line option for per UID buffers
*/
- static final String OPTION_PER_UID_BUFFERS = " --buffers-uid "; //$NON-NLS-1$
+ static final String OPTION_PER_UID_BUFFERS = "--buffers-uid"; //$NON-NLS-1$
/**
* Command line option for per PID buffers
*/
- static final String OPTION_PER_PID_BUFFERS = " --buffers-pid "; //$NON-NLS-1$
+ static final String OPTION_PER_PID_BUFFERS = "--buffers-pid"; //$NON-NLS-1$
/**
* Command line option for maximum size of trace files
*/
- static final String OPTION_MAX_SIZE_TRACE_FILES = " -C "; //$NON-NLS-1$
+ static final String OPTION_MAX_SIZE_TRACE_FILES = "-C"; //$NON-NLS-1$
/**
* Command line option for maximum trace files
*/
- static final String OPTION_MAX_TRACE_FILES = " -W "; //$NON-NLS-1$
+ static final String OPTION_MAX_TRACE_FILES = "-W"; //$NON-NLS-1$
// ------------------------------------------------------------------------
// Parsing constants
diff --git a/lttng/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/service/LTTngControlServiceFactory.java b/lttng/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/service/LTTngControlServiceFactory.java
index 2ac956b86a..8198be114f 100644
--- a/lttng/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/service/LTTngControlServiceFactory.java
+++ b/lttng/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/service/LTTngControlServiceFactory.java
@@ -12,6 +12,8 @@
**********************************************************************/
package org.eclipse.linuxtools.internal.lttng2.control.ui.views.service;
+import java.util.ArrayList;
+import java.util.List;
import java.util.regex.Matcher;
import org.eclipse.core.commands.ExecutionException;
@@ -76,12 +78,19 @@ public class LTTngControlServiceFactory {
public ILttngControlService getLttngControlService(ICommandShell shell) throws ExecutionException {
// get the version
boolean machineInterfaceMode = true;
- String command = LTTngControlServiceConstants.CONTROL_COMMAND + LTTngControlServiceConstants.COMMAND_VERSION;
- String commandMi = LTTngControlServiceConstants.CONTROL_COMMAND_MI_XML + LTTngControlServiceConstants.COMMAND_VERSION;
+ List<String> command = new ArrayList<>();
+ command.add(LTTngControlServiceConstants.CONTROL_COMMAND);
+ command.add(LTTngControlServiceConstants.COMMAND_VERSION);
+
+ List<String> commandMi = new ArrayList<>();
+ commandMi.add(LTTngControlServiceConstants.CONTROL_COMMAND);
+ commandMi.add(LTTngControlServiceConstants.CONTROL_COMMAND_MI_OPTION);
+ commandMi.add(LTTngControlServiceConstants.CONTROL_COMMAND_MI_XML);
+ commandMi.add(LTTngControlServiceConstants.COMMAND_VERSION);
// Logging
if (ControlPreferences.getInstance().isLoggingEnabled()) {
- ControlCommandLogger.log(commandMi);
+ ControlCommandLogger.log(LTTngControlService.toCommandString(commandMi));
}
ICommandResult result = null;
@@ -104,7 +113,7 @@ public class LTTngControlServiceFactory {
// Logging
if (ControlPreferences.getInstance().isLoggingEnabled()) {
- ControlCommandLogger.log(command);
+ ControlCommandLogger.log(LTTngControlService.toCommandString(command));
}
try {
diff --git a/lttng/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/service/LTTngControlServiceMI.java b/lttng/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/service/LTTngControlServiceMI.java
index 8bb18a5613..80879ba2f3 100644
--- a/lttng/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/service/LTTngControlServiceMI.java
+++ b/lttng/org.eclipse.linuxtools.lttng2.control.ui/src/org/eclipse/linuxtools/internal/lttng2/control/ui/views/service/LTTngControlServiceMI.java
@@ -198,8 +198,8 @@ public class LTTngControlServiceMI extends LTTngControlService {
@Override
public String[] getSessionNames(IProgressMonitor monitor) throws ExecutionException {
- StringBuffer command = createCommand(LTTngControlServiceConstants.COMMAND_LIST);
- ICommandResult result = executeCommand(command.toString(), monitor);
+ List<String> command = createCommand(LTTngControlServiceConstants.COMMAND_LIST);
+ ICommandResult result = executeCommand(command, monitor);
Document doc = getDocumentFromStrings(result.getOutput());
@@ -217,8 +217,8 @@ public class LTTngControlServiceMI extends LTTngControlService {
@Override
public ISessionInfo getSession(String sessionName, IProgressMonitor monitor) throws ExecutionException {
- StringBuffer command = createCommand(LTTngControlServiceConstants.COMMAND_LIST, sessionName);
- ICommandResult result = executeCommand(command.toString(), monitor);
+ List<String> command = createCommand(LTTngControlServiceConstants.COMMAND_LIST, sessionName);
+ ICommandResult result = executeCommand(command, monitor);
ISessionInfo sessionInfo = new SessionInfo(sessionName);
Document document = getDocumentFromStrings(result.getOutput());
@@ -453,8 +453,8 @@ public class LTTngControlServiceMI extends LTTngControlService {
// Currently the SessionInfo object does not support multiple snashot
// output.
// For now only keep the last one.
- StringBuffer command = createCommand(LTTngControlServiceConstants.COMMAND_LIST_SNAPSHOT_OUTPUT, LTTngControlServiceConstants.OPTION_SESSION, sessionName);
- ICommandResult result = executeCommand(command.toString(), monitor);
+ List<String> command = createCommand(LTTngControlServiceConstants.COMMAND_SNAPSHOT, LTTngControlServiceConstants.COMMAND_LIST_SNAPSHOT_OUTPUT, LTTngControlServiceConstants.OPTION_SESSION, sessionName);
+ ICommandResult result = executeCommand(command, monitor);
Document doc = getDocumentFromStrings(result.getOutput());
NodeList rawSnapshotsOutputs = doc.getElementsByTagName(MIStrings.SNAPSHOT_OUTPUTS);
@@ -496,8 +496,8 @@ public class LTTngControlServiceMI extends LTTngControlService {
@Override
public List<IBaseEventInfo> getKernelProvider(IProgressMonitor monitor) throws ExecutionException {
- StringBuffer command = createCommand(LTTngControlServiceConstants.COMMAND_LIST_KERNEL);
- ICommandResult result = executeCommand(command.toString(), monitor, false);
+ List<String> command = createCommand(LTTngControlServiceConstants.COMMAND_LIST, LTTngControlServiceConstants.OPTION_KERNEL);
+ ICommandResult result = executeCommand(command, monitor, false);
List<IBaseEventInfo> events = new ArrayList<>();
if (isError(result) && result.getErrorOutput() != null) {
@@ -509,7 +509,7 @@ public class LTTngControlServiceMI extends LTTngControlService {
if (ignoredPattern(result.getErrorOutput(), LTTngControlServiceConstants.LIST_KERNEL_NO_KERNEL_PROVIDER_PATTERN)) {
return events;
}
- throw new ExecutionException(Messages.TraceControl_CommandError + LTTngControlServiceConstants.COMMAND_LIST_KERNEL);
+ throw new ExecutionException(Messages.TraceControl_CommandError + toCommandString(command));
}
Document document = getDocumentFromStrings(result.getOutput());
@@ -520,12 +520,12 @@ public class LTTngControlServiceMI extends LTTngControlService {
@Override
public List<IUstProviderInfo> getUstProvider(IProgressMonitor monitor) throws ExecutionException {
- StringBuffer command = createCommand(LTTngControlServiceConstants.COMMAND_LIST_UST);
+ List<String> command = createCommand(LTTngControlServiceConstants.COMMAND_LIST, LTTngControlServiceConstants.OPTION_UST);
// Get the field to
- command.append(LTTngControlServiceConstants.OPTION_FIELDS);
+ command.add(LTTngControlServiceConstants.OPTION_FIELDS);
// Execute
- ICommandResult result = executeCommand(command.toString(), monitor, false);
+ ICommandResult result = executeCommand(command, monitor, false);
List<IUstProviderInfo> allProviders = new ArrayList<>();
if (isError(result) && result.getErrorOutput() != null) {
@@ -537,7 +537,7 @@ public class LTTngControlServiceMI extends LTTngControlService {
if (ignoredPattern(result.getErrorOutput(), LTTngControlServiceConstants.LIST_UST_NO_UST_PROVIDER_PATTERN)) {
return allProviders;
}
- throw new ExecutionException(Messages.TraceControl_CommandError + LTTngControlServiceConstants.COMMAND_LIST_UST);
+ throw new ExecutionException(Messages.TraceControl_CommandError + toCommandString(command));
}
Document document = getDocumentFromStrings(result.getOutput());
@@ -583,9 +583,9 @@ public class LTTngControlServiceMI extends LTTngControlService {
return createStreamedSession(sessionInfo, monitor);
}
- StringBuffer command = prepareSessionCreationCommand(sessionInfo);
+ List<String> command = prepareSessionCreationCommand(sessionInfo);
- ICommandResult result = executeCommand(command.toString(), monitor);
+ ICommandResult result = executeCommand(command, monitor);
Document document = getDocumentFromStrings(result.getOutput());
NodeList sessions = document.getElementsByTagName(MIStrings.SESSION);
@@ -626,9 +626,9 @@ public class LTTngControlServiceMI extends LTTngControlService {
private ISessionInfo createStreamedSession(ISessionInfo sessionInfo, IProgressMonitor monitor) throws ExecutionException {
- StringBuffer command = prepareStreamedSessionCreationCommand(sessionInfo);
+ List<String> command = prepareStreamedSessionCreationCommand(sessionInfo);
- ICommandResult result = executeCommand(command.toString(), monitor);
+ ICommandResult result = executeCommand(command, monitor);
Document document = getDocumentFromStrings(result.getOutput());
NodeList sessions = document.getElementsByTagName(MIStrings.SESSION);
@@ -682,11 +682,9 @@ public class LTTngControlServiceMI extends LTTngControlService {
@Override
public void destroySession(String sessionName, IProgressMonitor monitor) throws ExecutionException {
- String newName = formatParameter(sessionName);
+ List<String> command = createCommand(LTTngControlServiceConstants.COMMAND_DESTROY_SESSION, sessionName);
- StringBuffer command = createCommand(LTTngControlServiceConstants.COMMAND_DESTROY_SESSION, newName);
-
- ICommandResult result = executeCommand(command.toString(), monitor, false);
+ ICommandResult result = executeCommand(command, monitor, false);
String[] errorOutput = result.getErrorOutput();
if (isError(result) && (errorOutput != null)) {
@@ -695,7 +693,7 @@ public class LTTngControlServiceMI extends LTTngControlService {
return;
}
- throw new ExecutionException(Messages.TraceControl_CommandError + " " + command.toString() + "\n" + formatOutput(result)); //$NON-NLS-1$ //$NON-NLS-2$
+ throw new ExecutionException(Messages.TraceControl_CommandError + " " + toCommandString(command) + "\n" + formatOutput(result)); //$NON-NLS-1$ //$NON-NLS-2$
}
// Check for action effect
@@ -722,12 +720,17 @@ public class LTTngControlServiceMI extends LTTngControlService {
* @return string buffer with created command line
*/
@Override
- protected StringBuffer createCommand(String... strings) {
- StringBuffer command = new StringBuffer();
- command.append(LTTngControlServiceConstants.CONTROL_COMMAND_MI_XML);
- command.append(getTracingGroupOption());
+ protected List<String> createCommand(String... strings) {
+ List<String> command = new ArrayList<>();
+ command.add(LTTngControlServiceConstants.CONTROL_COMMAND);
+ command.add(LTTngControlServiceConstants.CONTROL_COMMAND_MI_OPTION);
+ command.add(LTTngControlServiceConstants.CONTROL_COMMAND_MI_XML);
+ String groupOption = getTracingGroupOption();
+ if (!groupOption.isEmpty()) {
+ command.add(groupOption);
+ }
for (String string : strings) {
- command.append(string);
+ command.add(string);
}
return command;
}

Back to the top