lib: remove CTF concepts of packet and event headers
authorPhilippe Proulx <eeppeliteloop@gmail.com>
Tue, 11 Dec 2018 22:43:05 +0000 (17:43 -0500)
committerPhilippe Proulx <eeppeliteloop@gmail.com>
Fri, 12 Apr 2019 21:26:17 +0000 (17:26 -0400)
commit7d9b7643f15e3845e8625754ba440a85508fc92a
tree9f226a8495691df69927f5c669c614cb29567b8a
parent53af57e70b2f60f5c80608e79806e8fb847a5d3d
lib: remove CTF concepts of packet and event headers

Packet and event headers are CTF concepts. In CTF 1.8, the fields in
those scopes are reserved for format encoding/decoding purposes, and
everything they mean has its equivalent property in trace IR objects.

I know no tracers producing CTF which put something else than the known
encoding fields in packet and event headers. Everything not related to
the trace format itself goes into context fields (except for a packet's
total and content sizes which are packet context fields), which are
still available as of this patch. This is so true that Mathieu Desnoyers
confirmed that CTF 2 should explicitly disallow anything else than
format-specific fields in header scopes. However, it might be ambiguous
in CTF v1.8.2, and someone somewhere could have put user fields in
there.

Therefore, for the moment, the `ctf` plugin does not copy the values of
packet and event header fields to trace IR fields. This could be done in
the future if we find that it's a limitation: for example, prefix header
fields with `ctf-header-` and put them into appropriate context fields
(packet context for packet header and event common context for event
header).

To make sure the user knows about non-CTF header fields being removed,
the `ctf` plugin prints a warning for each such field, for example:

    12-12 10:53:25.904 21954 21954 W
    PLUGIN-CTF-METADATA-META-WARN-MEANINGLESS-HEADER-FIELDS
    warn_meaningless_field@ctf-meta-warn-meaningless-header-fields.c:32
    User field found in packet header: ignoring: name="allo"

    12-12 10:53:25.904 21954 21954 W
    PLUGIN-CTF-METADATA-META-WARN-MEANINGLESS-HEADER-FIELDS
    warn_meaningless_field@ctf-meta-warn-meaningless-header-fields.c:32
    User field found in event header: ignoring: name="msg_id"

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
43 files changed:
include/Makefile.am
include/babeltrace/babeltrace.h
include/babeltrace/common-internal.h
include/babeltrace/trace-ir/event-const.h
include/babeltrace/trace-ir/event-header-field.h [deleted file]
include/babeltrace/trace-ir/event-internal.h
include/babeltrace/trace-ir/event.h
include/babeltrace/trace-ir/field-path-const.h
include/babeltrace/trace-ir/packet-const.h
include/babeltrace/trace-ir/packet-header-field.h [deleted file]
include/babeltrace/trace-ir/packet-internal.h
include/babeltrace/trace-ir/packet.h
include/babeltrace/trace-ir/resolve-field-path-internal.h
include/babeltrace/trace-ir/stream-class-const.h
include/babeltrace/trace-ir/stream-class-internal.h
include/babeltrace/trace-ir/stream-class.h
include/babeltrace/trace-ir/trace-class-const.h
include/babeltrace/trace-ir/trace-class-internal.h
include/babeltrace/trace-ir/trace-class.h
include/babeltrace/trace-ir/trace-internal.h
lib/lib-logging.c
lib/trace-ir/Makefile.am
lib/trace-ir/event-class.c
lib/trace-ir/event-header-field.c [deleted file]
lib/trace-ir/event.c
lib/trace-ir/packet-header-field.c [deleted file]
lib/trace-ir/packet.c
lib/trace-ir/resolve-field-path.c
lib/trace-ir/stream-class.c
lib/trace-ir/trace-class.c
lib/trace-ir/trace.c
plugins/ctf/common/metadata/Makefile.am
plugins/ctf/common/metadata/ctf-meta-resolve.c
plugins/ctf/common/metadata/ctf-meta-translate.c
plugins/ctf/common/metadata/ctf-meta-update-in-ir.c
plugins/ctf/common/metadata/ctf-meta-visitors.h
plugins/ctf/common/metadata/ctf-meta-warn-meaningless-header-fields.c [new file with mode: 0644]
plugins/ctf/common/metadata/ctf-meta.h
plugins/ctf/common/metadata/visitor-generate-ir.c
plugins/ctf/common/msg-iter/msg-iter.c
plugins/ctf/fs-src/data-stream-file.c
plugins/text/pretty/print.c
tests/lib/test_trace_ir_ref.c
This page took 0.032445 seconds and 5 git commands to generate.