** '''State''': The channel state ('''ENABLED''' or '''DISABLED''')
** '''Sub Buffer size''': The size of the sub-buffers of the channel (in bytes).
** '''Switch Timer Interval''': The switch timer interval.
+** '''Number of Discarded Events''': The number of discarded events of the channel.
+** '''Number of Lost Packets''': The number of lost packets of the channel.
* '''Event''' Properties (Channel)
** '''Event Name''': The name of the event.
** '''Event Type''': The event type ('''TRACEPOINT''', '''SYSCALL''' or '''PROBE''').
assertEquals(0, result.getMaxSizeTraceFiles());
assertEquals(0, result.getMaxNumberTraceFiles());
assertEquals(BufferType.BUFFER_TYPE_UNKNOWN, result.getBufferType());
+ assertEquals(0, result.getNumberOfDiscardedEvents());
+ assertEquals(0, result.getNumberOfLostPackets());
}
/**
assertEquals(fChannelInfo1.getMaxSizeTraceFiles(), channelInfo.getMaxSizeTraceFiles());
assertEquals(fChannelInfo1.getMaxNumberTraceFiles(), channelInfo.getMaxNumberTraceFiles());
assertEquals(fChannelInfo1.getBufferType(), channelInfo.getBufferType());
+ assertEquals(fChannelInfo1.getNumberOfDiscardedEvents(), channelInfo.getNumberOfDiscardedEvents());
+ assertEquals(fChannelInfo1.getNumberOfLostPackets(), channelInfo.getNumberOfLostPackets());
IEventInfo[] orignalEvents = fChannelInfo1.getEvents();
IEventInfo[] resultEvents = channelInfo.getEvents();
fixture.setMaxNumberTraceFiles(20);
fixture.setBufferType(BufferType.BUFFER_PER_UID);
fixture.addEvent(new EventInfo("event"));
+ fixture.setNumberOfDiscardedEvents(42L);
+ fixture.setNumberOfLostPackets(84L);
long switchTimer = fixture.getSwitchTimer();
assertEquals(2L, switchTimer);
BufferType bufferType = fixture.getBufferType();
assertTrue(bufferType == BufferType.BUFFER_PER_UID);
+ long numberOfDiscardedEvents = fixture.getNumberOfDiscardedEvents();
+ assertEquals(42L, numberOfDiscardedEvents);
+
+ long numberOfLostPackets = fixture.getNumberOfLostPackets();
+ assertEquals(84L, numberOfLostPackets);
+
fixture.setSwitchTimer(5L);
fixture.setOverwriteMode(false);
fixture.setReadTimer(6L);
fixture.setMaxSizeTraceFiles(4096);
fixture.setMaxNumberTraceFiles(10);
fixture.setBufferType(BufferType.BUFFER_PER_PID);
+ fixture.setNumberOfDiscardedEvents(11L);
+ fixture.setNumberOfLostPackets(22L);
switchTimer = fixture.getSwitchTimer();
assertEquals(5L, switchTimer);
bufferType = fixture.getBufferType();
assertTrue(bufferType == BufferType.BUFFER_PER_PID);
+
+ numberOfDiscardedEvents = fixture.getNumberOfDiscardedEvents();
+ assertEquals(11L, numberOfDiscardedEvents);
+
+ numberOfLostPackets = fixture.getNumberOfLostPackets();
+ assertEquals(22L, numberOfLostPackets);
}
/**
fixture.setNumberOfSubBuffers(1);
fixture.setOutputType("splice()");
fixture.setSubBufferSize(1L);
+ fixture.setNumberOfDiscardedEvents(42L);
+ fixture.setNumberOfLostPackets(84L);
String result = fixture.toString();
// add additional test code here
- assertEquals("[ChannelInfo([TraceInfo(Name=channel)],State=DISABLED,OverwriteMode=true,SubBuffersSize=1,NumberOfSubBuffers=1,SwitchTimer=1,ReadTimer=1,output=splice(),Events=None)]", result);
+ assertEquals("[ChannelInfo([TraceInfo(Name=channel)],State=DISABLED,OverwriteMode=true,SubBuffersSize=1,NumberOfSubBuffers=1,SwitchTimer=1,ReadTimer=1,output=splice(),NumberOfDiscardedEvents=42,NumberOfLostPackets=84,Events=None)]", result);
}
/**
String result = fChannelInfo1.toString();
// add additional test code here
- assertEquals("[ChannelInfo([TraceInfo(Name=channel1)],State=DISABLED,OverwriteMode=true,SubBuffersSize=13,NumberOfSubBuffers=12,SwitchTimer=10,ReadTimer=11,output=splice(),Events=[EventInfo([BaseEventInfo([TraceInfo(Name=event1)],type=TRACEPOINT,level=TRACE_DEBUG)],State=ENABLED,levelType=LOGLEVEL_ONLY)])]", result);
+ assertEquals("[ChannelInfo([TraceInfo(Name=channel1)],State=DISABLED,OverwriteMode=true,SubBuffersSize=13,NumberOfSubBuffers=12,SwitchTimer=10,ReadTimer=11,output=splice(),NumberOfDiscardedEvents=14,NumberOfLostPackets=15,Events=[EventInfo([BaseEventInfo([TraceInfo(Name=event1)],type=TRACEPOINT,level=TRACE_DEBUG)],State=ENABLED,levelType=LOGLEVEL_ONLY)])]", result);
}
// ------------------------------------------------------------------------
public void testToString_2() {
String result = fDomainInfo1.toString();
- assertEquals("[DomainInfo([TraceInfo(Name=test1)],Channels=[ChannelInfo([TraceInfo(Name=channel1)],State=DISABLED,OverwriteMode=true,SubBuffersSize=13,NumberOfSubBuffers=12,SwitchTimer=10,ReadTimer=11,output=splice(),Events=[EventInfo([BaseEventInfo([TraceInfo(Name=event1)],type=TRACEPOINT,level=TRACE_DEBUG)],State=ENABLED,levelType=LOGLEVEL_ONLY)])],isKernel=false)]", result);
+ assertEquals("[DomainInfo([TraceInfo(Name=test1)],Channels=[ChannelInfo([TraceInfo(Name=channel1)],State=DISABLED,OverwriteMode=true,SubBuffersSize=13,NumberOfSubBuffers=12,SwitchTimer=10,ReadTimer=11,output=splice(),NumberOfDiscardedEvents=14,NumberOfLostPackets=15,Events=[EventInfo([BaseEventInfo([TraceInfo(Name=event1)],type=TRACEPOINT,level=TRACE_DEBUG)],State=ENABLED,levelType=LOGLEVEL_ONLY)])],isKernel=false)]", result);
}
// ------------------------------------------------------------------------
fChannelInfo1.setOutputType("splice()");
fChannelInfo1.setSubBufferSize(13L);
fChannelInfo1.addEvent(fEventInfo1);
+ fChannelInfo1.setNumberOfDiscardedEvents(14L);
+ fChannelInfo1.setNumberOfLostPackets(15L);
fChannelInfo2 = new ChannelInfo("channel2");
fChannelInfo2.setSwitchTimer(1L);
fChannelInfo2.setSubBufferSize(4L);
fChannelInfo2.addEvent(fEventInfo2);
fChannelInfo2.addEvent(fEventInfo3);
+ fChannelInfo2.setNumberOfDiscardedEvents(5L);
+ fChannelInfo2.setNumberOfLostPackets(6L);
fDomainInfo1 = new DomainInfo("test1");
fDomainInfo1.addChannel(fChannelInfo1);
SessionInfo session = null;
new SessionInfo(session);
fail("null copy");
- }
- catch (IllegalArgumentException e) {
+ } catch (IllegalArgumentException e) {
// Success
}
}
String result = fSessionInfo1.toString();
// add additional test code here
- assertEquals("[SessionInfo([TraceInfo(Name=session1)],Path=/home/user/lttng-trace/mysession/,State=ACTIVE,isStreamedTrace=false,isSnapshot=false,snapshotInfo="
- + "[SnapshotInfo([TraceInfo(Name=snapshot-1)],snapshotPath=/home/user/lttng-trace/mysession/,ID=1,isStreamedSnapshot=false)],"
- + "Domains=[DomainInfo([TraceInfo(Name=test1)],"
- + "Channels=[ChannelInfo([TraceInfo(Name=channel1)],State=DISABLED,OverwriteMode=true,SubBuffersSize=13,NumberOfSubBuffers=12,SwitchTimer=10,ReadTimer=11,output=splice(),"
- + "Events=[EventInfo([BaseEventInfo([TraceInfo(Name=event1)],type=TRACEPOINT,level=TRACE_DEBUG)],State=ENABLED,levelType=LOGLEVEL_ONLY)])],"
- + "isKernel=false)],NetworkUrl=null,ControlUrl=null,DataUrl=null)]", result);
+ assertEquals(
+ "[SessionInfo([TraceInfo(Name=session1)],Path=/home/user/lttng-trace/mysession/,State=ACTIVE,isStreamedTrace=false,"
+ + "isSnapshot=false,snapshotInfo=[SnapshotInfo([TraceInfo(Name=snapshot-1)],snapshotPath=/home/user/lttng-trace/mysession/,"
+ + "ID=1,isStreamedSnapshot=false)],Domains=[DomainInfo([TraceInfo(Name=test1)],Channels=[ChannelInfo([TraceInfo(Name=channel1)],"
+ + "State=DISABLED,OverwriteMode=true,SubBuffersSize=13,NumberOfSubBuffers=12,SwitchTimer=10,ReadTimer=11,output=splice(),"
+ + "NumberOfDiscardedEvents=14,NumberOfLostPackets=15,Events=[EventInfo([BaseEventInfo([TraceInfo(Name=event1)],type=TRACEPOINT,level=TRACE_DEBUG)],"
+ + "State=ENABLED,levelType=LOGLEVEL_ONLY)])],isKernel=false)],NetworkUrl=null,ControlUrl=null,DataUrl=null)]",
+ result);
}
/**
String result = info.toString();
// add additional test code here
- assertEquals("[SessionInfo([TraceInfo(Name=session1)],Path=/home/user/lttng-trace/mysession/,State=ACTIVE,isStreamedTrace=false,isSnapshot=false,"
- + "Domains=[DomainInfo([TraceInfo(Name=test1)],"
- + "Channels=[ChannelInfo([TraceInfo(Name=channel1)],State=DISABLED,OverwriteMode=true,SubBuffersSize=13,NumberOfSubBuffers=12,SwitchTimer=10,ReadTimer=11,output=splice(),"
- + "Events=[EventInfo([BaseEventInfo([TraceInfo(Name=event1)],type=TRACEPOINT,level=TRACE_DEBUG)],State=ENABLED,levelType=LOGLEVEL_ONLY)])],"
- + "isKernel=false)],NetworkUrl=null,ControlUrl=null,DataUrl=null)]", result);
+ assertEquals("[SessionInfo([TraceInfo(Name=session1)],Path=/home/user/lttng-trace/mysession/,State=ACTIVE,isStreamedTrace=false,"
+ + "isSnapshot=false,Domains=[DomainInfo([TraceInfo(Name=test1)],Channels=[ChannelInfo([TraceInfo(Name=channel1)],"
+ + "State=DISABLED,OverwriteMode=true,SubBuffersSize=13,NumberOfSubBuffers=12,SwitchTimer=10,ReadTimer=11,output=splice(),NumberOfDiscardedEvents=14,"
+ + "NumberOfLostPackets=15,Events=[EventInfo([BaseEventInfo([TraceInfo(Name=event1)],type=TRACEPOINT,level=TRACE_DEBUG)],State=ENABLED,"
+ + "levelType=LOGLEVEL_ONLY)])],isKernel=false)],NetworkUrl=null,ControlUrl=null,DataUrl=null)]", result);
}
// ------------------------------------------------------------------------
* @return the value of buffersUID (enable or not)
*/
BufferType getBufferType();
+ /**
+ * Sets number of discarded events
+ * @param numberOfDiscardedEvents - number of discarded events
+ */
+ void setNumberOfDiscardedEvents(long numberOfDiscardedEvents);
+ /**
+ * @return the number of discarded events
+ */
+ long getNumberOfDiscardedEvents();
+ /**
+ * Sets number of lost packets
+ * @param numberOfLostPackets - number of lost packets
+ */
+ void setNumberOfLostPackets(long numberOfLostPackets);
+ /**
+ * @return the number of lost packets
+ */
+ long getNumberOfLostPackets();
}
* The value of buffer type
*/
private BufferType fBufferType = BufferType.BUFFER_TYPE_UNKNOWN;
+ /**
+ * The number of discarded events
+ */
+ private long fNumberOfDiscardedEvents;
+ /**
+ * The number of lost packets
+ */
+ private long fNumberOfLostPackets;
// ------------------------------------------------------------------------
// Constructors
fBufferType = other.fBufferType;
fOutputType = (other.fOutputType == null ? null : other.fOutputType);
fState = other.fState;
+ fNumberOfDiscardedEvents = other.fNumberOfDiscardedEvents;
+ fNumberOfLostPackets = other.fNumberOfLostPackets;
for (Iterator<IEventInfo> iterator = other.fEvents.iterator(); iterator.hasNext();) {
IEventInfo event = iterator.next();
if (event instanceof EventInfo) {
result = prime * result + (int) (fSubBufferSize ^ (fSubBufferSize >>> 32));
result = prime * result + (int) (fSwitchTimer ^ (fSwitchTimer >>> 32));
result = prime * result + ((fBufferType == null) ? 0 : (fBufferType.ordinal() + 1));
+ result = prime * result + (int) (fNumberOfDiscardedEvents ^ (fNumberOfDiscardedEvents >>> 32));
+ result = prime * result + (int) (fNumberOfLostPackets ^ (fNumberOfLostPackets >>> 32));
return result;
}
if (fBufferType != other.fBufferType) {
return false;
}
+ if (fNumberOfDiscardedEvents != other.fNumberOfDiscardedEvents) {
+ return false;
+ }
+ if (fNumberOfLostPackets != other.fNumberOfLostPackets) {
+ return false;
+ }
return true;
}
output.append(fReadTimer);
output.append(",output=");
output.append(fOutputType.getInName());
+ output.append(",NumberOfDiscardedEvents=");
+ output.append(fNumberOfDiscardedEvents);
+ output.append(",NumberOfLostPackets=");
+ output.append(fNumberOfLostPackets);
if ((fBufferType != null) && !fBufferType.equals(BufferType.BUFFER_TYPE_UNKNOWN) && !fBufferType.equals(BufferType.BUFFER_SHARED)) {
output.append(",BufferType=");
output.append(fBufferType);
public BufferType getBufferType() {
return fBufferType;
}
+
+ @Override
+ public void setNumberOfDiscardedEvents(long numberOfDiscardedEvents) {
+ fNumberOfDiscardedEvents = numberOfDiscardedEvents;
+ }
+
+ @Override
+ public long getNumberOfDiscardedEvents() {
+ return fNumberOfDiscardedEvents;
+ }
+
+ @Override
+ public void setNumberOfLostPackets(long numberOflostPackets) {
+ fNumberOfLostPackets = numberOflostPackets;
+ }
+
+ @Override
+ public long getNumberOfLostPackets() {
+ return fNumberOfLostPackets;
+ }
}
public static String TraceControl_SubBufferSizePropertyName;
public static String TraceControl_NbSubBuffersPropertyName;
public static String TraceControl_SwitchTimerPropertyName;
+ public static String TraceControl_NumberOfDiscardedEventsPropertyName;
+ public static String TraceControl_NumberOfLostPacketsPropertyName;
public static String TraceControl_ReadTimerPropertyName;
public static String TraceControl_OutputTypePropertyName;
TraceControl_SubBufferSizePropertyName=Sub Buffer Size
TraceControl_NbSubBuffersPropertyName=Number of Sub Buffers
TraceControl_SwitchTimerPropertyName=Switch Timer Interval
+TraceControl_NumberOfDiscardedEventsPropertyName=Number of Discarded Events
+TraceControl_NumberOfLostPacketsPropertyName=Number of Lost Packets
TraceControl_ReadTimerPropertyName=Read Timer Interval
TraceControl_OutputTypePropertyName=Output Type
TraceControl_TraceFileCountPropertyName=Trace File Count
fChannelInfo.setState(stateName);
}
+ /**
+ * @return number of discarded events
+ */
+ public long getNumberOfDiscardedEvents() {
+ return fChannelInfo.getNumberOfDiscardedEvents();
+ }
+ /**
+ * @return number of lost packets
+ */
+ public long getNumberOfLostPackets() {
+ return fChannelInfo.getNumberOfLostPackets();
+ }
+
/**
* @return maximum size of trace files
*/
* The trace channel 'trace file size' property ID.
*/
public static final String TRACE_CHANNEL_TRACE_FILE_SIZE_PROPERTY_ID = "trace.channel.trace.file.size"; //$NON-NLS-1$
+ /**
+ * The trace channel 'discarded events' property ID.
+ */
+ public static final String TRACE_CHANNEL_DISCARDED_EVENTS_PROPERTY_ID = "trace.channel.discarded.events"; //$NON-NLS-1$
+ /**
+ * The trace channel 'lost packets' property ID.
+ */
+ public static final String TRACE_CHANNEL_LOST_PACKETS_PROPERTY_ID = "trace.channel.lost.packets"; //$NON-NLS-1$
/**
* The trace channel 'name' property name.
*/
* The trace channel 'trace file size' property name.
*/
public static final String TRACE_CHANNEL_TRACE_FILE_SIZE_PROPERTY_NAME = Messages.TraceControl_TraceFileSizePropertyName;
+ /**
+ * The trace channel 'discarded events' property name.
+ */
+ public static final String TRACE_CHANNEL_DISCARDED_EVENTS_PROPERTY_NAME = Messages.TraceControl_NumberOfDiscardedEventsPropertyName;
+ /**
+ * The trace channel 'lost packets' property name.
+ */
+ public static final String TRACE_CHANNEL_LOST_PACKETS_PROPERTY_NAME = Messages.TraceControl_NumberOfLostPacketsPropertyName;
// Attributes
// ------------------------------------------------------------------------
properties.add(new ReadOnlyTextPropertyDescriptor(TRACE_CHANNEL_TRACE_FILE_COUNT_PROPERTY_ID, TRACE_CHANNEL_TRACE_FILE_COUNT_PROPERTY_NAME));
properties.add(new ReadOnlyTextPropertyDescriptor(TRACE_CHANNEL_TRACE_FILE_SIZE_PROPERTY_ID, TRACE_CHANNEL_TRACE_FILE_SIZE_PROPERTY_NAME));
}
+ if (fChannel.getTargetNode().isVersionSupported("2.8.0")) { //$NON-NLS-1$
+ properties.add(new ReadOnlyTextPropertyDescriptor(TRACE_CHANNEL_DISCARDED_EVENTS_PROPERTY_ID, TRACE_CHANNEL_DISCARDED_EVENTS_PROPERTY_NAME));
+ properties.add(new ReadOnlyTextPropertyDescriptor(TRACE_CHANNEL_LOST_PACKETS_PROPERTY_ID, TRACE_CHANNEL_LOST_PACKETS_PROPERTY_NAME));
+ }
return properties.toArray(new IPropertyDescriptor[0]);
}
if (TRACE_CHANNEL_TRACE_FILE_SIZE_PROPERTY_ID.equals(id)) {
return fChannel.getMaxSizeTraceFiles();
}
+ if (TRACE_CHANNEL_DISCARDED_EVENTS_PROPERTY_ID.equals(id)) {
+ return fChannel.getNumberOfDiscardedEvents();
+ }
+ if (TRACE_CHANNEL_LOST_PACKETS_PROPERTY_ID.equals(id)) {
+ return fChannel.getNumberOfLostPackets();
+ }
+
return null;
}
case MIStrings.LIVE_TIMER_INTERVAL:
// TODO: currently not supported by tmf
break;
+ case MIStrings.DISCARDED_EVENTS:
+ channel.setNumberOfDiscardedEvents(Long.parseLong(attribute.getTextContent()));
+ break;
+ case MIStrings.LOST_PACKETS:
+ channel.setNumberOfLostPackets(Long.parseLong(attribute.getTextContent()));
+ break;
default:
break;
}
*/
String LIVE_TIMER_INTERVAL = "live_timer_interval";
+ /**
+ * Represent the number of discarded events
+ */
+ String DISCARDED_EVENTS = "discarded_events";
+
+ /**
+ * Represent the number of lost packets
+ */
+ String LOST_PACKETS = "lost_packets";
+
/**
* Represent the type xml element
*/