threadEvent.put(1L, PAGE_SIZE); // kmem_mm_page_alloc at timestamp = 1
threadEvent.put(2L, -PAGE_SIZE); // kmem_mm_page_free at timestamp = 2
threadEvent.put(3L, -PAGE_SIZE); // kmem_mm_page_free at timestamp = 3
- threadEvent.put(17L, PAGE_SIZE); // kmem_mm_page_alloc at timestamp = 17
+ threadEvent.put(17L, PAGE_SIZE << 2); // kmem_mm_page_alloc at timestamp = 17
threadEvent.put(22L, -PAGE_SIZE); // kmem_mm_page_free at timestamp = 22
threadEvent.put(28L, -PAGE_SIZE); // kmem_mm_page_free at timestamp = 28
threadEvent.put(29L, PAGE_SIZE); // kmem_mm_page_alloc at timestamp = 29
<event timestamp="1" name="kmem_mm_page_alloc">
<field name="cpu" value="0" type="int" />
<field name="tid" value="proc1" type="string" />
+<field name="order" value="0" type="long" />
</event>
<event timestamp="2" name="kmem_mm_page_free">
<field name="cpu" value="1" type="int" />
<field name="tid" value="proc2" type="string" />
+<field name="order" value="0" type="long" />
</event>
<event timestamp="3" name="kmem_mm_page_free">
<field name="cpu" value="1" type="int" />
<field name="tid" value="proc1" type="string" />
+<field name="order" value="0" type="long" />
</event>
<event timestamp="17" name="kmem_mm_page_alloc">
<field name="cpu" value="0" type="int" />
<field name="tid" value="proc3" type="string" />
+<field name="order" value="2" type="long" />
</event>
<event timestamp="22" name="kmem_mm_page_free">
<field name="cpu" value="1" type="int" />
<field name="tid" value="proc4" type="string" />
+<field name="order" value="0" type="long" />
</event>
<event timestamp="28" name="kmem_mm_page_free">
<field name="cpu" value="1" type="int" />
<field name="tid" value="proc2" type="string" />
+<field name="order" value="0" type="long" />
</event>
<event timestamp="29" name="kmem_mm_page_alloc">
<field name="cpu" value="0" type="int" />
<field name="tid" value="proc4" type="string" />
+<field name="order" value="0" type="long" />
</event>
<event timestamp="30" name="kmem_mm_page_alloc">
<field name="cpu" value="0" type="int" />
<field name="tid" value="proc3" type="string" />
+<field name="order" value="0" type="long" />
</event>
</trace>
\ No newline at end of file
public static final String OTHER_TID = "other"; //$NON-NLS-1$
/* Version of this state provider */
- private static final int VERSION = 1;
+ private static final int VERSION = 2;
private static final int PAGE_SIZE = 4096;
+ private static final long MAX_ORDER = 62; // Larger than that would overflow
+
private IKernelAnalysisEventLayout fLayout;
/**
}
try {
+ String fieldOrder = fLayout.fieldOrder();
+ if (fieldOrder != null) {
+ Long value = event.getContent().getFieldValue(Long.class, fieldOrder);
+ if (value != null) {
+ if (value > MAX_ORDER || value < 0) {
+ Activator.getDefault().logWarning("Order of alloc is outside of acceptable range : " + value); //$NON-NLS-1$
+ return;
+ }
+ inc <<= value;
+ }
+ }
ITmfStateSystemBuilder ss = checkNotNull(getStateSystemBuilder());
- long ts = event.getTimestamp().getValue();
+ long ts = event.getTimestamp().toNanos();
Integer tidField = KernelTidAspect.INSTANCE.resolve(event);
String tid;
ss.modifyAttribute(ts, TmfStateValue.newValueLong(currentMemoryValue), lowestMemoryQuark);
}
} catch (AttributeNotFoundException e) {
- Activator.getDefault().logError(e.getMessage(), e);
+ Activator.getDefault().logError(String.valueOf(e.getMessage()), e);
}
}