** '''State''': The state of the session ('''ACTIVE''' or '''INACTIVE''')
* '''Domain''' Properties
** '''Domain Name''': The name of the domain.
+** '''Buffer Type''': The buffer type of the domain.
* '''Channel''' Properties
** '''Channel Name''': The name of the channel.
** '''Number of Sub Buffers''': The number of sub-buffers of the channel.
*/
void setIsKernel(boolean isKernel);
+ /**
+ * @return Information about the buffer type
+ */
+ String getBufferType();
+
+ /**
+ * Sets the buffer type
+ *
+ * @param bufferType
+ * The buffer type
+ */
+ void setBufferType(String bufferType);
+
}
--- /dev/null
+/**********************************************************************
+ * Copyright (c) 2013 Ericsson
+ *
+ * All rights reserved. This program and the accompanying materials are
+ * made available under the terms of the Eclipse Public License v1.0 which
+ * accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Simon Delisle - Initial API and implementation
+ **********************************************************************/
+
+package org.eclipse.linuxtools.internal.lttng2.core.control.model.impl;
+
+/**
+ * Constants for buffer type.
+ *
+ * @author Simon Delisle
+ */
+public interface BufferTypeConstants {
+ // ------------------------------------------------------------------------
+ // Buffer type
+ // ------------------------------------------------------------------------
+ /**
+ * Buffer type : per UID
+ */
+ static final String BUFFER_PER_UID = "per UID"; //$NON-NLS-1$
+ /**
+ * Buffer type : per PID
+ */
+ static final String BUFFER_PER_PID = "per PID"; //$NON-NLS-1$
+ /**
+ * Buffer type : shared
+ */
+ static final String BUFFER_SHARED = "shared"; //$NON-NLS-1$
+ /**
+ * If the LTTng version doesn't show the buffer type
+ */
+ static final String BUFFER_TYPE_UNKNOWN = "information not unavailable"; //$NON-NLS-1$
+
+}
*/
private final List<IChannelInfo> fChannels = new ArrayList<IChannelInfo>();
private boolean fIsKernel = false;
+ private String fBufferType = null;
// ------------------------------------------------------------------------
// Constructors
return true;
}
+ @Override
+ public String getBufferType() {
+ if (fIsKernel) {
+ return BufferTypeConstants.BUFFER_SHARED;
+ }
+ return fBufferType;
+ }
+
+ @Override
+ public void setBufferType(String bufferType) {
+ fBufferType = bufferType;
+ }
+
@SuppressWarnings("nls")
@Override
public String toString() {
output.append(")]");
return output.toString();
}
-
}
import org.eclipse.linuxtools.internal.lttng2.core.control.model.TraceEventType;
import org.eclipse.linuxtools.internal.lttng2.core.control.model.TraceLogLevel;
import org.eclipse.linuxtools.internal.lttng2.core.control.model.TraceSessionState;
+import org.eclipse.linuxtools.internal.lttng2.core.control.model.impl.BufferTypeConstants;
import org.eclipse.linuxtools.internal.lttng2.stubs.service.TestRemoteSystemProxy;
import org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.ITraceControlComponent;
import org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.impl.BaseEventComponent;
assertNotNull(domainSource.getPropertyDescriptors());
assertEquals("Kernel", domainSource.getPropertyValue(TraceDomainPropertySource.TRACE_DOMAIN_NAME_PROPERTY_ID));
+ assertEquals(BufferTypeConstants.BUFFER_SHARED, domainSource.getPropertyValue(TraceDomainPropertySource.BUFFER_TYPE_PROPERTY_ID));
ITraceControlComponent[] channels = domains[0].getChildren();
assertNotNull(channels);
// Attributes
// ------------------------------------------------------------------------
private TraceDomainComponent fDomain;
- private TargetNodeComponent fTargetNodeComponent;
private ChannelInfo fChannelInfo;
private boolean fIsKernel;
@Override
public void setTargetNodeComponent(TargetNodeComponent node) {
- fTargetNodeComponent = node;
+ // Do nothing
}
}
\ No newline at end of file
public static String TraceControl_StatePropertyName;
public static String TraceControl_VersionPropertyName;
public static String TraceControl_DomainNamePropertyName;
+ public static String TraceControl_BufferTypePropertyName;
public static String TraceControl_ChannelNamePropertyName;
public static String TraceControl_OverwriteModePropertyName;
public static String TraceControl_SubBufferSizePropertyName;
TraceControl_StatePropertyName=State
TraceControl_VersionPropertyName=Version
TraceControl_DomainNamePropertyName=Domain Name
+TraceControl_BufferTypePropertyName=Buffer type
TraceControl_ChannelNamePropertyName=Channel Name
TraceControl_OverwriteModePropertyName=Overwrite Mode
TraceControl_SubBufferSizePropertyName=Sub Buffer Size
return ((TraceSessionComponent)getParent()).getTargetNode();
}
+ /**
+ * @return the buffer type
+ */
+ public String getBufferType(){
+ return fDomainInfo.getBufferType();
+ }
+
// ------------------------------------------------------------------------
// Operations
// ------------------------------------------------------------------------
**********************************************************************/
package org.eclipse.linuxtools.internal.lttng2.ui.views.control.property;
+import org.eclipse.linuxtools.internal.lttng2.core.control.model.impl.BufferTypeConstants;
import org.eclipse.linuxtools.internal.lttng2.ui.views.control.messages.Messages;
import org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.impl.TraceDomainComponent;
import org.eclipse.linuxtools.tmf.ui.properties.ReadOnlyTextPropertyDescriptor;
* The trace domain 'name' property name.
*/
public static final String TRACE_DOMAIN_NAME_PROPERTY_NAME = Messages.TraceControl_DomainNamePropertyName;
+ /**
+ * The domain 'buffer type' property ID.
+ */
+ public static final String BUFFER_TYPE_PROPERTY_ID = "trace.domain.bufferType"; //$NON-NLS-1$
+ /**
+ * The domain 'buffer type' property name.
+ */
+ public static final String BUFER_TYPE_PROPERTY_NAME = Messages.TraceControl_BufferTypePropertyName;
// ------------------------------------------------------------------------
// Attributes
/**
* The trace domain component which this property source is for.
*/
- private final TraceDomainComponent fBaseEvent;
+ private final TraceDomainComponent fDomain;
// ------------------------------------------------------------------------
// Constructors
* @param component - the trace domain component
*/
public TraceDomainPropertySource(TraceDomainComponent component) {
- fBaseEvent = component;
+ fDomain = component;
}
// ------------------------------------------------------------------------
@Override
public IPropertyDescriptor[] getPropertyDescriptors() {
+ if (fDomain.getBufferType().equals(BufferTypeConstants.BUFFER_TYPE_UNKNOWN)) {
+ return new IPropertyDescriptor[] {
+ new ReadOnlyTextPropertyDescriptor(TRACE_DOMAIN_NAME_PROPERTY_ID, TRACE_DOMAIN_NAME_PROPERTY_NAME) };
+ }
+
return new IPropertyDescriptor[] {
- new ReadOnlyTextPropertyDescriptor(TRACE_DOMAIN_NAME_PROPERTY_ID, TRACE_DOMAIN_NAME_PROPERTY_NAME)};
+ new ReadOnlyTextPropertyDescriptor(TRACE_DOMAIN_NAME_PROPERTY_ID, TRACE_DOMAIN_NAME_PROPERTY_NAME),
+ new ReadOnlyTextPropertyDescriptor(BUFFER_TYPE_PROPERTY_ID, BUFER_TYPE_PROPERTY_NAME) };
}
@Override
public Object getPropertyValue(Object id) {
+ if(BUFFER_TYPE_PROPERTY_ID.equals(id)){
+ return fDomain.getBufferType();
+ }
+
if(TRACE_DOMAIN_NAME_PROPERTY_ID.equals(id)) {
- return fBaseEvent.getName();
+ return fDomain.getName();
}
return null;
}
import org.eclipse.linuxtools.internal.lttng2.core.control.model.TraceEventType;
import org.eclipse.linuxtools.internal.lttng2.core.control.model.TraceLogLevel;
import org.eclipse.linuxtools.internal.lttng2.core.control.model.impl.BaseEventInfo;
+import org.eclipse.linuxtools.internal.lttng2.core.control.model.impl.BufferTypeConstants;
import org.eclipse.linuxtools.internal.lttng2.core.control.model.impl.ChannelInfo;
import org.eclipse.linuxtools.internal.lttng2.core.control.model.impl.DomainInfo;
import org.eclipse.linuxtools.internal.lttng2.core.control.model.impl.EventInfo;
// in domain kernel
ArrayList<IChannelInfo> channels = new ArrayList<IChannelInfo>();
- index = parseDomain(result.getOutput(), index, channels);
+ index = parseDomain(result.getOutput(), index, channels, domainInfo);
if (channels.size() > 0) {
// add domain
// in domain UST
ArrayList<IChannelInfo> channels = new ArrayList<IChannelInfo>();
- index = parseDomain(result.getOutput(), index, channels);
+ index = parseDomain(result.getOutput(), index, channels, domainInfo);
if (channels.size() > 0) {
// add domain
* - current index in command output array
* @param channels
* - list for returning channel information
+ * @param domainInfo
+ * - The domain information
* @return the new current index in command output array
*/
- protected int parseDomain(String[] output, int currentIndex, List<IChannelInfo> channels) {
+ protected int parseDomain(String[] output, int currentIndex, List<IChannelInfo> channels, IDomainInfo domainInfo) {
int index = currentIndex;
// Channels:
while (index < output.length) {
String line = output[index];
+ if (isVersionSupported("2.2.0")) { //$NON-NLS-1$
+ Matcher bufferTypeMatcher = LTTngControlServiceConstants.BUFFER_TYPE_PATTERN.matcher(line);
+ if (bufferTypeMatcher.matches()) {
+ domainInfo.setBufferType(getAttributeValue(line));
+ }
+ } else {
+ domainInfo.setBufferType(BufferTypeConstants.BUFFER_TYPE_UNKNOWN);
+ }
Matcher outerMatcher = LTTngControlServiceConstants.CHANNELS_SECTION_PATTERN.matcher(line);
Matcher noKernelChannelMatcher = LTTngControlServiceConstants.DOMAIN_NO_KERNEL_CHANNEL_PATTERN.matcher(line);
Matcher noUstChannelMatcher = LTTngControlServiceConstants.DOMAIN_NO_UST_CHANNEL_PATTERN.matcher(line);
* Pattern to match for matching warning about no UST channel
*/
static final Pattern DOMAIN_NO_UST_CHANNEL_PATTERN = Pattern.compile("\\s*Error\\:\\s+UST\\s+channel\\s+not\\s+found.*"); //$NON-NLS-1$
+ /**
+ * Pattern to match for buffer type (lttng list <session>)
+ */
+ static final Pattern BUFFER_TYPE_PATTERN = Pattern.compile("\\s*Buffer\\s+type\\:.*"); //$NON-NLS-1$
/**
* Pattern to match for channels section (lttng list <session>)
*/