aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBernd Hufmann2013-03-12 13:49:13 (EDT)
committerBernd Hufmann2013-03-12 14:46:19 (EDT)
commit4deb95970c6411f2c5bdce9eb8bb1ede0138ef7e (patch)
treef046b4c9563b275f01f8fd7f26374b564c52c972
parent80aa184fd2bf6ca582b781c0fbff7fe65e0ca481 (diff)
downloadorg.eclipse.linuxtools-4deb95970c6411f2c5bdce9eb8bb1ede0138ef7e.zip
org.eclipse.linuxtools-4deb95970c6411f2c5bdce9eb8bb1ede0138ef7e.tar.gz
org.eclipse.linuxtools-4deb95970c6411f2c5bdce9eb8bb1ede0138ef7e.tar.bz2
lttng: add command execution timeout preferencerefs/changes/86/11086/3
Change-Id: Ia3b09ad1260517ead01c53dd21cfa97a0484ad03 Signed-off-by: Bernd Hufmann <bhufmann@gmail.com> Reviewed-on: https://git.eclipse.org/r/11086 Reviewed-by: Patrick Tasse <patrick.tasse@gmail.com> IP-Clean: Patrick Tasse <patrick.tasse@gmail.com> Tested-by: Hudson CI
-rw-r--r--lttng/org.eclipse.linuxtools.lttng.help/doc/User-Guide.mediawiki10
-rw-r--r--lttng/org.eclipse.linuxtools.lttng.help/doc/images/LTTng2Preferences.pngbin51508 -> 55997 bytes
-rw-r--r--lttng/org.eclipse.linuxtools.lttng.help/doc/images/LTTng2PreferencesGroup.pngbin47469 -> 56717 bytes
-rw-r--r--lttng/org.eclipse.linuxtools.lttng.help/doc/images/LTTng2PreferencesLogging.pngbin49111 -> 58141 bytes
-rw-r--r--lttng/org.eclipse.linuxtools.lttng.help/doc/images/LTTng2PreferencesTimeout.pngbin0 -> 56796 bytes
-rw-r--r--lttng/org.eclipse.linuxtools.lttng2.ui/src/org/eclipse/linuxtools/internal/lttng2/ui/views/control/messages/Messages.java1
-rw-r--r--lttng/org.eclipse.linuxtools.lttng2.ui/src/org/eclipse/linuxtools/internal/lttng2/ui/views/control/messages/messages.properties3
-rw-r--r--lttng/org.eclipse.linuxtools.lttng2.ui/src/org/eclipse/linuxtools/internal/lttng2/ui/views/control/preferences/ControlPreferenceInitializer.java13
-rw-r--r--lttng/org.eclipse.linuxtools.lttng2.ui/src/org/eclipse/linuxtools/internal/lttng2/ui/views/control/preferences/ControlPreferencePage.java7
-rw-r--r--lttng/org.eclipse.linuxtools.lttng2.ui/src/org/eclipse/linuxtools/internal/lttng2/ui/views/control/preferences/ControlPreferences.java26
-rw-r--r--lttng/org.eclipse.linuxtools.lttng2.ui/src/org/eclipse/linuxtools/internal/lttng2/ui/views/control/remote/CommandShell.java8
11 files changed, 51 insertions, 17 deletions
diff --git a/lttng/org.eclipse.linuxtools.lttng.help/doc/User-Guide.mediawiki b/lttng/org.eclipse.linuxtools.lttng.help/doc/User-Guide.mediawiki
index 94b9633..e8f2d71 100644
--- a/lttng/org.eclipse.linuxtools.lttng.help/doc/User-Guide.mediawiki
+++ b/lttng/org.eclipse.linuxtools.lttng.help/doc/User-Guide.mediawiki
@@ -1171,18 +1171,22 @@ The Control View provides property information of selected tree component. Depen
=== LTTng Tracer Control Preferences ===
-Serveral LTTng 2.0 tracer control preferences exists which can be configured. To configure these preferences, select '''Window->Preferences''' from the top level menu. The preference display will open. Then select '''Tracing->LTTng Tracer Control Preferences'''. This preferences page allows the user to specify the tracing group of the user and allows the user to configure the logging of LTTng 2.0 tracer control commands and results to a file.
+Serveral LTTng 2.0 tracer control preferences exists which can be configured. To configure these preferences, select '''Window->Preferences''' from the top level menu. The preference display will open. Then select '''Tracing->LTTng Tracer Control Preferences'''. This preferences page allows the user to specify the tracing group of the user and to specify the command execution timeout as well as it allows the user to configure the logging of LTTng 2.0 tracer control commands and results to a file.
[[Image:images/LTTng2Preferences.png]]
-To change the tracing group of the user which will be specified on each command line, enter the new group name in the '''Tracing Group''' text field and click ok. The default tracing group is '''tracing''' and can be restored by pressing the '''Restore Defaults''' button.
+To change the tracing group of the user which will be specified on each command line, enter the new group name in the '''Tracing Group''' text field and click button '''OK'''. The default tracing group is '''tracing''' and can be restored by pressing the '''Restore Defaults''' button.
[[Image:images/LTTng2PreferencesGroup.png]]
-To configure logging of trace control commands and the corresponding command result to a file, selected the button '''Logging'''. To append to an existing log file, select the '''Append''' button. Deselect the '''Append''' button to overwrite any existing log file. It's possible to specify a verbose level. There are 3 levels with inceasing verbosity from '''Level 1''' to '''Level 3'''. To change the verbosity level, select the relevant level or select '''None'''. If '''None''' is selected only commands and command results are logged. Then press on button '''Ok'''. The log file will be stored in the users home directory with the name ''lttng_tracer_control.log''. The name and location cannot be changed. To reset to default preferences, click on the button '''Restore Defaults'''.
+To configure logging of trace control commands and the corresponding command result to a file, selected the button '''Logging'''. To append to an existing log file, select the '''Append''' button. Deselect the '''Append''' button to overwrite any existing log file. It's possible to specify a verbose level. There are 3 levels with inceasing verbosity from '''Level 1''' to '''Level 3'''. To change the verbosity level, select the relevant level or select '''None'''. If '''None''' is selected only commands and command results are logged. Then press on button '''OK'''. The log file will be stored in the users home directory with the name ''lttng_tracer_control.log''. The name and location cannot be changed. To reset to default preferences, click on the button '''Restore Defaults'''.
[[Image:images/LTTng2PreferencesLogging.png]]
+To configure the LTTng command execution timeout, enter a timeout value into the text field '''Command Timeout (in seconds)''' and press on button '''OK'''. To reset to the default value of 15 seconds, click on the button '''Restore Defaults'''.
+
+[[Image:images/LTTng2PreferencesTimeout.png]]
+
= LTTng Kernel Analysis =
Historically, LTTng was developped to trace the Linux kernel and, over time, a number of kernel-oriented analysis views were developped and organized in a perspective.
diff --git a/lttng/org.eclipse.linuxtools.lttng.help/doc/images/LTTng2Preferences.png b/lttng/org.eclipse.linuxtools.lttng.help/doc/images/LTTng2Preferences.png
index edc5af6..6381fc8 100644
--- a/lttng/org.eclipse.linuxtools.lttng.help/doc/images/LTTng2Preferences.png
+++ b/lttng/org.eclipse.linuxtools.lttng.help/doc/images/LTTng2Preferences.png
Binary files differ
diff --git a/lttng/org.eclipse.linuxtools.lttng.help/doc/images/LTTng2PreferencesGroup.png b/lttng/org.eclipse.linuxtools.lttng.help/doc/images/LTTng2PreferencesGroup.png
index 84435f5..51ddcc7 100644
--- a/lttng/org.eclipse.linuxtools.lttng.help/doc/images/LTTng2PreferencesGroup.png
+++ b/lttng/org.eclipse.linuxtools.lttng.help/doc/images/LTTng2PreferencesGroup.png
Binary files differ
diff --git a/lttng/org.eclipse.linuxtools.lttng.help/doc/images/LTTng2PreferencesLogging.png b/lttng/org.eclipse.linuxtools.lttng.help/doc/images/LTTng2PreferencesLogging.png
index fc82a48..d8eff93 100644
--- a/lttng/org.eclipse.linuxtools.lttng.help/doc/images/LTTng2PreferencesLogging.png
+++ b/lttng/org.eclipse.linuxtools.lttng.help/doc/images/LTTng2PreferencesLogging.png
Binary files differ
diff --git a/lttng/org.eclipse.linuxtools.lttng.help/doc/images/LTTng2PreferencesTimeout.png b/lttng/org.eclipse.linuxtools.lttng.help/doc/images/LTTng2PreferencesTimeout.png
new file mode 100644
index 0000000..300ed48
--- /dev/null
+++ b/lttng/org.eclipse.linuxtools.lttng.help/doc/images/LTTng2PreferencesTimeout.png
Binary files differ
diff --git a/lttng/org.eclipse.linuxtools.lttng2.ui/src/org/eclipse/linuxtools/internal/lttng2/ui/views/control/messages/Messages.java b/lttng/org.eclipse.linuxtools.lttng2.ui/src/org/eclipse/linuxtools/internal/lttng2/ui/views/control/messages/Messages.java
index 92748f2..c5467c3 100644
--- a/lttng/org.eclipse.linuxtools.lttng2.ui/src/org/eclipse/linuxtools/internal/lttng2/ui/views/control/messages/Messages.java
+++ b/lttng/org.eclipse.linuxtools.lttng2.ui/src/org/eclipse/linuxtools/internal/lttng2/ui/views/control/messages/Messages.java
@@ -255,6 +255,7 @@ final public class Messages extends NLS {
public static String TraceControl_LoggingPreference;
public static String TraceControl_LogfilePath;
public static String TraceControl_AppendLogfilePreference;
+ public static String TraceControl_CommandTimeout;
public static String TraceControl_VerboseLevelsPreference;
public static String TraceControl_VerboseLevelNonePreference;
diff --git a/lttng/org.eclipse.linuxtools.lttng2.ui/src/org/eclipse/linuxtools/internal/lttng2/ui/views/control/messages/messages.properties b/lttng/org.eclipse.linuxtools.lttng2.ui/src/org/eclipse/linuxtools/internal/lttng2/ui/views/control/messages/messages.properties
index 52db14d..5c1f487 100644
--- a/lttng/org.eclipse.linuxtools.lttng2.ui/src/org/eclipse/linuxtools/internal/lttng2/ui/views/control/messages/messages.properties
+++ b/lttng/org.eclipse.linuxtools.lttng2.ui/src/org/eclipse/linuxtools/internal/lttng2/ui/views/control/messages/messages.properties
@@ -1,5 +1,5 @@
###############################################################################
-# Copyright (c) 2012 Ericsson.
+# Copyright (c) 2012, 2013 Ericsson.
#
# All rights reserved. This program and the accompanying materials
# are made available under the terms of the Eclipse Public License v1.0
@@ -242,6 +242,7 @@ TraceControl_ProbeSymbolPropertyName=Symbol
TraceControl_TracingGroupPreference=&Tracing Group
TraceControl_LoggingPreference=&Logging
TraceControl_LogfilePath=Log file
+TraceControl_CommandTimeout=Command Timeout (in seconds)
TraceControl_AppendLogfilePreference=&Append
TraceControl_VerboseLevelsPreference=&Verbose Level
TraceControl_VerboseLevelNonePreference=None
diff --git a/lttng/org.eclipse.linuxtools.lttng2.ui/src/org/eclipse/linuxtools/internal/lttng2/ui/views/control/preferences/ControlPreferenceInitializer.java b/lttng/org.eclipse.linuxtools.lttng2.ui/src/org/eclipse/linuxtools/internal/lttng2/ui/views/control/preferences/ControlPreferenceInitializer.java
index fc5971e..a317e63 100644
--- a/lttng/org.eclipse.linuxtools.lttng2.ui/src/org/eclipse/linuxtools/internal/lttng2/ui/views/control/preferences/ControlPreferenceInitializer.java
+++ b/lttng/org.eclipse.linuxtools.lttng2.ui/src/org/eclipse/linuxtools/internal/lttng2/ui/views/control/preferences/ControlPreferenceInitializer.java
@@ -1,12 +1,12 @@
/**********************************************************************
- * Copyright (c) 2012 Ericsson
- *
+ * Copyright (c) 2012, 2013 Ericsson
+ *
* All rights reserved. This program and the accompanying materials are
* made available under the terms of the Eclipse Public License v1.0 which
* accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
+ *
+ * Contributors:
* Bernd Hufmann - Initial API and implementation
**********************************************************************/
package org.eclipse.linuxtools.internal.lttng2.ui.views.control.preferences;
@@ -18,7 +18,7 @@ import org.eclipse.jface.preference.IPreferenceStore;
* <p>
* A class to initialize the preferences.
* </p>
- *
+ *
* @author Bernd Hufmann
*/
public class ControlPreferenceInitializer extends AbstractPreferenceInitializer {
@@ -34,7 +34,8 @@ public class ControlPreferenceInitializer extends AbstractPreferenceInitializer
store.setDefault(ControlPreferences.TRACE_CONTROL_TRACING_GROUP_PREF, ControlPreferences.TRACE_CONTROL_DEFAULT_TRACING_GROUP);
store.setDefault(ControlPreferences.TRACE_CONTROL_LOG_APPEND_PREF, false);
store.setDefault(ControlPreferences.TRACE_CONTROL_LOG_FILE_PATH_PREF, ControlPreferences.TRACE_CONTROL_DEFAULT_LOG_PATH);
- store.setDefault(ControlPreferences.TRACE_CONTROL_LOG_COMMANDS_PREF, false);
+ store.setDefault(ControlPreferences.TRACE_CONTROL_LOG_COMMANDS_PREF, false);
store.setDefault(ControlPreferences.TRACE_CONTROL_VERBOSE_LEVEL_PREF, ControlPreferences.TRACE_CONTROL_VERBOSE_LEVEL_NONE);
+ store.setDefault(ControlPreferences.TRACE_CONTROL_COMMAND_TIMEOUT_PREF, ControlPreferences.TRACE_CONTROL_DEFAULT_TIMEOUT_VALUE);
}
}
diff --git a/lttng/org.eclipse.linuxtools.lttng2.ui/src/org/eclipse/linuxtools/internal/lttng2/ui/views/control/preferences/ControlPreferencePage.java b/lttng/org.eclipse.linuxtools.lttng2.ui/src/org/eclipse/linuxtools/internal/lttng2/ui/views/control/preferences/ControlPreferencePage.java
index 130e690..98ab40d 100644
--- a/lttng/org.eclipse.linuxtools.lttng2.ui/src/org/eclipse/linuxtools/internal/lttng2/ui/views/control/preferences/ControlPreferencePage.java
+++ b/lttng/org.eclipse.linuxtools.lttng2.ui/src/org/eclipse/linuxtools/internal/lttng2/ui/views/control/preferences/ControlPreferencePage.java
@@ -1,5 +1,5 @@
/**********************************************************************
- * Copyright (c) 2012 Ericsson
+ * Copyright (c) 2012, 2013 Ericsson
*
* All rights reserved. This program and the accompanying materials are
* made available under the terms of the Eclipse Public License v1.0 which
@@ -15,6 +15,7 @@ import org.eclipse.jface.preference.BooleanFieldEditor;
import org.eclipse.jface.preference.FieldEditor;
import org.eclipse.jface.preference.FieldEditorPreferencePage;
import org.eclipse.jface.preference.IPreferenceStore;
+import org.eclipse.jface.preference.IntegerFieldEditor;
import org.eclipse.jface.preference.RadioGroupFieldEditor;
import org.eclipse.jface.preference.StringFieldEditor;
import org.eclipse.jface.util.PropertyChangeEvent;
@@ -114,6 +115,10 @@ public class ControlPreferencePage extends FieldEditorPreferencePage implements
fVerboseLevel.setEnabled(enabled, getFieldEditorParent());
fIsAppend.setEnabled(enabled, getFieldEditorParent());
logfile.setEnabled(false, getFieldEditorParent());
+
+ IntegerFieldEditor commandTimeout = new IntegerFieldEditor(ControlPreferences.TRACE_CONTROL_COMMAND_TIMEOUT_PREF, Messages.TraceControl_CommandTimeout, getFieldEditorParent());
+ commandTimeout.setValidRange(ControlPreferences.TRACE_CONTROL_MIN_TIMEOUT_VALUE, ControlPreferences.TRACE_CONTROL_MAX_TIMEOUT_VALUE);
+ addField(commandTimeout);
}
/*
diff --git a/lttng/org.eclipse.linuxtools.lttng2.ui/src/org/eclipse/linuxtools/internal/lttng2/ui/views/control/preferences/ControlPreferences.java b/lttng/org.eclipse.linuxtools.lttng2.ui/src/org/eclipse/linuxtools/internal/lttng2/ui/views/control/preferences/ControlPreferences.java
index 05df09e..3935780 100644
--- a/lttng/org.eclipse.linuxtools.lttng2.ui/src/org/eclipse/linuxtools/internal/lttng2/ui/views/control/preferences/ControlPreferences.java
+++ b/lttng/org.eclipse.linuxtools.lttng2.ui/src/org/eclipse/linuxtools/internal/lttng2/ui/views/control/preferences/ControlPreferences.java
@@ -1,5 +1,5 @@
/**********************************************************************
- * Copyright (c) 2012 Ericsson
+ * Copyright (c) 2012, 2013 Ericsson
*
* All rights reserved. This program and the accompanying materials are
* made available under the terms of the Eclipse Public License v1.0 which
@@ -55,6 +55,10 @@ public class ControlPreferences {
*/
public static final String TRACE_CONTROL_VERBOSE_LEVEL_PREF = "trace.control.verbose.level"; //$NON-NLS-1$
/**
+ * The command time-out preference
+ */
+ public static final String TRACE_CONTROL_COMMAND_TIMEOUT_PREF = "trace.control.command.timeout"; //$NON-NLS-1$
+ /**
* The verbose level value for none
*/
public static final String TRACE_CONTROL_VERBOSE_LEVEL_NONE = "trace.control.verbose.level.none"; //$NON-NLS-1$
@@ -78,6 +82,18 @@ public class ControlPreferences {
* The default tracing log file name with absolute path
*/
public static final String TRACE_CONTROL_DEFAULT_LOG_PATH = System.getProperty("user.home") + File.separator + TRACE_CONTROL_LOG_FILENAME; //$NON-NLS-1$
+ /**
+ * Default timeout value used for executing commands, in seconds
+ */
+ public final static int TRACE_CONTROL_DEFAULT_TIMEOUT_VALUE = 15;
+ /**
+ * Minimum timeout value used for executing commands, in seconds
+ */
+ public final static int TRACE_CONTROL_MIN_TIMEOUT_VALUE = 5;
+ /**
+ * Maximum timeout value used for executing commands, in seconds
+ */
+ public final static int TRACE_CONTROL_MAX_TIMEOUT_VALUE = 600;
// ------------------------------------------------------------------------
// Attributes
@@ -164,6 +180,14 @@ public class ControlPreferences {
return fPreferenceStore.getString(TRACE_CONTROL_LOG_FILE_PATH_PREF);
}
+ /**
+ * @return command timeout value
+ */
+ public int getCommandTimeout() {
+ return fPreferenceStore.getInt(TRACE_CONTROL_COMMAND_TIMEOUT_PREF);
+ }
+
+
// ------------------------------------------------------------------------
// Operations
// ------------------------------------------------------------------------
diff --git a/lttng/org.eclipse.linuxtools.lttng2.ui/src/org/eclipse/linuxtools/internal/lttng2/ui/views/control/remote/CommandShell.java b/lttng/org.eclipse.linuxtools.lttng2.ui/src/org/eclipse/linuxtools/internal/lttng2/ui/views/control/remote/CommandShell.java
index c2559d1..16fb5fa 100644
--- a/lttng/org.eclipse.linuxtools.lttng2.ui/src/org/eclipse/linuxtools/internal/lttng2/ui/views/control/remote/CommandShell.java
+++ b/lttng/org.eclipse.linuxtools.lttng2.ui/src/org/eclipse/linuxtools/internal/lttng2/ui/views/control/remote/CommandShell.java
@@ -1,5 +1,5 @@
/**********************************************************************
- * Copyright (c) 2012 Ericsson
+ * Copyright (c) 2012, 2013 Ericsson
*
* All rights reserved. This program and the accompanying materials are
* made available under the terms of the Eclipse Public License v1.0 which
@@ -29,6 +29,7 @@ import org.eclipse.core.commands.ExecutionException;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.linuxtools.internal.lttng2.ui.views.control.messages.Messages;
+import org.eclipse.linuxtools.internal.lttng2.ui.views.control.preferences.ControlPreferences;
import org.eclipse.rse.services.shells.HostShellProcessAdapter;
import org.eclipse.rse.services.shells.IHostShell;
import org.eclipse.rse.services.shells.IShellService;
@@ -62,9 +63,6 @@ public class CommandShell implements ICommandShell {
/** Default command separator */
public final static char CMD_SEPARATOR = ';';
- /** Default timeout value used for executing commands, in milliseconds */
- private final static int DEFAULT_TIMEOUT_VALUE = 15000;
-
// ------------------------------------------------------------------------
// Attributes
// ------------------------------------------------------------------------
@@ -212,7 +210,7 @@ public class CommandShell implements ICommandShell {
fExecutor.execute(future);
try {
- return future.get(DEFAULT_TIMEOUT_VALUE, TimeUnit.MILLISECONDS);
+ return future.get(ControlPreferences.getInstance().getCommandTimeout(), TimeUnit.SECONDS);
} catch (java.util.concurrent.ExecutionException ex) {
throw new ExecutionException(Messages.TraceControl_ExecutionFailure, ex);
} catch (InterruptedException ex) {