[[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'''.
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.
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());
}
/**
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();
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();
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);
fixture.setNumberOfSubBuffers(7);
fixture.setOutputType("mmap()");
fixture.setSubBufferSize(8L);
+ fixture.setMaxSizeTraceFiles(4096);
+ fixture.setMaxNumberTraceFiles(10);
+ fixture.setBuffersUID(false);
switchTimer = fixture.getSwitchTimer();
assertEquals(5L, switchTimer);
subBufferSize = fixture.getSubBufferSize();
assertEquals(8L, subBufferSize);
+
+ maxSizeTraceFiles = fixture.getMaxSizeTraceFiles();
+ assertEquals(4096, maxSizeTraceFiles);
+
+ maxNumberTraceFiles = fixture.getMaxNumberTraceFiles();
+ assertEquals(10, maxNumberTraceFiles);
+
+ buffersUID = fixture.isBuffersUID();
+ assertFalse(buffersUID);
}
/**
*
* 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;
* 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.
* @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();
}
*
* 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;
* 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;
// ------------------------------------------------------------------------
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();) {
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;
+ }
}
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
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) {
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;
/**
// Attributes
// ------------------------------------------------------------------------
private TraceDomainComponent fDomain;
+ private TargetNodeComponent fTargetNodeComponent;
private ChannelInfo fChannelInfo;
private boolean fIsKernel;
public void setChannelInfo(ChannelInfo info) {
fChannelInfo = info;
}
+
+ @Override
+ public void setTargetNodeComponent(TargetNodeComponent node) {
+ fTargetNodeComponent = node;
+ }
}
\ No newline at end of file
<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>
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>
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>
*
* 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;
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;
*/
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
// ------------------------------------------------------------------------
* 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.
*/
* 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
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);
}
fHasKernel = hasKernel;
}
+ @Override
+ public void setTargetNodeComponent(TargetNodeComponent node) {
+ fTargetNodeComponent = node;
+ }
+
// ------------------------------------------------------------------------
// Operations
// ------------------------------------------------------------------------
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);
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);
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;
fNumberOfSubBuffersText.setLayoutData(data);
fSwitchTimerText.setLayoutData(data);
fReadTimerText.setLayoutData(data);
+ if (fTargetNodeComponent.isTraceFileRotationSupported()) {
+ fMaxNumberTraceText.setLayoutData(data);
+ fMaxSizeTraceText.setLayoutData(data);
+ }
setDefaults();
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();
* 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));
}
}
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;
/**
*/
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.
*/
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());
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;
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;
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;
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;
# 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
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
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
TraceControl_EventDisplayName=Event
TraceControl_ProviderDisplayName=Provider
TraceControl_KernelProviderDisplayName=Kernel
+TraceControl_PerUidBuffersDisplayName=Per UID buffers
# Property names
TraceControl_SessionNamePropertyName=Session Name
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
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
// ------------------------------------------------------------------------
* 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;
}
// --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);
* 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;
*/
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
// ------------------------------------------------------------------------
* 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