Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFrancois Chouinard2012-08-09 18:57:45 +0000
committerBernd Hufmann2012-08-14 15:32:00 +0000
commitdd3ffdc9d2ebe820a14d79a03244b5438a38f7c9 (patch)
treee1ea091729271854158affca3fe5f34582ee3daf
parent68ce0e2063e5e5a9a806b74083a6b7e6004edd54 (diff)
downloadorg.eclipse.linuxtools-dd3ffdc9d2ebe820a14d79a03244b5438a38f7c9.tar.gz
org.eclipse.linuxtools-dd3ffdc9d2ebe820a14d79a03244b5438a38f7c9.tar.xz
org.eclipse.linuxtools-dd3ffdc9d2ebe820a14d79a03244b5438a38f7c9.zip
Fix a sporadic distribution problem in the TMF coalesced requests
When a data/event provider receives a set of requests during the processing of a signal, it will do its best to coalesce these requests in order to minimize the number of physical accesses that need to be performed on the back-end traces. The coalesced request, itself being a request, also has a data type. By default, its data type is determined by the first sub-request coalesced by the data/event provider. Afterwards, when it receives data from the back-end, it dispatches the data/events to the appropriate sub-request. This works fine for homogeneous experiments (same trace/event types). However, when dealing with heterogeneous traces or even with different event types during a given session, the coalesced event type, being determined by the first sub-request, can in fact hide the data/events for sub-requests whose data type is not an extension of the base type. This fix forces the data type of the coalesced request to ITmfEvent therefore ensuring that the data meant for the sub-requests is not inadvertently filtered out. Change-Id: I2862f7ca30d38c968968dd6cd41f6cc04bbcd9a4 Signed-off-by: Francois Chouinard <fchouinard@gmail.com> Reviewed-on: https://git.eclipse.org/r/7171 Reviewed-by: Bernd Hufmann <bhufmann@gmail.com> IP-Clean: Bernd Hufmann <bhufmann@gmail.com> Tested-by: Bernd Hufmann <bhufmann@gmail.com>
-rw-r--r--lttng/org.eclipse.linuxtools.tmf.core.tests/src/org/eclipse/linuxtools/tmf/core/tests/request/TmfCoalescedDataRequestTest.java17
-rw-r--r--lttng/org.eclipse.linuxtools.tmf.core.tests/src/org/eclipse/linuxtools/tmf/core/tests/request/TmfCoalescedEventRequestTest.java17
-rw-r--r--lttng/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/internal/tmf/core/request/TmfCoalescedDataRequest.java6
-rw-r--r--lttng/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/internal/tmf/core/request/TmfCoalescedEventRequest.java3
4 files changed, 24 insertions, 19 deletions
diff --git a/lttng/org.eclipse.linuxtools.tmf.core.tests/src/org/eclipse/linuxtools/tmf/core/tests/request/TmfCoalescedDataRequestTest.java b/lttng/org.eclipse.linuxtools.tmf.core.tests/src/org/eclipse/linuxtools/tmf/core/tests/request/TmfCoalescedDataRequestTest.java
index 4d72b8eb5e..9d6fd55bcf 100644
--- a/lttng/org.eclipse.linuxtools.tmf.core.tests/src/org/eclipse/linuxtools/tmf/core/tests/request/TmfCoalescedDataRequestTest.java
+++ b/lttng/org.eclipse.linuxtools.tmf.core.tests/src/org/eclipse/linuxtools/tmf/core/tests/request/TmfCoalescedDataRequestTest.java
@@ -16,6 +16,7 @@ package org.eclipse.linuxtools.tmf.core.tests.request;
import junit.framework.TestCase;
import org.eclipse.linuxtools.internal.tmf.core.request.TmfCoalescedDataRequest;
+import org.eclipse.linuxtools.tmf.core.event.ITmfEvent;
import org.eclipse.linuxtools.tmf.core.event.TmfEvent;
import org.eclipse.linuxtools.tmf.core.request.TmfDataRequest;
import org.eclipse.linuxtools.tmf.tests.stubs.request.TmfDataRequestStub;
@@ -103,7 +104,7 @@ public class TmfCoalescedDataRequestTest extends TestCase {
TmfCoalescedDataRequest<TmfEvent> request = new TmfCoalescedDataRequest<TmfEvent>(TmfEvent.class);
assertEquals("getRequestId", fRequestCount++, request.getRequestId());
- assertEquals("getDataType", TmfEvent.class, request.getDataType());
+ assertEquals("getDataType", ITmfEvent.class, request.getDataType());
assertEquals("getIndex", 0, request.getIndex());
assertEquals("getNbRequestedEvents", TmfDataRequest.ALL_DATA, request.getNbRequested());
@@ -119,7 +120,7 @@ public class TmfCoalescedDataRequestTest extends TestCase {
TmfCoalescedDataRequest<TmfEvent> request = new TmfCoalescedDataRequest<TmfEvent>(TmfEvent.class, 10);
assertEquals("getRequestId", fRequestCount++, request.getRequestId());
- assertEquals("getDataType", TmfEvent.class, request.getDataType());
+ assertEquals("getDataType", ITmfEvent.class, request.getDataType());
assertEquals("getIndex", 10, request.getIndex());
assertEquals("getNbRequestedEvents", TmfDataRequest.ALL_DATA, request.getNbRequested());
@@ -135,7 +136,7 @@ public class TmfCoalescedDataRequestTest extends TestCase {
TmfCoalescedDataRequest<TmfEvent> request = new TmfCoalescedDataRequest<TmfEvent>(TmfEvent.class, 10, 100);
assertEquals("getRequestId", fRequestCount++, request.getRequestId());
- assertEquals("getDataType", TmfEvent.class, request.getDataType());
+ assertEquals("getDataType", ITmfEvent.class, request.getDataType());
assertEquals("getIndex", 10, request.getIndex());
assertEquals("getNbRequestedEvents", 100, request.getNbRequested());
@@ -151,7 +152,7 @@ public class TmfCoalescedDataRequestTest extends TestCase {
TmfCoalescedDataRequest<TmfEvent> request = new TmfCoalescedDataRequest<TmfEvent>(TmfEvent.class, 10, 100, 200);
assertEquals("getRequestId", fRequestCount++, request.getRequestId());
- assertEquals("getDataType", TmfEvent.class, request.getDataType());
+ assertEquals("getDataType", ITmfEvent.class, request.getDataType());
assertEquals("getIndex", 10, request.getIndex());
assertEquals("getNbRequestedEvents", 100, request.getNbRequested());
@@ -211,10 +212,10 @@ public class TmfCoalescedDataRequestTest extends TestCase {
// ------------------------------------------------------------------------
public void testToString() {
- String expected1 = "[TmfCoalescedDataRequest(0,TmfEvent,10,100,200)]";
- String expected2 = "[TmfCoalescedDataRequest(1,TmfEvent,20,100,200)]";
- String expected3 = "[TmfCoalescedDataRequest(2,TmfEvent,20,200,200)]";
- String expected4 = "[TmfCoalescedDataRequest(3,TmfEvent,20,200,300)]";
+ String expected1 = "[TmfCoalescedDataRequest(0,ITmfEvent,10,100,200)]";
+ String expected2 = "[TmfCoalescedDataRequest(1,ITmfEvent,20,100,200)]";
+ String expected3 = "[TmfCoalescedDataRequest(2,ITmfEvent,20,200,200)]";
+ String expected4 = "[TmfCoalescedDataRequest(3,ITmfEvent,20,200,300)]";
assertEquals("toString", expected1, fRequest1.toString());
assertEquals("toString", expected2, fRequest2.toString());
diff --git a/lttng/org.eclipse.linuxtools.tmf.core.tests/src/org/eclipse/linuxtools/tmf/core/tests/request/TmfCoalescedEventRequestTest.java b/lttng/org.eclipse.linuxtools.tmf.core.tests/src/org/eclipse/linuxtools/tmf/core/tests/request/TmfCoalescedEventRequestTest.java
index cc706fa265..ad8ccfd127 100644
--- a/lttng/org.eclipse.linuxtools.tmf.core.tests/src/org/eclipse/linuxtools/tmf/core/tests/request/TmfCoalescedEventRequestTest.java
+++ b/lttng/org.eclipse.linuxtools.tmf.core.tests/src/org/eclipse/linuxtools/tmf/core/tests/request/TmfCoalescedEventRequestTest.java
@@ -26,6 +26,7 @@ import org.eclipse.linuxtools.internal.tmf.core.component.TmfProviderManager;
import org.eclipse.linuxtools.internal.tmf.core.request.TmfCoalescedDataRequest;
import org.eclipse.linuxtools.internal.tmf.core.request.TmfCoalescedEventRequest;
import org.eclipse.linuxtools.tmf.core.component.ITmfDataProvider;
+import org.eclipse.linuxtools.tmf.core.event.ITmfEvent;
import org.eclipse.linuxtools.tmf.core.event.TmfEvent;
import org.eclipse.linuxtools.tmf.core.event.TmfTimeRange;
import org.eclipse.linuxtools.tmf.core.event.TmfTimestamp;
@@ -128,7 +129,7 @@ public class TmfCoalescedEventRequestTest extends TestCase {
TmfCoalescedEventRequest<TmfEvent> request = new TmfCoalescedEventRequest<TmfEvent>(TmfEvent.class);
assertEquals("getRequestId", fRequestCount++, request.getRequestId());
- assertEquals("getDataType", TmfEvent.class, request.getDataType());
+ assertEquals("getDataType", ITmfEvent.class, request.getDataType());
assertEquals("getRange", range1, request.getRange());
assertEquals("getNbRequestedEvents", TmfDataRequest.ALL_DATA, request.getNbRequested());
@@ -144,7 +145,7 @@ public class TmfCoalescedEventRequestTest extends TestCase {
TmfCoalescedEventRequest<TmfEvent> request = new TmfCoalescedEventRequest<TmfEvent>(TmfEvent.class, range1);
assertEquals("getRequestId", fRequestCount++, request.getRequestId());
- assertEquals("getDataType", TmfEvent.class, request.getDataType());
+ assertEquals("getDataType", ITmfEvent.class, request.getDataType());
assertEquals("getRange", range1, request.getRange());
assertEquals("getNbRequestedEvents", TmfDataRequest.ALL_DATA, request.getNbRequested());
@@ -160,7 +161,7 @@ public class TmfCoalescedEventRequestTest extends TestCase {
TmfCoalescedEventRequest<TmfEvent> request = new TmfCoalescedEventRequest<TmfEvent>(TmfEvent.class, range1, 100);
assertEquals("getRequestId", fRequestCount++, request.getRequestId());
- assertEquals("getDataType", TmfEvent.class, request.getDataType());
+ assertEquals("getDataType", ITmfEvent.class, request.getDataType());
assertEquals("getRange", range1, request.getRange());
assertEquals("getNbRequestedEvents", 100, request.getNbRequested());
@@ -176,7 +177,7 @@ public class TmfCoalescedEventRequestTest extends TestCase {
TmfCoalescedEventRequest<TmfEvent> request = new TmfCoalescedEventRequest<TmfEvent>(TmfEvent.class, range1, 100, 200);
assertEquals("getRequestId", fRequestCount++, request.getRequestId());
- assertEquals("getDataType", TmfEvent.class, request.getDataType());
+ assertEquals("getDataType", ITmfEvent.class, request.getDataType());
assertEquals("getRange", range1, request.getRange());
assertEquals("getNbRequestedEvents", 100, request.getNbRequested());
@@ -250,10 +251,10 @@ public class TmfCoalescedEventRequestTest extends TestCase {
// ------------------------------------------------------------------------
public void testToString() {
- String expected1 = "[TmfCoalescedEventRequest(0,TmfEvent," + range1 + ",0,100,200)]";
- String expected2 = "[TmfCoalescedEventRequest(1,TmfEvent," + range2 + ",0,100,200)]";
- String expected3 = "[TmfCoalescedEventRequest(2,TmfEvent," + range2 + ",0,200,200)]";
- String expected4 = "[TmfCoalescedEventRequest(3,TmfEvent," + range2 + ",0,200,300)]";
+ String expected1 = "[TmfCoalescedEventRequest(0,ITmfEvent," + range1 + ",0,100,200)]";
+ String expected2 = "[TmfCoalescedEventRequest(1,ITmfEvent," + range2 + ",0,100,200)]";
+ String expected3 = "[TmfCoalescedEventRequest(2,ITmfEvent," + range2 + ",0,200,200)]";
+ String expected4 = "[TmfCoalescedEventRequest(3,ITmfEvent," + range2 + ",0,200,300)]";
assertEquals("toString", expected1, fRequest1.toString());
assertEquals("toString", expected2, fRequest2.toString());
diff --git a/lttng/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/internal/tmf/core/request/TmfCoalescedDataRequest.java b/lttng/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/internal/tmf/core/request/TmfCoalescedDataRequest.java
index 364ab3b728..39e66ce828 100644
--- a/lttng/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/internal/tmf/core/request/TmfCoalescedDataRequest.java
+++ b/lttng/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/internal/tmf/core/request/TmfCoalescedDataRequest.java
@@ -117,8 +117,9 @@ public class TmfCoalescedDataRequest<T extends ITmfEvent> extends TmfDataRequest
* @param nbRequested the number of events requested
* @param blockSize the number of events per block
*/
+ @SuppressWarnings("unchecked")
public TmfCoalescedDataRequest(Class<T> dataType, long index, int nbRequested, int blockSize) {
- super(dataType, index, nbRequested, blockSize, ExecutionType.FOREGROUND);
+ super((Class<T>) ITmfEvent.class, index, nbRequested, blockSize, ExecutionType.FOREGROUND);
}
/**
@@ -131,8 +132,9 @@ public class TmfCoalescedDataRequest<T extends ITmfEvent> extends TmfDataRequest
* @param blockSize the number of events per block
* @param priority the requested execution priority
*/
+ @SuppressWarnings("unchecked")
public TmfCoalescedDataRequest(Class<T> dataType, long index, int nbRequested, int blockSize, ExecutionType priority) {
- super(dataType, index, nbRequested, blockSize, priority);
+ super((Class<T>) ITmfEvent.class, index, nbRequested, blockSize, priority);
}
// ------------------------------------------------------------------------
diff --git a/lttng/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/internal/tmf/core/request/TmfCoalescedEventRequest.java b/lttng/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/internal/tmf/core/request/TmfCoalescedEventRequest.java
index 9097649911..7c38d3c58a 100644
--- a/lttng/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/internal/tmf/core/request/TmfCoalescedEventRequest.java
+++ b/lttng/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/internal/tmf/core/request/TmfCoalescedEventRequest.java
@@ -146,8 +146,9 @@ public class TmfCoalescedEventRequest<T extends ITmfEvent> extends TmfCoalescedD
* @param blockSize the number of events per block
* @param priority the requested execution priority
*/
+ @SuppressWarnings("unchecked")
public TmfCoalescedEventRequest(Class<T> dataType, TmfTimeRange range, long index, int nbRequested, int blockSize, ExecutionType priority) {
- super(dataType, index, nbRequested, blockSize, priority);
+ super((Class<T>) ITmfEvent.class, index, nbRequested, blockSize, priority);
fRange = range;
if (Tracer.isRequestTraced()) {

Back to the top