Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'lttng/org.eclipse.linuxtools.ctf.core/src/org')
-rw-r--r--lttng/org.eclipse.linuxtools.ctf.core/src/org/eclipse/linuxtools/internal/ctf/core/event/types/composite/EventHeaderCompactDeclaration.java14
-rw-r--r--lttng/org.eclipse.linuxtools.ctf.core/src/org/eclipse/linuxtools/internal/ctf/core/event/types/composite/EventHeaderLargeDeclaration.java13
2 files changed, 23 insertions, 4 deletions
diff --git a/lttng/org.eclipse.linuxtools.ctf.core/src/org/eclipse/linuxtools/internal/ctf/core/event/types/composite/EventHeaderCompactDeclaration.java b/lttng/org.eclipse.linuxtools.ctf.core/src/org/eclipse/linuxtools/internal/ctf/core/event/types/composite/EventHeaderCompactDeclaration.java
index 58cbc2dcbe..c81e0f5cf9 100644
--- a/lttng/org.eclipse.linuxtools.ctf.core/src/org/eclipse/linuxtools/internal/ctf/core/event/types/composite/EventHeaderCompactDeclaration.java
+++ b/lttng/org.eclipse.linuxtools.ctf.core/src/org/eclipse/linuxtools/internal/ctf/core/event/types/composite/EventHeaderCompactDeclaration.java
@@ -58,6 +58,7 @@ public class EventHeaderCompactDeclaration extends Declaration implements IEvent
* The id is 5 bits
*/
private static final int COMPACT_ID = 5;
+ private static final int COMPACT_ALIGN = 1;
private static final int EXTENDED_VALUE = 31;
/**
* Full sized id is 32 bits
@@ -71,6 +72,7 @@ public class EventHeaderCompactDeclaration extends Declaration implements IEvent
* Compact timestamp is 27 bits,
*/
private static final int COMPACT_TS = 27;
+ private static final int COMPACT_TS_ALIGN = 1;
/**
* Maximum size = largest this header can be
*/
@@ -143,9 +145,14 @@ public class EventHeaderCompactDeclaration extends Declaration implements IEvent
return false;
}
EnumDeclaration eId = (EnumDeclaration) iDeclaration;
- if (eId.getContainerType().getLength() != COMPACT_ID) {
+ final IntegerDeclaration containerType = eId.getContainerType();
+ if (containerType.getLength() != COMPACT_ID) {
return false;
}
+ if (containerType.getAlignment() != COMPACT_ALIGN) {
+ return false;
+ }
+
iDeclaration = declaration.getFields().get(V);
if (!(iDeclaration instanceof VariantDeclaration)) {
@@ -174,7 +181,7 @@ public class EventHeaderCompactDeclaration extends Declaration implements IEvent
return false;
}
IntegerDeclaration tsDec = (IntegerDeclaration) iDeclaration;
- if (tsDec.getLength() != COMPACT_TS || tsDec.isSigned()) {
+ if (tsDec.getLength() != COMPACT_TS || tsDec.isSigned() || tsDec.getAlignment() != COMPACT_TS_ALIGN) {
return false;
}
iDeclaration = vDec.getFields().get(EXTENDED);
@@ -182,6 +189,9 @@ public class EventHeaderCompactDeclaration extends Declaration implements IEvent
return false;
}
StructDeclaration extendedDec = (StructDeclaration) iDeclaration;
+ if (extendedDec.getAlignment() != ALIGN) {
+ return false;
+ }
if (!extendedDec.hasField(TIMESTAMP)) {
return false;
}
diff --git a/lttng/org.eclipse.linuxtools.ctf.core/src/org/eclipse/linuxtools/internal/ctf/core/event/types/composite/EventHeaderLargeDeclaration.java b/lttng/org.eclipse.linuxtools.ctf.core/src/org/eclipse/linuxtools/internal/ctf/core/event/types/composite/EventHeaderLargeDeclaration.java
index 7b0acf0ce7..3a6ebfe74d 100644
--- a/lttng/org.eclipse.linuxtools.ctf.core/src/org/eclipse/linuxtools/internal/ctf/core/event/types/composite/EventHeaderLargeDeclaration.java
+++ b/lttng/org.eclipse.linuxtools.ctf.core/src/org/eclipse/linuxtools/internal/ctf/core/event/types/composite/EventHeaderLargeDeclaration.java
@@ -83,6 +83,8 @@ public class EventHeaderLargeDeclaration extends Declaration implements IEventHe
private static final int VARIANT_SIZE = 2;
private static final int COMPACT_SIZE = 1;
private static final int EXTENDED_FIELD_SIZE = 2;
+ private static final long COMPACT_ALIGN = 1;
+ private static final long COMPACT_TS_ALIGN = 8;
private final ByteOrder fByteOrder;
@@ -139,7 +141,11 @@ public class EventHeaderLargeDeclaration extends Declaration implements IEventHe
return false;
}
EnumDeclaration eId = (EnumDeclaration) iDeclaration;
- if (eId.getContainerType().getLength() != COMPACT_ID) {
+ final IntegerDeclaration containerType = eId.getContainerType();
+ if (containerType.getLength() != COMPACT_ID) {
+ return false;
+ }
+ if (containerType.getAlignment() != COMPACT_ALIGN) {
return false;
}
iDeclaration = declaration.getFields().get(V);
@@ -170,7 +176,7 @@ public class EventHeaderLargeDeclaration extends Declaration implements IEventHe
return false;
}
IntegerDeclaration tsDec = (IntegerDeclaration) iDeclaration;
- if (tsDec.getLength() != COMPACT_TS || tsDec.isSigned()) {
+ if (tsDec.getLength() != COMPACT_TS || tsDec.isSigned() || tsDec.getAlignment() != COMPACT_TS_ALIGN) {
return false;
}
iDeclaration = vDec.getFields().get(EXTENDED);
@@ -178,6 +184,9 @@ public class EventHeaderLargeDeclaration extends Declaration implements IEventHe
return false;
}
StructDeclaration extendedDec = (StructDeclaration) iDeclaration;
+ if (extendedDec.getAlignment() != ALIGN) {
+ return false;
+ }
if (!extendedDec.hasField(TIMESTAMP)) {
return false;
}

Back to the top