Skip to content

Changes

Summary

  1. Improve file offset tracker for FTrace byte buffer (details)
Commit aec951d638bdae357f5319ffc70e5d46453a2d1b by Matthew Khouzam
Improve file offset tracker for FTrace byte buffer

This commit improves the offset tracker of the BinaryFTraceByteBuffer
class. Currently, the BinaryFTraceByteBuffer utilizes a ByteBuffer to
read data from the trace file. The ByteBuffer instance reads data in
chunks of a predefined amount of bytes. The existing implementation of
the offset tracker returns the offset of the ByteBuffer instance.
However, the expected returned value of the offset tracker is the offset
of the next byte in the ByteBuffer. This commit changes the behavior of
the offset tracker so that it behaves as expected.

In addition, it adds a unit test to make sure that the offset tracker
functions correctly.

Change-Id: Ic6b45fb293a7c077b0211632d4740a191630aad3
Signed-off-by: Hoang Thuan Pham <hoang.pham@calian.ca>
Reviewed-on: https://git.eclipse.org/r/c/tracecompass.incubator/org.eclipse.tracecompass.incubator/+/191195
Tested-by: Trace Compass Bot <tracecompass-bot@eclipse.org>
Tested-by: Marco Miller <marco.miller@ericsson.com>
Reviewed-by: Marco Miller <marco.miller@ericsson.com>
Reviewed-by: Matthew Khouzam <matthew.khouzam@ericsson.com>
The file was addedtracetypes/org.eclipse.tracecompass.incubator.ftrace.core/src/org/eclipse/tracecompass/incubator/internal/ftrace/core/binary/parser/BinaryFTraceHeaderElementSize.java
The file was modified tracetypes/org.eclipse.tracecompass.incubator.ftrace.core/META-INF/MANIFEST.MF (diff)
The file was modified tracetypes/org.eclipse.tracecompass.incubator.ftrace.core/src/org/eclipse/tracecompass/incubator/internal/ftrace/core/binary/parser/BinaryFTraceByteBuffer.java (diff)
The file was addedtracetypes/org.eclipse.tracecompass.incubator.ftrace.core.tests/src/org/eclipse/tracecompass/incubator/ftrace/core/tests/binary/buffer/BinaryFTraceByteBufferTest.java