aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSimon Delisle2013-06-26 11:58:39 (EDT)
committerBernd Hufmann2013-07-30 11:20:31 (EDT)
commit21dee3a16d574b343002df8702b72f19102555b7 (patch)
treeafe4534078da67fdf37ccbab1b395b3f59679a08
parent5b764a7ac7d944eb92d7d94d549c63489165b835 (diff)
downloadorg.eclipse.linuxtools-21dee3a16d574b343002df8702b72f19102555b7.zip
org.eclipse.linuxtools-21dee3a16d574b343002df8702b72f19102555b7.tar.gz
org.eclipse.linuxtools-21dee3a16d574b343002df8702b72f19102555b7.tar.bz2
LTTng: Support for LTTng Tools 2.2refs/changes/03/14203/6
Change-Id: Ib87e9e5598f8b7caad42b1e780f8cddb8aeee4d2 Signed-off-by: Simon Delisle <simon.delisle@ericsson.com> Reviewed-on: https://git.eclipse.org/r/14203 Tested-by: Hudson CI Reviewed-by: Bernd Hufmann <bernd.hufmann@ericsson.com> IP-Clean: Bernd Hufmann <bernd.hufmann@ericsson.com> Tested-by: Bernd Hufmann <bernd.hufmann@ericsson.com>
-rw-r--r--lttng/org.eclipse.linuxtools.lttng.help/doc/User-Guide.mediawiki25
-rw-r--r--lttng/org.eclipse.linuxtools.lttng.help/doc/images/LTTng2CreateChannelDialog.pngbin30182 -> 12554 bytes
-rw-r--r--lttng/org.eclipse.linuxtools.lttng.help/doc/images/LTTng2CreateChannelDialogFileRotation.pngbin0 -> 11924 bytes
-rw-r--r--lttng/org.eclipse.linuxtools.lttng.help/doc/images/LTTng2CreateChannelDialogMetadataFlush.pngbin0 -> 12132 bytes
-rw-r--r--lttng/org.eclipse.linuxtools.lttng.help/doc/images/LTTng2CreateChannelDialogPerUIDBuffers.pngbin0 -> 11966 bytes
-rw-r--r--lttng/org.eclipse.linuxtools.lttng2.core.tests/src/org/eclipse/linuxtools/lttng2/core/tests/control/model/impl/ChannelInfoTest.java30
-rw-r--r--lttng/org.eclipse.linuxtools.lttng2.core/src/org/eclipse/linuxtools/internal/lttng2/core/control/model/IChannelInfo.java52
-rw-r--r--lttng/org.eclipse.linuxtools.lttng2.core/src/org/eclipse/linuxtools/internal/lttng2/core/control/model/impl/ChannelInfo.java46
-rw-r--r--lttng/org.eclipse.linuxtools.lttng2.ui.tests/src/org/eclipse/linuxtools/lttng2/ui/tests/control/service/LTTngControlServiceTest.java29
-rw-r--r--lttng/org.eclipse.linuxtools.lttng2.ui.tests/stubs/org/eclipse/linuxtools/internal/lttng2/stubs/dialogs/EnableChannelDialogStub.java7
-rw-r--r--lttng/org.eclipse.linuxtools.lttng2.ui.tests/testfiles/LTTngServiceTest.cfg41
-rw-r--r--lttng/org.eclipse.linuxtools.lttng2.ui/src/org/eclipse/linuxtools/internal/lttng2/ui/views/control/dialogs/EnableChannelDialog.java183
-rw-r--r--lttng/org.eclipse.linuxtools.lttng2.ui/src/org/eclipse/linuxtools/internal/lttng2/ui/views/control/dialogs/IEnableChannelDialog.java7
-rw-r--r--lttng/org.eclipse.linuxtools.lttng2.ui/src/org/eclipse/linuxtools/internal/lttng2/ui/views/control/handlers/BaseEnableChannelHandler.java1
-rw-r--r--lttng/org.eclipse.linuxtools.lttng2.ui/src/org/eclipse/linuxtools/internal/lttng2/ui/views/control/messages/Messages.java8
-rw-r--r--lttng/org.eclipse.linuxtools.lttng2.ui/src/org/eclipse/linuxtools/internal/lttng2/ui/views/control/messages/messages.properties13
-rw-r--r--lttng/org.eclipse.linuxtools.lttng2.ui/src/org/eclipse/linuxtools/internal/lttng2/ui/views/control/model/impl/TargetNodeComponent.java24
-rw-r--r--lttng/org.eclipse.linuxtools.lttng2.ui/src/org/eclipse/linuxtools/internal/lttng2/ui/views/control/service/LTTngControlService.java49
-rw-r--r--lttng/org.eclipse.linuxtools.lttng2.ui/src/org/eclipse/linuxtools/internal/lttng2/ui/views/control/service/LTTngControlServiceConstants.java21
19 files changed, 483 insertions, 53 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 05118ac..0c390e5 100644
--- a/lttng/org.eclipse.linuxtools.lttng.help/doc/User-Guide.mediawiki
+++ b/lttng/org.eclipse.linuxtools.lttng.help/doc/User-Guide.mediawiki
@@ -952,7 +952,7 @@ A dialog box will open for entering information about the channel to be created.
[[Image:images/LTTng2CreateChannelDialog.png]]
-By default the domain '''Kernel''' is selected and the corresponding default values are shown. To create a UST channel, select '''UST''' under the domain section. To get the default values of UST, then press button '''Default'''.
+By default the domain '''Kernel''' is selected. To create a UST channel, select '''UST''' under the domain section. The label <Default> in any text box indicates that the default value of the tracer will be configured. To initialize the dialog box press button '''Default'''.
If required update the following channel information and then press '''Ok'''.
@@ -965,6 +965,29 @@ If required update the following channel information and then press '''Ok'''.
Upon successful operation, the requested domain will be created under the session tree node as well as the requested channel will be added under the domain. The channel will be '''ENABLED'''.
+==== Trace file rotation ====
+
+Since LTTng Tools v2.2.0 it is possible to set the maximum size of trace files and the maximum number of them. These options are located in the same dialog box that is used to enabling channels.
+
+[[Image:images/LTTng2CreateChannelDialogFileRotation.png]]
+
+* '''Maximum size of trace files''': The maximum size of trace files
+* '''Maximum number of trace files''': The maximum number of trace files
+
+==== Per UID buffers ====
+
+Since LTTng Tools v2.2.0 it is possible to have one buffer per UID for UST traces. It can be activated in the dialog box when enabling channels.
+
+[[Image:images/LTTng2CreateChannelDialogPerUIDBuffers.png]]
+
+* '''Per UID buffers''': To activate the per UID buffers option for UST channel only
+
+==== Periodical flush for metadata ====
+
+Since LTTng Tools v2.2.0 it is possible to configure periodical flush for the metadata channel. To set this, use the checkbox '''Configure metadata channel''' then use the switcher timer interval for the interval.
+
+[[Image:images/LTTng2CreateChannelDialogMetadataFlush.png]]
+
==== Enabling Channels On Domain Level ====
Once a domain is available, channels can be enabled directly using the domain. To enable a channel under an existing domain, select the tree node of the relevant domain and press the right mouse button. Then select the '''Enable Channel...''' button of the context-sensitive menu.
diff --git a/lttng/org.eclipse.linuxtools.lttng.help/doc/images/LTTng2CreateChannelDialog.png b/lttng/org.eclipse.linuxtools.lttng.help/doc/images/LTTng2CreateChannelDialog.png
index 592c67a..c675071 100644
--- a/lttng/org.eclipse.linuxtools.lttng.help/doc/images/LTTng2CreateChannelDialog.png
+++ b/lttng/org.eclipse.linuxtools.lttng.help/doc/images/LTTng2CreateChannelDialog.png
Binary files differ
diff --git a/lttng/org.eclipse.linuxtools.lttng.help/doc/images/LTTng2CreateChannelDialogFileRotation.png b/lttng/org.eclipse.linuxtools.lttng.help/doc/images/LTTng2CreateChannelDialogFileRotation.png
new file mode 100644
index 0000000..087cb23
--- /dev/null
+++ b/lttng/org.eclipse.linuxtools.lttng.help/doc/images/LTTng2CreateChannelDialogFileRotation.png
Binary files differ
diff --git a/lttng/org.eclipse.linuxtools.lttng.help/doc/images/LTTng2CreateChannelDialogMetadataFlush.png b/lttng/org.eclipse.linuxtools.lttng.help/doc/images/LTTng2CreateChannelDialogMetadataFlush.png
new file mode 100644
index 0000000..e53ee5f
--- /dev/null
+++ b/lttng/org.eclipse.linuxtools.lttng.help/doc/images/LTTng2CreateChannelDialogMetadataFlush.png
Binary files differ
diff --git a/lttng/org.eclipse.linuxtools.lttng.help/doc/images/LTTng2CreateChannelDialogPerUIDBuffers.png b/lttng/org.eclipse.linuxtools.lttng.help/doc/images/LTTng2CreateChannelDialogPerUIDBuffers.png
new file mode 100644
index 0000000..d8ea6c6
--- /dev/null
+++ b/lttng/org.eclipse.linuxtools.lttng.help/doc/images/LTTng2CreateChannelDialogPerUIDBuffers.png
Binary files differ
diff --git a/lttng/org.eclipse.linuxtools.lttng2.core.tests/src/org/eclipse/linuxtools/lttng2/core/tests/control/model/impl/ChannelInfoTest.java b/lttng/org.eclipse.linuxtools.lttng2.core.tests/src/org/eclipse/linuxtools/lttng2/core/tests/control/model/impl/ChannelInfoTest.java
index 89754b1..0f94c5a 100644
--- a/lttng/org.eclipse.linuxtools.lttng2.core.tests/src/org/eclipse/linuxtools/lttng2/core/tests/control/model/impl/ChannelInfoTest.java
+++ b/lttng/org.eclipse.linuxtools.lttng2.core.tests/src/org/eclipse/linuxtools/lttng2/core/tests/control/model/impl/ChannelInfoTest.java
@@ -77,6 +77,9 @@ public class ChannelInfoTest {
assertEquals("disabled", result.getState().getInName());
assertEquals(0, result.getSubBufferSize());
assertEquals(0, result.getSwitchTimer());
+ assertEquals(0, result.getMaxSizeTraceFiles());
+ assertEquals(0, result.getMaxNumberTraceFiles());
+ assertEquals(false, result.isBuffersUID());
}
/**
@@ -94,6 +97,9 @@ public class ChannelInfoTest {
assertEquals(fChannelInfo1.getState(), channelInfo.getState());
assertEquals(fChannelInfo1.getSwitchTimer(), channelInfo.getSwitchTimer());
assertEquals(fChannelInfo1.getEvents().length, channelInfo.getEvents().length);
+ assertEquals(fChannelInfo1.getMaxSizeTraceFiles(), channelInfo.getMaxSizeTraceFiles());
+ assertEquals(fChannelInfo1.getMaxNumberTraceFiles(), channelInfo.getMaxNumberTraceFiles());
+ assertEquals(fChannelInfo1.isBuffersUID(), channelInfo.isBuffersUID());
IEventInfo[] orignalEvents = fChannelInfo1.getEvents();
IEventInfo[] resultEvents = channelInfo.getEvents();
@@ -157,6 +163,9 @@ public class ChannelInfoTest {
fixture.setNumberOfSubBuffers(4);
fixture.setOutputType("splice()");
fixture.setSubBufferSize(1L);
+ fixture.setMaxSizeTraceFiles(1024);
+ fixture.setMaxNumberTraceFiles(20);
+ fixture.setBuffersUID(true);
fixture.addEvent(new EventInfo("event"));
long switchTimer = fixture.getSwitchTimer();
@@ -180,6 +189,15 @@ public class ChannelInfoTest {
long subBufferSize = fixture.getSubBufferSize();
assertEquals(1L, subBufferSize);
+ int maxSizeTraceFiles = fixture.getMaxSizeTraceFiles();
+ assertEquals(1024, maxSizeTraceFiles);
+
+ int maxNumberTraceFiles = fixture.getMaxNumberTraceFiles();
+ assertEquals(20, maxNumberTraceFiles);
+
+ boolean buffersUID = fixture.isBuffersUID();
+ assertTrue(buffersUID);
+
fixture.setSwitchTimer(5L);
fixture.setOverwriteMode(false);
fixture.setReadTimer(6L);
@@ -187,6 +205,9 @@ public class ChannelInfoTest {
fixture.setNumberOfSubBuffers(7);
fixture.setOutputType("mmap()");
fixture.setSubBufferSize(8L);
+ fixture.setMaxSizeTraceFiles(4096);
+ fixture.setMaxNumberTraceFiles(10);
+ fixture.setBuffersUID(false);
switchTimer = fixture.getSwitchTimer();
assertEquals(5L, switchTimer);
@@ -208,6 +229,15 @@ public class ChannelInfoTest {
subBufferSize = fixture.getSubBufferSize();
assertEquals(8L, subBufferSize);
+
+ maxSizeTraceFiles = fixture.getMaxSizeTraceFiles();
+ assertEquals(4096, maxSizeTraceFiles);
+
+ maxNumberTraceFiles = fixture.getMaxNumberTraceFiles();
+ assertEquals(10, maxNumberTraceFiles);
+
+ buffersUID = fixture.isBuffersUID();
+ assertFalse(buffersUID);
}
/**
diff --git a/lttng/org.eclipse.linuxtools.lttng2.core/src/org/eclipse/linuxtools/internal/lttng2/core/control/model/IChannelInfo.java b/lttng/org.eclipse.linuxtools.lttng2.core/src/org/eclipse/linuxtools/internal/lttng2/core/control/model/IChannelInfo.java
index a048307..c4428d6 100644
--- a/lttng/org.eclipse.linuxtools.lttng2.core/src/org/eclipse/linuxtools/internal/lttng2/core/control/model/IChannelInfo.java
+++ b/lttng/org.eclipse.linuxtools.lttng2.core/src/org/eclipse/linuxtools/internal/lttng2/core/control/model/IChannelInfo.java
@@ -8,6 +8,7 @@
*
* Contributors:
* Bernd Hufmann - Initial API and implementation
+ * Simon Delisle - Updated for support of LTTng Tools 2.2
**********************************************************************/
package org.eclipse.linuxtools.internal.lttng2.core.control.model;
@@ -29,30 +30,6 @@ public interface IChannelInfo extends ITraceInfo {
* Default value for overwrite mode.
*/
public final static boolean DEFAULT_OVERWRITE_MODE = false;
- /**
- * Default value for sub-buffer size for a UST channel.
- */
- public final static long DEFAULT_SUB_BUFFER_SIZE_UST = 4096L;
- /**
- * Default value for sub-buffer size for a Kernel channel.
- */
- public final static long DEFAULT_SUB_BUFFER_SIZE_KERNEL = 262144L;
- /**
- * Default value for number of sub-buffer a UST channel.
- */
- public final static int DEFAULT_NUMBER_OF_SUB_BUFFERS_UST = 8;
- /**
- * Default value for number of sub-buffer a Kernel channel.
- */
- public final static int DEFAULT_NUMBER_OF_SUB_BUFFERS_KERNEL = 4;
- /**
- * Default value for number of the switch timer interval.
- */
- public final static long DEFAULT_SWITCH_TIMER = 0;
- /**
- * Default value for number of the read timer interval.
- */
- public final static long DEFAULT_READ_TIMER = 200;
/**
* @return the overwrite mode value.
@@ -143,4 +120,31 @@ public interface IChannelInfo extends ITraceInfo {
* @param event - event information to add.
*/
void addEvent(IEventInfo event);
+ /**
+ * Sets the maximum size of trace files
+ * @param maxSizeTraceFiles - maximum size
+ */
+ void setMaxSizeTraceFiles(int maxSizeTraceFiles);
+ /**
+ * Sets the maximum number of trace files
+ * @param maxNumberTraceFiles - maximum number
+ */
+ void setMaxNumberTraceFiles(int maxNumberTraceFiles);
+ /**
+ * @return maximum size of trace files
+ */
+ int getMaxSizeTraceFiles();
+ /**
+ * @return maximum number of trace files
+ */
+ int getMaxNumberTraceFiles();
+ /**
+ * Sets per UID buffers
+ * @param buffersUID - enable or not
+ */
+ void setBuffersUID(boolean buffersUID);
+ /**
+ * @return the value of buffersUID (enable or not)
+ */
+ boolean isBuffersUID();
}
diff --git a/lttng/org.eclipse.linuxtools.lttng2.core/src/org/eclipse/linuxtools/internal/lttng2/core/control/model/impl/ChannelInfo.java b/lttng/org.eclipse.linuxtools.lttng2.core/src/org/eclipse/linuxtools/internal/lttng2/core/control/model/impl/ChannelInfo.java
index 641d00c..ccbb390 100644
--- a/lttng/org.eclipse.linuxtools.lttng2.core/src/org/eclipse/linuxtools/internal/lttng2/core/control/model/impl/ChannelInfo.java
+++ b/lttng/org.eclipse.linuxtools.lttng2.core/src/org/eclipse/linuxtools/internal/lttng2/core/control/model/impl/ChannelInfo.java
@@ -8,6 +8,7 @@
*
* Contributors:
* Bernd Hufmann - Initial API and implementation
+ * Simon Delisle - Updated for support of LTTng Tools 2.2
**********************************************************************/
package org.eclipse.linuxtools.internal.lttng2.core.control.model.impl;
@@ -64,6 +65,18 @@ public class ChannelInfo extends TraceInfo implements IChannelInfo {
* The events information of the channel.
*/
private final List<IEventInfo> fEvents = new ArrayList<IEventInfo>();
+ /**
+ * The maximum size of trace files
+ */
+ private int fMaxSizeTraceFiles;
+ /**
+ * The maximum number of trace files
+ */
+ private int fMaxNumberTraceFiles;
+ /**
+ * The value of the checkbox per UID buffers
+ */
+ private boolean fIsBuffersUID;
// ------------------------------------------------------------------------
@@ -88,6 +101,9 @@ public class ChannelInfo extends TraceInfo implements IChannelInfo {
fNumberOfSubBuffers = other.fNumberOfSubBuffers;
fSwitchTimer = other.fSwitchTimer;
fReadTimer = other.fReadTimer;
+ fMaxSizeTraceFiles = other.fMaxSizeTraceFiles;
+ fMaxNumberTraceFiles = other.fMaxNumberTraceFiles;
+ fIsBuffersUID = other.fIsBuffersUID;
fOutputType = (other.fOutputType == null ? null : String.valueOf(other.fOutputType));
fState = other.fState;
for (Iterator<IEventInfo> iterator = other.fEvents.iterator(); iterator.hasNext();) {
@@ -293,4 +309,34 @@ public class ChannelInfo extends TraceInfo implements IChannelInfo {
output.append(")]");
return output.toString();
}
+
+ @Override
+ public void setMaxSizeTraceFiles(int maxSizeTraceFiles) {
+ fMaxSizeTraceFiles = maxSizeTraceFiles;
+ }
+
+ @Override
+ public void setMaxNumberTraceFiles(int maxNumberTraceFiles) {
+ fMaxNumberTraceFiles = maxNumberTraceFiles;
+ }
+
+ @Override
+ public int getMaxSizeTraceFiles() {
+ return fMaxSizeTraceFiles;
+ }
+
+ @Override
+ public int getMaxNumberTraceFiles() {
+ return fMaxNumberTraceFiles;
+ }
+
+ @Override
+ public void setBuffersUID(boolean buffersUID) {
+ fIsBuffersUID = buffersUID;
+ }
+
+ @Override
+ public boolean isBuffersUID() {
+ return fIsBuffersUID;
+ }
}
diff --git a/lttng/org.eclipse.linuxtools.lttng2.ui.tests/src/org/eclipse/linuxtools/lttng2/ui/tests/control/service/LTTngControlServiceTest.java b/lttng/org.eclipse.linuxtools.lttng2.ui.tests/src/org/eclipse/linuxtools/lttng2/ui/tests/control/service/LTTngControlServiceTest.java
index dd4881b..1e00346 100644
--- a/lttng/org.eclipse.linuxtools.lttng2.ui.tests/src/org/eclipse/linuxtools/lttng2/ui/tests/control/service/LTTngControlServiceTest.java
+++ b/lttng/org.eclipse.linuxtools.lttng2.ui.tests/src/org/eclipse/linuxtools/lttng2/ui/tests/control/service/LTTngControlServiceTest.java
@@ -830,6 +830,8 @@ public class LTTngControlServiceTest {
chanInfo.setReadTimer(100);
chanInfo.setSwitchTimer(200);
chanInfo.setNumberOfSubBuffers(2);
+ chanInfo.setMaxNumberTraceFiles(10);
+ chanInfo.setMaxSizeTraceFiles(0);
fService.enableChannels(sessionName, list, true, chanInfo, new NullProgressMonitor());
// Create/enable/configure 1 UST channel
@@ -842,6 +844,33 @@ public class LTTngControlServiceTest {
chanInfo.setReadTimer(200);
chanInfo.setSwitchTimer(100);
chanInfo.setNumberOfSubBuffers(1);
+ chanInfo.setMaxNumberTraceFiles(20);
+ chanInfo.setMaxSizeTraceFiles(0);
+ fService.enableChannels(sessionName, list, false, chanInfo, new NullProgressMonitor());
+
+ } catch (ExecutionException e) {
+ fail(e.toString());
+ }
+ }
+
+ @Test
+ public void testCreateChannelUIDBuffer() {
+ try {
+ String sessionName = "mysession2";
+ List<String> list = new ArrayList<String>();
+ String USTChannel = "ustChannel";
+ list.add(USTChannel);
+ fShell.setScenario(SCEN_CHANNEL_HANDLING);
+
+ ChannelInfo chanInfo = new ChannelInfo("");
+ chanInfo.setOverwriteMode(true);
+ chanInfo.setSubBufferSize(32768);
+ chanInfo.setReadTimer(200);
+ chanInfo.setSwitchTimer(100);
+ chanInfo.setNumberOfSubBuffers(1);
+ chanInfo.setMaxNumberTraceFiles(20);
+ chanInfo.setMaxSizeTraceFiles(0);
+ chanInfo.setBuffersUID(true);
fService.enableChannels(sessionName, list, false, chanInfo, new NullProgressMonitor());
} catch (ExecutionException e) {
diff --git a/lttng/org.eclipse.linuxtools.lttng2.ui.tests/stubs/org/eclipse/linuxtools/internal/lttng2/stubs/dialogs/EnableChannelDialogStub.java b/lttng/org.eclipse.linuxtools.lttng2.ui.tests/stubs/org/eclipse/linuxtools/internal/lttng2/stubs/dialogs/EnableChannelDialogStub.java
index cc8b34c..46f528b 100644
--- a/lttng/org.eclipse.linuxtools.lttng2.ui.tests/stubs/org/eclipse/linuxtools/internal/lttng2/stubs/dialogs/EnableChannelDialogStub.java
+++ b/lttng/org.eclipse.linuxtools.lttng2.ui.tests/stubs/org/eclipse/linuxtools/internal/lttng2/stubs/dialogs/EnableChannelDialogStub.java
@@ -14,6 +14,7 @@ package org.eclipse.linuxtools.internal.lttng2.stubs.dialogs;
import org.eclipse.linuxtools.internal.lttng2.core.control.model.IChannelInfo;
import org.eclipse.linuxtools.internal.lttng2.core.control.model.impl.ChannelInfo;
import org.eclipse.linuxtools.internal.lttng2.ui.views.control.dialogs.IEnableChannelDialog;
+import org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.impl.TargetNodeComponent;
import org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.impl.TraceDomainComponent;
/**
@@ -26,6 +27,7 @@ public class EnableChannelDialogStub implements IEnableChannelDialog {
// Attributes
// ------------------------------------------------------------------------
private TraceDomainComponent fDomain;
+ private TargetNodeComponent fTargetNodeComponent;
private ChannelInfo fChannelInfo;
private boolean fIsKernel;
@@ -79,4 +81,9 @@ public class EnableChannelDialogStub implements IEnableChannelDialog {
public void setChannelInfo(ChannelInfo info) {
fChannelInfo = info;
}
+
+ @Override
+ public void setTargetNodeComponent(TargetNodeComponent node) {
+ fTargetNodeComponent = node;
+ }
} \ No newline at end of file
diff --git a/lttng/org.eclipse.linuxtools.lttng2.ui.tests/testfiles/LTTngServiceTest.cfg b/lttng/org.eclipse.linuxtools.lttng2.ui.tests/testfiles/LTTngServiceTest.cfg
index d9b9e82..2bb70d7 100644
--- a/lttng/org.eclipse.linuxtools.lttng2.ui.tests/testfiles/LTTngServiceTest.cfg
+++ b/lttng/org.eclipse.linuxtools.lttng2.ui.tests/testfiles/LTTngServiceTest.cfg
@@ -651,6 +651,17 @@ 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
+</COMMAND_INPUT>
+<COMMAND_RESULT>
+0
+</COMMAND_RESULT>
+<COMMAND_OUTPUT>
+Kernel channel mychannel0 enabled for session mysession2
+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
</COMMAND_INPUT>
<COMMAND_RESULT>
@@ -662,6 +673,16 @@ 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
+</COMMAND_INPUT>
+<COMMAND_RESULT>
+0
+</COMMAND_RESULT>
+<COMMAND_OUTPUT>
+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
</COMMAND_INPUT>
<COMMAND_RESULT>
@@ -672,6 +693,26 @@ 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
+</COMMAND_INPUT>
+<COMMAND_RESULT>
+0
+</COMMAND_RESULT>
+<COMMAND_OUTPUT>
+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
+</COMMAND_INPUT>
+<COMMAND_RESULT>
+0
+</COMMAND_RESULT>
+<COMMAND_OUTPUT>
+UST channel channel0 enabled for session mysession2
+</COMMAND_OUTPUT>
+
+<COMMAND_INPUT>
lttng enable-channel mychannel0,mychannel1 -k -s mysession2
</COMMAND_INPUT>
<COMMAND_RESULT>
diff --git a/lttng/org.eclipse.linuxtools.lttng2.ui/src/org/eclipse/linuxtools/internal/lttng2/ui/views/control/dialogs/EnableChannelDialog.java b/lttng/org.eclipse.linuxtools.lttng2.ui/src/org/eclipse/linuxtools/internal/lttng2/ui/views/control/dialogs/EnableChannelDialog.java
index ae92efb..fc21752 100644
--- a/lttng/org.eclipse.linuxtools.lttng2.ui/src/org/eclipse/linuxtools/internal/lttng2/ui/views/control/dialogs/EnableChannelDialog.java
+++ b/lttng/org.eclipse.linuxtools.lttng2.ui/src/org/eclipse/linuxtools/internal/lttng2/ui/views/control/dialogs/EnableChannelDialog.java
@@ -8,6 +8,7 @@
*
* Contributors:
* Bernd Hufmann - Initial API and implementation
+ * Simon Delisle - Updated for support of LTTng Tools 2.2
**********************************************************************/
package org.eclipse.linuxtools.internal.lttng2.ui.views.control.dialogs;
@@ -18,8 +19,14 @@ import org.eclipse.linuxtools.internal.lttng2.core.control.model.IChannelInfo;
import org.eclipse.linuxtools.internal.lttng2.core.control.model.impl.ChannelInfo;
import org.eclipse.linuxtools.internal.lttng2.ui.Activator;
import org.eclipse.linuxtools.internal.lttng2.ui.views.control.messages.Messages;
+import org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.impl.TargetNodeComponent;
import org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.impl.TraceDomainComponent;
+import org.eclipse.linuxtools.internal.lttng2.ui.views.control.service.LTTngControlServiceConstants;
import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.FocusEvent;
+import org.eclipse.swt.events.FocusListener;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.events.VerifyEvent;
import org.eclipse.swt.events.VerifyListener;
import org.eclipse.swt.layout.GridData;
@@ -49,6 +56,11 @@ public class EnableChannelDialog extends Dialog implements IEnableChannelDialog
*/
public static final String ENABLE_CHANNEL_ICON_FILE = "icons/elcl16/add_button.gif"; //$NON-NLS-1$
+ /**
+ * To indicate that the default value will be used for this field
+ */
+ private static final String DEFAULT_TEXT = "<" + Messages.EnableChannelDialog_DefaultMessage + ">"; //$NON-NLS-1$ //$NON-NLS-2$
+
// ------------------------------------------------------------------------
// Attributes
// ------------------------------------------------------------------------
@@ -94,10 +106,18 @@ public class EnableChannelDialog extends Dialog implements IEnableChannelDialog
*/
private TraceDomainComponent fDomain = null;
/**
+ * The target node component
+ */
+ private TargetNodeComponent fTargetNodeComponent = null;
+ /**
* Common verify listener for numeric text input.
*/
private VerifyListener fVerifyListener = null;
/**
+ * Common focus listener
+ */
+ private FocusListener fFocusListener = null;
+ /**
* Output channel information.
*/
private IChannelInfo fChannelInfo = null;
@@ -109,6 +129,27 @@ public class EnableChannelDialog extends Dialog implements IEnableChannelDialog
* Flag which indicates whether Kernel domain is available or not
*/
private boolean fHasKernel;
+ /**
+ * Maximum size of trace files of the channel.
+ */
+ private Text fMaxSizeTraceText = null;
+ /**
+ * Maximum number of trace files of the channel.
+ */
+ private Text fMaxNumberTraceText = null;
+ /**
+ * CheckBox for selecting per UID buffers.
+ */
+ private Button fUIDBuffersButton = null;
+ /**
+ * CheckBox to configure metadata channel
+ */
+ private Button fMetadataChannelButton = null;
+ /**
+ * Previous channel name
+ */
+ private String fPreviousChannelName = null;
+
// ------------------------------------------------------------------------
// Constructors
@@ -126,10 +167,33 @@ public class EnableChannelDialog extends Dialog implements IEnableChannelDialog
fVerifyListener = new VerifyListener() {
@Override
public void verifyText(VerifyEvent e) {
- // only numbers are allowed.
- e.doit = e.text.matches("[0-9]*"); //$NON-NLS-1$
+ // only numbers and default are allowed.
+ e.doit = e.text.matches("[0-9]*") || e.text.matches(DEFAULT_TEXT); //$NON-NLS-1$
}
};
+
+ // Common focus listener
+ fFocusListener = new FocusListener() {
+
+ @Override
+ public void focusLost(FocusEvent e) {
+ Text focusLostWidget = (Text) e.widget;
+ if (focusLostWidget.getText().isEmpty()) {
+ focusLostWidget.setText(DEFAULT_TEXT);
+ focusLostWidget.setForeground(getShell().getDisplay().getSystemColor(SWT.COLOR_GRAY));
+ }
+ }
+
+ @Override
+ public void focusGained(FocusEvent e) {
+ Text focusGainedWidget = (Text) e.widget;
+ if (focusGainedWidget.getText().equals(DEFAULT_TEXT)) {
+ focusGainedWidget.setText(""); //$NON-NLS-1$
+ focusGainedWidget.setForeground(getShell().getDisplay().getSystemColor(SWT.COLOR_BLACK));
+ }
+ }
+ };
+
setShellStyle(SWT.RESIZE);
}
@@ -168,6 +232,11 @@ public class EnableChannelDialog extends Dialog implements IEnableChannelDialog
fHasKernel = hasKernel;
}
+ @Override
+ public void setTargetNodeComponent(TargetNodeComponent node) {
+ fTargetNodeComponent = node;
+ }
+
// ------------------------------------------------------------------------
// Operations
// ------------------------------------------------------------------------
@@ -197,24 +266,65 @@ public class EnableChannelDialog extends Dialog implements IEnableChannelDialog
fSubBufferSizeText = new Text(dialogComposite, SWT.NONE);
fSubBufferSizeText.setToolTipText(Messages.TraceControl_EnableChannelSubBufferSizeTooltip);
fSubBufferSizeText.addVerifyListener(fVerifyListener);
+ fSubBufferSizeText.addFocusListener(fFocusListener);
+ fSubBufferSizeText.setForeground(getShell().getDisplay().getSystemColor(SWT.COLOR_GRAY));
Label numSubBufferLabel = new Label(dialogComposite, SWT.RIGHT);
numSubBufferLabel.setText(Messages.TraceControl_NbSubBuffersPropertyName);
fNumberOfSubBuffersText = new Text(dialogComposite, SWT.NONE);
fNumberOfSubBuffersText.setToolTipText(Messages.TraceControl_EnableChannelNbSubBuffersTooltip);
fNumberOfSubBuffersText.addVerifyListener(fVerifyListener);
+ fNumberOfSubBuffersText.addFocusListener(fFocusListener);
Label switchTimerLabel = new Label(dialogComposite, SWT.RIGHT);
switchTimerLabel.setText(Messages.TraceControl_SwitchTimerPropertyName);
fSwitchTimerText = new Text(dialogComposite, SWT.NONE);
fSwitchTimerText.setToolTipText(Messages.TraceControl_EnableChannelSwitchTimerTooltip);
fSwitchTimerText.addVerifyListener(fVerifyListener);
+ fSwitchTimerText.addFocusListener(fFocusListener);
Label readTimerLabel = new Label(dialogComposite, SWT.RIGHT);
readTimerLabel.setText(Messages.TraceControl_ReadTimerPropertyName);
fReadTimerText = new Text(dialogComposite, SWT.NONE);
fReadTimerText.setToolTipText(Messages.TraceControl_EnableChannelReadTimerTooltip);
fReadTimerText.addVerifyListener(fVerifyListener);
+ fReadTimerText.addFocusListener(fFocusListener);
+
+ if (fTargetNodeComponent.isTraceFileRotationSupported()) {
+ Label maxSizeTraceFilesLabel = new Label(dialogComposite, SWT.RIGHT);
+ maxSizeTraceFilesLabel.setText(Messages.TraceControl_MaxSizeTraceFilesPropertyName);
+ fMaxSizeTraceText = new Text(dialogComposite, SWT.NONE);
+ fMaxSizeTraceText.setToolTipText(Messages.TraceControl_EnbleChannelMaxSizeTraceFilesTooltip);
+ fMaxSizeTraceText.addVerifyListener(fVerifyListener);
+ fMaxSizeTraceText.addFocusListener(fFocusListener);
+
+ Label maxNumTraceFilesLabel = new Label(dialogComposite, SWT.RIGHT);
+ maxNumTraceFilesLabel.setText(Messages.TraceControl_MaxNumTraceFilesPropertyName);
+ fMaxNumberTraceText = new Text(dialogComposite, SWT.NONE);
+ fMaxNumberTraceText.setToolTipText(Messages.TraceControl_EnbleChannelMaxNumTraceFilesTooltip);
+ fMaxNumberTraceText.addVerifyListener(fVerifyListener);
+ fMaxNumberTraceText.addFocusListener(fFocusListener);
+ }
+
+ if (fTargetNodeComponent.isPeriodicalMetadataFlushSupported()) {
+ fMetadataChannelButton = new Button(dialogComposite, SWT.CHECK);
+ fMetadataChannelButton.setText(Messages.TraceControl_ConfigureMetadataChannelName);
+ fMetadataChannelButton.setSelection(false);
+
+ fMetadataChannelButton.addSelectionListener(new SelectionAdapter() {
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+ if (fMetadataChannelButton.getSelection()) {
+ fPreviousChannelName = fChannelNameText.getText();
+ fChannelNameText.setText("metadata"); //$NON-NLS-1$
+ fChannelNameText.setEnabled(false);
+ } else {
+ fChannelNameText.setText(fPreviousChannelName);
+ fChannelNameText.setEnabled(true);
+ }
+ }
+ });
+ }
Group discardModeGroup = new Group(dialogComposite, SWT.SHADOW_NONE);
discardModeGroup.setText(Messages.TraceControl_EnableChannelDiscardModeGroupName);
@@ -243,6 +353,27 @@ public class EnableChannelDialog extends Dialog implements IEnableChannelDialog
fUstButton.setText(Messages.TraceControl_UstDisplayName);
fUstButton.setSelection(!fIsKernel);
+ if (fTargetNodeComponent.isPerUIDBuffersSupported()) {
+ Button fDummyButton = new Button(domainGroup, SWT.CHECK);
+ fDummyButton.setEnabled(false);
+ fDummyButton.setVisible(false);
+ fUIDBuffersButton = new Button(domainGroup, SWT.CHECK);
+ fUIDBuffersButton.setText(Messages.TraceControl_PerUidBuffersDisplayName);
+ fUIDBuffersButton.setSelection(false);
+ fUIDBuffersButton.setEnabled(!fIsKernel);
+
+ fUstButton.addSelectionListener(new SelectionAdapter() {
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+ if (fUstButton.getSelection()) {
+ fUIDBuffersButton.setEnabled(true);
+ } else {
+ fUIDBuffersButton.setEnabled(false);
+ }
+ }
+ });
+ }
+
if ((fDomain != null) || (!fHasKernel)) {
fKernelButton.setEnabled(false);
fUstButton.setEnabled(false);
@@ -263,6 +394,14 @@ public class EnableChannelDialog extends Dialog implements IEnableChannelDialog
fKernelButton.setLayoutData(data);
data = new GridData(SWT.BEGINNING, SWT.BEGINNING, true, true);
fUstButton.setLayoutData(data);
+ if (fTargetNodeComponent.isPerUIDBuffersSupported()) {
+ data = new GridData(SWT.BEGINNING, SWT.BEGINNING, true, true);
+ fUIDBuffersButton.setLayoutData(data);
+ }
+ if (fTargetNodeComponent.isPeriodicalMetadataFlushSupported()) {
+ data = new GridData(SWT.BEGINNING, SWT.BEGINNING, true, true);
+ fMetadataChannelButton.setLayoutData(data);
+ }
data = new GridData(GridData.FILL_HORIZONTAL);
data.horizontalSpan = 2;
@@ -272,6 +411,10 @@ public class EnableChannelDialog extends Dialog implements IEnableChannelDialog
fNumberOfSubBuffersText.setLayoutData(data);
fSwitchTimerText.setLayoutData(data);
fReadTimerText.setLayoutData(data);
+ if (fTargetNodeComponent.isTraceFileRotationSupported()) {
+ fMaxNumberTraceText.setLayoutData(data);
+ fMaxSizeTraceText.setLayoutData(data);
+ }
setDefaults();
@@ -289,11 +432,18 @@ public class EnableChannelDialog extends Dialog implements IEnableChannelDialog
protected void okPressed() {
// Set channel information
fChannelInfo = new ChannelInfo(fChannelNameText.getText());
- fChannelInfo.setSubBufferSize(Long.parseLong(fSubBufferSizeText.getText()));
- fChannelInfo.setNumberOfSubBuffers(Integer.parseInt(fNumberOfSubBuffersText.getText()));
- fChannelInfo.setSwitchTimer(Long.parseLong(fSwitchTimerText.getText()));
- fChannelInfo.setReadTimer(Long.parseLong(fReadTimerText.getText()));
+ fChannelInfo.setSubBufferSize(fSubBufferSizeText.getText().equals(DEFAULT_TEXT) ? LTTngControlServiceConstants.UNUSED_VALUE : Long.parseLong(fSubBufferSizeText.getText()));
+ fChannelInfo.setNumberOfSubBuffers(fNumberOfSubBuffersText.getText().equals(DEFAULT_TEXT) ? LTTngControlServiceConstants.UNUSED_VALUE : Integer.parseInt(fNumberOfSubBuffersText.getText()));
+ fChannelInfo.setSwitchTimer(fSwitchTimerText.getText().equals(DEFAULT_TEXT) ? LTTngControlServiceConstants.UNUSED_VALUE : Long.parseLong(fSwitchTimerText.getText()));
+ fChannelInfo.setReadTimer(fReadTimerText.getText().equals(DEFAULT_TEXT) ? LTTngControlServiceConstants.UNUSED_VALUE : Long.parseLong(fReadTimerText.getText()));
fChannelInfo.setOverwriteMode(fOverwriteModeButton.getSelection());
+ if (fTargetNodeComponent.isTraceFileRotationSupported()) {
+ fChannelInfo.setMaxSizeTraceFiles(fMaxSizeTraceText.getText().equals(DEFAULT_TEXT) ? LTTngControlServiceConstants.UNUSED_VALUE : Integer.parseInt(fMaxSizeTraceText.getText()));
+ fChannelInfo.setMaxNumberTraceFiles(fMaxNumberTraceText.getText().equals(DEFAULT_TEXT) ? LTTngControlServiceConstants.UNUSED_VALUE : Integer.parseInt(fMaxNumberTraceText.getText()));
+ }
+ if (fTargetNodeComponent.isPerUIDBuffersSupported()) {
+ fChannelInfo.setBuffersUID(fUIDBuffersButton.getSelection());
+ }
fIsKernel = fKernelButton.getSelection();
@@ -334,15 +484,20 @@ public class EnableChannelDialog extends Dialog implements IEnableChannelDialog
* Sets default value depending on Kernel or UST
*/
private void setDefaults() {
- fSwitchTimerText.setText(String.valueOf(IChannelInfo.DEFAULT_SWITCH_TIMER));
- fReadTimerText.setText(String.valueOf(IChannelInfo.DEFAULT_READ_TIMER));
+ fSwitchTimerText.setText(DEFAULT_TEXT);
+ fSwitchTimerText.setForeground(getShell().getDisplay().getSystemColor(SWT.COLOR_GRAY));
+ fReadTimerText.setText(DEFAULT_TEXT);
+ fReadTimerText.setForeground(getShell().getDisplay().getSystemColor(SWT.COLOR_GRAY));
fOverwriteModeButton.setSelection(IChannelInfo.DEFAULT_OVERWRITE_MODE);
- if (fKernelButton.getSelection()) {
- fSubBufferSizeText.setText(String.valueOf(IChannelInfo.DEFAULT_SUB_BUFFER_SIZE_KERNEL));
- fNumberOfSubBuffersText.setText(String.valueOf(IChannelInfo.DEFAULT_NUMBER_OF_SUB_BUFFERS_KERNEL));
- } else {
- fSubBufferSizeText.setText(String.valueOf(IChannelInfo.DEFAULT_SUB_BUFFER_SIZE_UST));
- fNumberOfSubBuffersText.setText(String.valueOf(IChannelInfo.DEFAULT_NUMBER_OF_SUB_BUFFERS_UST));
+ if (fTargetNodeComponent.isTraceFileRotationSupported()) {
+ fMaxSizeTraceText.setText(DEFAULT_TEXT);
+ fMaxSizeTraceText.setForeground(getShell().getDisplay().getSystemColor(SWT.COLOR_GRAY));
+ fMaxNumberTraceText.setText(DEFAULT_TEXT);
+ fMaxNumberTraceText.setForeground(getShell().getDisplay().getSystemColor(SWT.COLOR_GRAY));
}
+ fSubBufferSizeText.setText(DEFAULT_TEXT);
+ fSubBufferSizeText.setForeground(getShell().getDisplay().getSystemColor(SWT.COLOR_GRAY));
+ fNumberOfSubBuffersText.setText(DEFAULT_TEXT);
+ fNumberOfSubBuffersText.setForeground(getShell().getDisplay().getSystemColor(SWT.COLOR_GRAY));
}
}
diff --git a/lttng/org.eclipse.linuxtools.lttng2.ui/src/org/eclipse/linuxtools/internal/lttng2/ui/views/control/dialogs/IEnableChannelDialog.java b/lttng/org.eclipse.linuxtools.lttng2.ui/src/org/eclipse/linuxtools/internal/lttng2/ui/views/control/dialogs/IEnableChannelDialog.java
index 4f873ce..8024602 100644
--- a/lttng/org.eclipse.linuxtools.lttng2.ui/src/org/eclipse/linuxtools/internal/lttng2/ui/views/control/dialogs/IEnableChannelDialog.java
+++ b/lttng/org.eclipse.linuxtools.lttng2.ui/src/org/eclipse/linuxtools/internal/lttng2/ui/views/control/dialogs/IEnableChannelDialog.java
@@ -12,6 +12,7 @@
package org.eclipse.linuxtools.internal.lttng2.ui.views.control.dialogs;
import org.eclipse.linuxtools.internal.lttng2.core.control.model.IChannelInfo;
+import org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.impl.TargetNodeComponent;
import org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.impl.TraceDomainComponent;
/**
@@ -38,6 +39,12 @@ public interface IEnableChannelDialog {
void setDomainComponent(TraceDomainComponent domain);
/**
+ * Set the targent node component
+ * @param node - the node component
+ */
+ void setTargetNodeComponent(TargetNodeComponent node);
+
+ /**
* @return true for Kernel domain. False for UST.
*/
boolean isKernel();
diff --git a/lttng/org.eclipse.linuxtools.lttng2.ui/src/org/eclipse/linuxtools/internal/lttng2/ui/views/control/handlers/BaseEnableChannelHandler.java b/lttng/org.eclipse.linuxtools.lttng2.ui/src/org/eclipse/linuxtools/internal/lttng2/ui/views/control/handlers/BaseEnableChannelHandler.java
index 358d0c9..44406c6 100644
--- a/lttng/org.eclipse.linuxtools.lttng2.ui/src/org/eclipse/linuxtools/internal/lttng2/ui/views/control/handlers/BaseEnableChannelHandler.java
+++ b/lttng/org.eclipse.linuxtools.lttng2.ui/src/org/eclipse/linuxtools/internal/lttng2/ui/views/control/handlers/BaseEnableChannelHandler.java
@@ -82,6 +82,7 @@ abstract class BaseEnableChannelHandler extends BaseControlViewHandler {
final CommandParameter param = fParam.clone();
final IEnableChannelDialog dialog = TraceControlDialogFactory.getInstance().getEnableChannelDialog();
+ dialog.setTargetNodeComponent(param.getSession().getTargetNode());
dialog.setDomainComponent(getDomain(param));
dialog.setHasKernel(param.getSession().hasKernelProvider());
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 a7d541b..760802d 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
@@ -25,6 +25,8 @@ import org.eclipse.osgi.util.NLS;
final public class Messages extends NLS {
private static final String BUNDLE_NAME = "org.eclipse.linuxtools.internal.lttng2.ui.views.control.messages.messages"; //$NON-NLS-1$
+ public static String EnableChannelDialog_DefaultMessage;
+
// Failures
public static String TraceControl_ConnectionFailure;
public static String TraceControl_DisconnectionFailure;
@@ -146,6 +148,8 @@ final public class Messages extends NLS {
public static String TraceControl_EnableChannelDiscardModeTooltip;
public static String TraceControl_EnableChannelOverwriteModeLabel;
public static String TraceControl_EnableChannelOverwriteModeTooltip;
+ public static String TraceControl_EnbleChannelMaxSizeTraceFilesTooltip;
+ public static String TraceControl_EnbleChannelMaxNumTraceFilesTooltip;
public static String TraceControl_InvalidChannelNameError;
public static String TraceControl_ChannelAlreadyExistsError;
@@ -225,6 +229,7 @@ final public class Messages extends NLS {
public static String TraceControl_EventDisplayName;
public static String TraceControl_ProviderDisplayName;
public static String TraceControl_KernelProviderDisplayName;
+ public static String TraceControl_PerUidBuffersDisplayName;
// Property names
public static String TraceControl_SessionNamePropertyName;
@@ -251,6 +256,9 @@ final public class Messages extends NLS {
public static String TraceControl_ProbeAddressPropertyName;
public static String TraceControl_ProbeOffsetPropertyName;
public static String TraceControl_ProbeSymbolPropertyName;
+ public static String TraceControl_MaxSizeTraceFilesPropertyName;
+ public static String TraceControl_MaxNumTraceFilesPropertyName;
+ public static String TraceControl_ConfigureMetadataChannelName;
// Preferences
public static String TraceControl_TracingGroupPreference;
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 6097fee..121a090 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
@@ -10,6 +10,7 @@
# Bernd Hufmann - initial API and implementation
###############################################################################
+EnableChannelDialog_DefaultMessage=Default
TraceControl_ConnectionFailure=Connecting to host failed
TraceControl_DisconnectionFailure=Disconnection from host failed
TraceControl_ExecutionCancelled=Command Execution cancelled
@@ -124,9 +125,9 @@ TraceControl_FileSubSystemError=File subsystem error in session creation dialog.
TraceControl_EnableChannelDialogTitle=Enable Channel
TraceControl_EnableChannelNameLabel=Channel Name
TraceControl_EnableChannelNameTooltip=The name of the channel to be enabled.
-TraceControl_EnableChannelSubBufferSizeTooltip=The sub-buffers size of the channel. Needs to be a power of 2 for kernel and ust tracers.
-TraceControl_EnableChannelNbSubBuffersTooltip=The number of sub-buffers of the channel. Needs to be a power of 2 for kernel and ust tracers.
-TraceControl_EnableChannelSwitchTimerTooltip=The Switch subbuffer timer interval in usec (default: 0). Needs to be a power of 2 for kernel and ust tracers.
+TraceControl_EnableChannelSubBufferSizeTooltip=The sub-buffers size of the channel. Needs to be a power of 2 for kernel and ust tracers (Only for versions prior to 2.2.0).
+TraceControl_EnableChannelNbSubBuffersTooltip=The number of sub-buffers of the channel. Needs to be a power of 2 for kernel and ust tracers (Only for versions prior to 2.2.0).
+TraceControl_EnableChannelSwitchTimerTooltip=The Switch subbuffer timer interval in usec (default: 0). Needs to be a power of 2 for kernel and ust tracers (Only for versions prior to 2.2.0).
TraceControl_EnableChannelReadTimerTooltip=The Read timer interval in usec.
TraceControl_EnableChannelOutputTypeTooltip=The output type of the channel.
TraceControl_EnableChannelDiscardModeGroupName=Discard Mode
@@ -134,6 +135,8 @@ TraceControl_EnableChannelDiscardModeLabel=Discard
TraceControl_EnableChannelDiscardModeTooltip=Discard event when subbuffers are full
TraceControl_EnableChannelOverwriteModeLabel=Overwrite
TraceControl_EnableChannelOverwriteModeTooltip=Flight recorder mode : overwrites events when subbuffers are full
+TraceControl_EnbleChannelMaxSizeTraceFilesTooltip=Maximum size of each tracefile within a stream (in bytes). 0 means unlimited
+TraceControl_EnbleChannelMaxNumTraceFilesTooltip=Used in conjunction with the maximum size of trace files option, this will limit the number of files created to the specified count. 0 means unlimited
TraceControl_InvalidChannelNameError=The channel name is invalid or empty
TraceControl_ChannelAlreadyExistsError=Channel already exists
@@ -213,6 +216,7 @@ TraceControl_ChannelDisplayName=Channel
TraceControl_EventDisplayName=Event
TraceControl_ProviderDisplayName=Provider
TraceControl_KernelProviderDisplayName=Kernel
+TraceControl_PerUidBuffersDisplayName=Per UID buffers
# Property names
TraceControl_SessionNamePropertyName=Session Name
@@ -239,6 +243,9 @@ TraceControl_ProcessIdPropertyName=Process ID
TraceControl_ProbeAddressPropertyName=Address
TraceControl_ProbeOffsetPropertyName=Offset
TraceControl_ProbeSymbolPropertyName=Symbol
+TraceControl_MaxSizeTraceFilesPropertyName=Maximum size of trace files
+TraceControl_MaxNumTraceFilesPropertyName=Maximum number of trace files
+TraceControl_ConfigureMetadataChannelName=Configure metadata channel
# Preferences
TraceControl_TracingGroupPreference=&Tracing Group
diff --git a/lttng/org.eclipse.linuxtools.lttng2.ui/src/org/eclipse/linuxtools/internal/lttng2/ui/views/control/model/impl/TargetNodeComponent.java b/lttng/org.eclipse.linuxtools.lttng2.ui/src/org/eclipse/linuxtools/internal/lttng2/ui/views/control/model/impl/TargetNodeComponent.java
index 5b01e7b..926d632 100644
--- a/lttng/org.eclipse.linuxtools.lttng2.ui/src/org/eclipse/linuxtools/internal/lttng2/ui/views/control/model/impl/TargetNodeComponent.java
+++ b/lttng/org.eclipse.linuxtools.lttng2.ui/src/org/eclipse/linuxtools/internal/lttng2/ui/views/control/model/impl/TargetNodeComponent.java
@@ -233,6 +233,30 @@ public class TargetNodeComponent extends TraceControlComponent implements ICommu
return getControlService().isVersionSupported("2.1.0"); //$NON-NLS-1$
}
+ /**
+ * Returns if node supports per UID buffers or not
+ * @return <code>true</code> if node supports per UID buffers else <code>false</code>
+ */
+ public boolean isPerUIDBuffersSupported() {
+ return getControlService().isVersionSupported("2.2.0"); //$NON-NLS-1$
+ }
+
+ /**
+ * Returns if node supports trace file rotation or not
+ * @return <code>true</code> if node supports trace file rotation else <code>false</code>
+ */
+ public boolean isTraceFileRotationSupported() {
+ return getControlService().isVersionSupported("2.2.0"); //$NON-NLS-1$
+ }
+
+ /**
+ * Returns if node supports periodical flush for metadata or not
+ * @return <code>true</code> if node supports periodical flush for metadata else <code>false</code>
+ */
+ public boolean isPeriodicalMetadataFlushSupported() {
+ return getControlService().isVersionSupported("2.2.0"); //$NON-NLS-1$
+ }
+
// ------------------------------------------------------------------------
// Operations
// ------------------------------------------------------------------------
diff --git a/lttng/org.eclipse.linuxtools.lttng2.ui/src/org/eclipse/linuxtools/internal/lttng2/ui/views/control/service/LTTngControlService.java b/lttng/org.eclipse.linuxtools.lttng2.ui/src/org/eclipse/linuxtools/internal/lttng2/ui/views/control/service/LTTngControlService.java
index 2eb8fba..4517baa 100644
--- a/lttng/org.eclipse.linuxtools.lttng2.ui/src/org/eclipse/linuxtools/internal/lttng2/ui/views/control/service/LTTngControlService.java
+++ b/lttng/org.eclipse.linuxtools.lttng2.ui/src/org/eclipse/linuxtools/internal/lttng2/ui/views/control/service/LTTngControlService.java
@@ -9,6 +9,7 @@
* Contributors:
* Bernd Hufmann - Initial API and implementation
* Bernd Hufmann - Updated for support of LTTng Tools 2.1
+ * Simon Delisle - Updated for support of LTTng Tools 2.2
**********************************************************************/
package org.eclipse.linuxtools.internal.lttng2.ui.views.control.service;
@@ -575,21 +576,47 @@ public class LTTngControlService implements ILttngControlService {
}
// --subbuf-size SIZE Subbuffer size in bytes
// (default: 4096, kernel default: 262144)
- command.append(LTTngControlServiceConstants.OPTION_SUB_BUFFER_SIZE);
- command.append(String.valueOf(info.getSubBufferSize()));
+ if (info.getSubBufferSize() != LTTngControlServiceConstants.UNUSED_VALUE) {
+ command.append(LTTngControlServiceConstants.OPTION_SUB_BUFFER_SIZE);
+ command.append(String.valueOf(info.getSubBufferSize()));
+ }
// --num-subbuf NUM Number of subbufers
-// (default: 8, kernel default: 4)
- command.append(LTTngControlServiceConstants.OPTION_NUM_SUB_BUFFERS);
- command.append(String.valueOf(info.getNumberOfSubBuffers()));
+ if (info.getNumberOfSubBuffers() != LTTngControlServiceConstants.UNUSED_VALUE) {
+ command.append(LTTngControlServiceConstants.OPTION_NUM_SUB_BUFFERS);
+ command.append(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()));
+ }
-// --switch-timer USEC Switch timer interval in usec (default: 0)
- command.append(LTTngControlServiceConstants.OPTION_SWITCH_TIMER);
- command.append(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()));
+ }
-// --read-timer USEC Read timer interval in usec (default: 200)
- command.append(LTTngControlServiceConstants.OPTION_READ_TIMER);
- command.append(String.valueOf(info.getReadTimer()));
+ if (isVersionSupported("2.2.0")) { //$NON-NLS-1$
+// --buffer-uid Every application sharing the same UID use the same buffers
+ if (!isKernel && info.isBuffersUID()) {
+ command.append(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()));
+ }
+
+// -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()));
+ }
+ }
}
executeCommand(command.toString(), monitor);
diff --git a/lttng/org.eclipse.linuxtools.lttng2.ui/src/org/eclipse/linuxtools/internal/lttng2/ui/views/control/service/LTTngControlServiceConstants.java b/lttng/org.eclipse.linuxtools.lttng2.ui/src/org/eclipse/linuxtools/internal/lttng2/ui/views/control/service/LTTngControlServiceConstants.java
index bc3216f..0e549e5 100644
--- a/lttng/org.eclipse.linuxtools.lttng2.ui/src/org/eclipse/linuxtools/internal/lttng2/ui/views/control/service/LTTngControlServiceConstants.java
+++ b/lttng/org.eclipse.linuxtools.lttng2.ui/src/org/eclipse/linuxtools/internal/lttng2/ui/views/control/service/LTTngControlServiceConstants.java
@@ -9,6 +9,7 @@
* Contributors:
* Bernd Hufmann - Initial API and implementation
* Bernd Hufmann - Updated for support of LTTng Tools 2.1
+ * Simon Delisle - Updated for support of LTTng Tools 2.2
**********************************************************************/
package org.eclipse.linuxtools.internal.lttng2.ui.views.control.service;
@@ -32,6 +33,14 @@ public interface LTTngControlServiceConstants {
static final Pattern VERSION_2_PATTERN = Pattern.compile("(2\\.\\d+\\.\\d+).*"); //$NON-NLS-1$
// ------------------------------------------------------------------------
+ // Constants
+ // ------------------------------------------------------------------------
+ /**
+ * Unused value
+ */
+ static final int UNUSED_VALUE = -1;
+
+ // ------------------------------------------------------------------------
// Command constants
// ------------------------------------------------------------------------
/**
@@ -214,6 +223,18 @@ public interface LTTngControlServiceConstants {
* Command line option for configuring the streaming data URL.
*/
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$
+ /**
+ * Command line option for maximum size of trace files
+ */
+ 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$
// ------------------------------------------------------------------------
// Parsing constants