LTTng: Support for LTTng Tools 2.2
authorSimon Delisle <simon.delisle@ericsson.com>
Wed, 26 Jun 2013 15:58:39 +0000 (11:58 -0400)
committerBernd Hufmann <bernd.hufmann@ericsson.com>
Tue, 30 Jul 2013 15:20:31 +0000 (11:20 -0400)
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>
19 files changed:
org.eclipse.linuxtools.lttng.help/doc/User-Guide.mediawiki
org.eclipse.linuxtools.lttng.help/doc/images/LTTng2CreateChannelDialog.png
org.eclipse.linuxtools.lttng.help/doc/images/LTTng2CreateChannelDialogFileRotation.png [new file with mode: 0644]
org.eclipse.linuxtools.lttng.help/doc/images/LTTng2CreateChannelDialogMetadataFlush.png [new file with mode: 0644]
org.eclipse.linuxtools.lttng.help/doc/images/LTTng2CreateChannelDialogPerUIDBuffers.png [new file with mode: 0644]
org.eclipse.linuxtools.lttng2.core.tests/src/org/eclipse/linuxtools/lttng2/core/tests/control/model/impl/ChannelInfoTest.java
org.eclipse.linuxtools.lttng2.core/src/org/eclipse/linuxtools/internal/lttng2/core/control/model/IChannelInfo.java
org.eclipse.linuxtools.lttng2.core/src/org/eclipse/linuxtools/internal/lttng2/core/control/model/impl/ChannelInfo.java
org.eclipse.linuxtools.lttng2.ui.tests/src/org/eclipse/linuxtools/lttng2/ui/tests/control/service/LTTngControlServiceTest.java
org.eclipse.linuxtools.lttng2.ui.tests/stubs/org/eclipse/linuxtools/internal/lttng2/stubs/dialogs/EnableChannelDialogStub.java
org.eclipse.linuxtools.lttng2.ui.tests/testfiles/LTTngServiceTest.cfg
org.eclipse.linuxtools.lttng2.ui/src/org/eclipse/linuxtools/internal/lttng2/ui/views/control/dialogs/EnableChannelDialog.java
org.eclipse.linuxtools.lttng2.ui/src/org/eclipse/linuxtools/internal/lttng2/ui/views/control/dialogs/IEnableChannelDialog.java
org.eclipse.linuxtools.lttng2.ui/src/org/eclipse/linuxtools/internal/lttng2/ui/views/control/handlers/BaseEnableChannelHandler.java
org.eclipse.linuxtools.lttng2.ui/src/org/eclipse/linuxtools/internal/lttng2/ui/views/control/messages/Messages.java
org.eclipse.linuxtools.lttng2.ui/src/org/eclipse/linuxtools/internal/lttng2/ui/views/control/messages/messages.properties
org.eclipse.linuxtools.lttng2.ui/src/org/eclipse/linuxtools/internal/lttng2/ui/views/control/model/impl/TargetNodeComponent.java
org.eclipse.linuxtools.lttng2.ui/src/org/eclipse/linuxtools/internal/lttng2/ui/views/control/service/LTTngControlService.java
org.eclipse.linuxtools.lttng2.ui/src/org/eclipse/linuxtools/internal/lttng2/ui/views/control/service/LTTngControlServiceConstants.java

index 05118ac4d40b6b0ee8fb0a0bcd1f28b7d4eb14d2..0c390e5d1667699d9e5152e21e894b8fa5a079f9 100644 (file)
@@ -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.
index 592c67a2d1fef5a561afd17b2417b713345518a6..c675071b1fb7cf0c996974a3fa509d46922a2bae 100644 (file)
Binary files a/org.eclipse.linuxtools.lttng.help/doc/images/LTTng2CreateChannelDialog.png and b/org.eclipse.linuxtools.lttng.help/doc/images/LTTng2CreateChannelDialog.png differ
diff --git a/org.eclipse.linuxtools.lttng.help/doc/images/LTTng2CreateChannelDialogFileRotation.png b/org.eclipse.linuxtools.lttng.help/doc/images/LTTng2CreateChannelDialogFileRotation.png
new file mode 100644 (file)
index 0000000..087cb23
Binary files /dev/null and b/org.eclipse.linuxtools.lttng.help/doc/images/LTTng2CreateChannelDialogFileRotation.png differ
diff --git a/org.eclipse.linuxtools.lttng.help/doc/images/LTTng2CreateChannelDialogMetadataFlush.png b/org.eclipse.linuxtools.lttng.help/doc/images/LTTng2CreateChannelDialogMetadataFlush.png
new file mode 100644 (file)
index 0000000..e53ee5f
Binary files /dev/null and b/org.eclipse.linuxtools.lttng.help/doc/images/LTTng2CreateChannelDialogMetadataFlush.png differ
diff --git a/org.eclipse.linuxtools.lttng.help/doc/images/LTTng2CreateChannelDialogPerUIDBuffers.png b/org.eclipse.linuxtools.lttng.help/doc/images/LTTng2CreateChannelDialogPerUIDBuffers.png
new file mode 100644 (file)
index 0000000..d8ea6c6
Binary files /dev/null and b/org.eclipse.linuxtools.lttng.help/doc/images/LTTng2CreateChannelDialogPerUIDBuffers.png differ
index 89754b1e5a6b0afb532673e3bef5a4b9f3215779..0f94c5a40dc5f4fb15bb24a321310e54b92c0844 100644 (file)
@@ -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);
     }
 
     /**
index a048307c63a79f4b6324c928a82c25823b553f29..c4428d66d518ce81e6689832ac070c0d8186ceb7 100644 (file)
@@ -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();
 }
index 641d00c961209058cdda031158fff082f366e369..ccbb390c58303fa408c4571d40c00f9b2cd8babf 100644 (file)
@@ -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;
+    }
 }
index dd4881bf2b13dcd420060f1be1aa7da466395853..1e00346bbbe57a9d0a29de44c54ab7183a137b6d 100644 (file)
@@ -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) {
index cc8b34c0324c2a1d3d186978f77a031deb5ee9a4..46f528b3cd4d8c51a46f1178d254fa216cf84820 100644 (file)
@@ -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
index d9b9e823ba20d909688837c07afcce03cc844b80..2bb70d7b7b1482a300962bef7752ffd9b874ecad 100644 (file)
@@ -650,6 +650,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>
@@ -661,6 +672,16 @@ Kernel channel mychannel0 enabled for session mysession2
 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>
@@ -671,6 +692,26 @@ lttng enable-channel ustChannel -u  -s mysession2 --overwrite  --subbuf-size 327
 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>
index ae92efb5c79f12cf677b37410d7a0e12545fbec7..fc217522cb8ee09d0f6d4d55f45494a48746ee24 100644 (file)
@@ -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
     // ------------------------------------------------------------------------
@@ -93,10 +105,18 @@ public class EnableChannelDialog extends Dialog implements IEnableChannelDialog
      * Null in case of creation on session level.
      */
     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.
      */
@@ -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));
     }
 }
index 4f873ce88efd60df0e86eb22b06d37743293c5e8..8024602df07f9e193d4e090e8c6151da88be9f6e 100644 (file)
@@ -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;
 
 /**
@@ -37,6 +38,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.
      */
index 358d0c9ba8e79cb170cbdc9db2eb3644c82093c0..44406c63ef0ac6d24eddbf589d0e6e47b1825c26 100644 (file)
@@ -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());
 
index a7d541b51672a39d40d1b0a4f86c96e0e5899088..760802d9cfb216496b43da43d55bbf87eaf3edc1 100644 (file)
@@ -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;
index 6097feececd6ccf40fc7da80419c94d25e6c54fd..121a090a86e4efbc6f6d7c39e3760c9dcffc9ed8 100644 (file)
@@ -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
index 5b01e7b291c55dfefa4235d1304ead4a2b9e8e45..926d632e98b2ae90b2396d13a6e45b3e1e4f2b02 100644 (file)
@@ -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
     // ------------------------------------------------------------------------
index 2eb8fba79d46e6db36f8c4c9155ac90afc1d71bc..4517baa5bc54c3b372857ad77a195fbab33446bd 100644 (file)
@@ -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);
index bc3216fa2d17053d10a486fcf7ca2702773bd2b2..0e549e580b1ab3ca9b4f601bdc30b4ab391a8020 100644 (file)
@@ -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;
 
@@ -31,6 +32,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
This page took 0.044147 seconds and 5 git commands to generate.