control: Bug 492041: Add new channel properties from LTTng 2.8
authorBruno Roy <bruno.roy@ericsson.com>
Mon, 4 Jul 2016 18:55:36 +0000 (14:55 -0400)
committerMarc-Andre Laperle <marc-andre.laperle@ericsson.com>
Thu, 14 Jul 2016 18:08:40 +0000 (14:08 -0400)
LTTng 2.8 adds new attributes regarding the channels information. There
are now two new fields: "discarded_events" and "lost_packets". They are
now visible in the Property view when using LTTng 2.8 or greater.

Change-Id: Ifceb78916fac501802e98c34faab88ba69540ca0
Signed-off-by: Bruno Roy <bruno.roy@ericsson.com>
Reviewed-on: https://git.eclipse.org/r/76539
Reviewed-by: Hudson CI
Reviewed-by: Marc-Andre Laperle <marc-andre.laperle@ericsson.com>
Tested-by: Marc-Andre Laperle <marc-andre.laperle@ericsson.com>
Reviewed-by: Matthew Khouzam <matthew.khouzam@ericsson.com>
13 files changed:
doc/org.eclipse.tracecompass.doc.user/doc/User-Guide.mediawiki
lttng/org.eclipse.tracecompass.lttng2.control.core.tests/src/org/eclipse/tracecompass/lttng2/control/core/tests/model/impl/ChannelInfoTest.java
lttng/org.eclipse.tracecompass.lttng2.control.core.tests/src/org/eclipse/tracecompass/lttng2/control/core/tests/model/impl/DomainInfoTest.java
lttng/org.eclipse.tracecompass.lttng2.control.core.tests/src/org/eclipse/tracecompass/lttng2/control/core/tests/model/impl/ModelImplFactory.java
lttng/org.eclipse.tracecompass.lttng2.control.core.tests/src/org/eclipse/tracecompass/lttng2/control/core/tests/model/impl/SessionInfoTest.java
lttng/org.eclipse.tracecompass.lttng2.control.core/src/org/eclipse/tracecompass/internal/lttng2/control/core/model/IChannelInfo.java
lttng/org.eclipse.tracecompass.lttng2.control.core/src/org/eclipse/tracecompass/internal/lttng2/control/core/model/impl/ChannelInfo.java
lttng/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/tracecompass/internal/lttng2/control/ui/views/messages/Messages.java
lttng/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/tracecompass/internal/lttng2/control/ui/views/messages/messages.properties
lttng/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/tracecompass/internal/lttng2/control/ui/views/model/impl/TraceChannelComponent.java
lttng/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/tracecompass/internal/lttng2/control/ui/views/property/TraceChannelPropertySource.java
lttng/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/tracecompass/internal/lttng2/control/ui/views/service/LTTngControlServiceMI.java
lttng/org.eclipse.tracecompass.lttng2.control.ui/src/org/eclipse/tracecompass/internal/lttng2/control/ui/views/service/MIStrings.java

index ad89ac5f3ea24586562867bb45f74fc030aa77cc..952ad0853c3e806a134c2cc53ed4d4d2b354d687 100644 (file)
@@ -1667,6 +1667,8 @@ The Control View provides property information of selected tree component. Depen
 ** '''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''').
index 64eb6fd72f9544359558dc7973caed712c7a9042..dc9cb96e40b093006bb6102a1265c0a22d3533a6 100644 (file)
@@ -87,6 +87,8 @@ public class ChannelInfoTest {
         assertEquals(0, result.getMaxSizeTraceFiles());
         assertEquals(0, result.getMaxNumberTraceFiles());
         assertEquals(BufferType.BUFFER_TYPE_UNKNOWN, result.getBufferType());
+        assertEquals(0, result.getNumberOfDiscardedEvents());
+        assertEquals(0, result.getNumberOfLostPackets());
     }
 
     /**
@@ -107,6 +109,8 @@ public class ChannelInfoTest {
         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();
@@ -174,6 +178,8 @@ public class ChannelInfoTest {
         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);
@@ -205,6 +211,12 @@ public class ChannelInfoTest {
         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);
@@ -215,6 +227,8 @@ public class ChannelInfoTest {
         fixture.setMaxSizeTraceFiles(4096);
         fixture.setMaxNumberTraceFiles(10);
         fixture.setBufferType(BufferType.BUFFER_PER_PID);
+        fixture.setNumberOfDiscardedEvents(11L);
+        fixture.setNumberOfLostPackets(22L);
 
         switchTimer = fixture.getSwitchTimer();
         assertEquals(5L, switchTimer);
@@ -245,6 +259,12 @@ public class ChannelInfoTest {
 
         bufferType = fixture.getBufferType();
         assertTrue(bufferType == BufferType.BUFFER_PER_PID);
+
+        numberOfDiscardedEvents = fixture.getNumberOfDiscardedEvents();
+        assertEquals(11L, numberOfDiscardedEvents);
+
+        numberOfLostPackets = fixture.getNumberOfLostPackets();
+        assertEquals(22L, numberOfLostPackets);
     }
 
     /**
@@ -293,11 +313,13 @@ public class ChannelInfoTest {
         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);
     }
 
     /**
@@ -308,7 +330,7 @@ public class ChannelInfoTest {
         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);
     }
 
     // ------------------------------------------------------------------------
index 9d6366150bab53d018707b179f5ffd1c2313c1f6..c14662cefdd6ac75770cf33c3fe52df1d695ef2a 100644 (file)
@@ -150,7 +150,7 @@ public class DomainInfoTest {
     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);
     }
 
     // ------------------------------------------------------------------------
index 1177772b2c08bafe1c1d3c68618ddc53c63bb25a..41901cca8b6130eec91359fb78ae4f65ae4b2d10 100644 (file)
@@ -113,6 +113,8 @@ public class ModelImplFactory {
         fChannelInfo1.setOutputType("splice()");
         fChannelInfo1.setSubBufferSize(13L);
         fChannelInfo1.addEvent(fEventInfo1);
+        fChannelInfo1.setNumberOfDiscardedEvents(14L);
+        fChannelInfo1.setNumberOfLostPackets(15L);
 
         fChannelInfo2 = new ChannelInfo("channel2");
         fChannelInfo2.setSwitchTimer(1L);
@@ -124,6 +126,8 @@ public class ModelImplFactory {
         fChannelInfo2.setSubBufferSize(4L);
         fChannelInfo2.addEvent(fEventInfo2);
         fChannelInfo2.addEvent(fEventInfo3);
+        fChannelInfo2.setNumberOfDiscardedEvents(5L);
+        fChannelInfo2.setNumberOfLostPackets(6L);
 
         fDomainInfo1 = new DomainInfo("test1");
         fDomainInfo1.addChannel(fChannelInfo1);
index bb25c07f0fd5ad1e68a7169f620c71a56244094f..1dfe7a80f65ceafc5dc87cef8ad0ed97893ded3c 100644 (file)
@@ -123,8 +123,7 @@ public class SessionInfoTest {
             SessionInfo session = null;
             new SessionInfo(session);
             fail("null copy");
-        }
-        catch (IllegalArgumentException e) {
+        } catch (IllegalArgumentException e) {
             // Success
         }
     }
@@ -213,12 +212,14 @@ public class SessionInfoTest {
         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);
     }
 
     /**
@@ -234,11 +235,11 @@ public class SessionInfoTest {
         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);
     }
 
     // ------------------------------------------------------------------------
index 7a3270748fa9eb790aeeeb79b3d479c423414d3a..77efe6912439469f72fe7684081512c40aaf555a 100644 (file)
@@ -154,4 +154,22 @@ public interface IChannelInfo extends ITraceInfo {
      * @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();
 }
index e58810039462e5b197a6c60a9e8572d59b05274b..d9bfaea0fcd7f66ba743711f6bd380c216925f8c 100644 (file)
@@ -77,6 +77,14 @@ public class ChannelInfo extends TraceInfo implements IChannelInfo {
      * 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
@@ -109,6 +117,8 @@ public class ChannelInfo extends TraceInfo implements IChannelInfo {
         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) {
@@ -235,6 +245,8 @@ public class ChannelInfo extends TraceInfo implements IChannelInfo {
         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;
     }
 
@@ -281,6 +293,12 @@ public class ChannelInfo extends TraceInfo implements IChannelInfo {
         if (fBufferType != other.fBufferType) {
             return false;
         }
+        if (fNumberOfDiscardedEvents != other.fNumberOfDiscardedEvents) {
+            return false;
+        }
+        if (fNumberOfLostPackets != other.fNumberOfLostPackets) {
+            return false;
+        }
         return true;
     }
 
@@ -304,6 +322,10 @@ public class ChannelInfo extends TraceInfo implements IChannelInfo {
         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);
@@ -350,4 +372,24 @@ public class ChannelInfo extends TraceInfo implements IChannelInfo {
     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;
+    }
 }
index 204c6373709d08f1727d883d480b48e28207a3f0..14c2e7098b1fa49f3d8eb3f12768645d0761331c 100644 (file)
@@ -288,6 +288,8 @@ public final class Messages extends NLS {
     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;
index 37143e48c0a3708c08d111c26d33713e64dbff25..eefdcdb4cddff349002a3afabb8fcd9ef6407e63 100644 (file)
@@ -275,6 +275,8 @@ TraceControl_OverwriteModePropertyName=Overwrite Mode
 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
index 02e5f803d69db3cdee87579491d93d3d3c9d620a..06521a2a91f6c0e91791100a29b618fa509ac33b 100644 (file)
@@ -231,6 +231,19 @@ public class TraceChannelComponent extends TraceControlComponent {
         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
      */
index 786c1cea5678ca9889a5b951f77a54b888b024f2..dbe6b24f78b300eba7fbafba4b6cef0d8163521a 100644 (file)
@@ -71,6 +71,14 @@ public class TraceChannelPropertySource extends BasePropertySource {
      * 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.
      */
@@ -111,6 +119,14 @@ public class TraceChannelPropertySource extends BasePropertySource {
      * 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
     // ------------------------------------------------------------------------
@@ -150,6 +166,10 @@ public class TraceChannelPropertySource extends BasePropertySource {
             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]);
     }
 
@@ -185,6 +205,13 @@ public class TraceChannelPropertySource extends BasePropertySource {
         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;
     }
 
index 9dc50c220e7997e706fba6134c61cf0a4cc9e69a..dd96b2be520fb8ea0c79bf3c00564425a0508e3b 100644 (file)
@@ -488,6 +488,12 @@ public class LTTngControlServiceMI extends LTTngControlService {
                             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;
                             }
index d01cc7ed49c5d745625b82e85a258849e5149408..ff09a2d987afa5478462ec9f5ac452d3bd48d679 100644 (file)
@@ -481,6 +481,16 @@ public interface MIStrings {
      */
      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
      */
This page took 0.036974 seconds and 5 git commands to generate.