Skip to content

Changes

Summary

  1. ctf: only flatten structures, not arrays (details)
Commit f76a9135e27abf42cfa9805235faae263512c2f8 by Matthew Khouzam
ctf: only flatten structures, not arrays

The goal of the patch is to handle fixed-length strings and
have them parse in a human and machine readable way.

Previous implementations would flatten arrays to something like:
element[0]='H', element[1]='e'... etc..

This was done to accelerate the parsing of a trace. However, it
leads to developers needing to reconstiture events. This patch
changes the way it is done to have an array as follows:

element = "Hello World!" for an array of characters
element = [1,2,3,4,5,6....] for an array for bytes
element = [0x00, 0x01, 0x02....] for an array of hex bytes

The changes were needed as the array formatting was never implemented
as it was blocked by flattening of arrays.

[Changed] Handle fixed length strings in CTF
[Changed] Make event arrays output more "JSON"-like
[Changed] Improve byte array.toString() (Hex and decimal)
[Changed] CTF String fields will be formated surrounded by  ""

Change-Id: I49c5e730cde6501732facd809d9282eec47a66f4
Signed-off-by: Matthew Khouzam <matthew.khouzam@ericsson.com>
Reviewed-on: https://git.eclipse.org/r/c/tracecompass/org.eclipse.tracecompass/+/202665
Tested-by: Trace Compass Bot <tracecompass-bot@eclipse.org>
Tested-by: Patrick Tasse <patrick.tasse@gmail.com>
Reviewed-by: Patrick Tasse <patrick.tasse@gmail.com>
The file was modified ctf/org.eclipse.tracecompass.ctf.core/src/org/eclipse/tracecompass/internal/ctf/core/event/types/ArrayDefinition.java
The file was modified ctf/org.eclipse.tracecompass.tmf.ctf.core/src/org/eclipse/tracecompass/tmf/ctf/core/event/CtfTmfEventField.java
The file was modified ctf/org.eclipse.tracecompass.ctf.core.tests/src/org/eclipse/tracecompass/ctf/core/tests/event/CTFEventFieldTest.java
The file was modified ctf/org.eclipse.tracecompass.ctf.core/src/org/eclipse/tracecompass/ctf/core/event/types/CompoundDeclaration.java
The file was modified ctf/org.eclipse.tracecompass.ctf.core/src/org/eclipse/tracecompass/internal/ctf/core/event/types/ByteArrayDefinition.java
The file was modified ctf/org.eclipse.tracecompass.ctf.core/src/org/eclipse/tracecompass/internal/ctf/core/event/types/ArrayDeclaration.java
The file was modified ctf/org.eclipse.tracecompass.tmf.ctf.core.tests/src/org/eclipse/tracecompass/tmf/ctf/core/tests/event/CtfTmfEventFieldTest.java
The file was modified ctf/org.eclipse.tracecompass.ctf.core/src/org/eclipse/tracecompass/internal/ctf/core/event/types/StructDeclarationFlattener.java