Fix: bt_stream_class_map_clock_class(): copy field type when mapping
authorPhilippe Proulx <eeppeliteloop@gmail.com>
Wed, 14 Feb 2018 19:54:39 +0000 (14:54 -0500)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Fri, 3 May 2019 22:19:33 +0000 (18:19 -0400)
commit6506cd617fb83f14ec9e398d9062bb76ce9ac49a
tree80fbb43ac4b0a1a00cd12fae962b1c377fb113cd
parenta57af3405068ee46f26c27b710f043906192fcf7
Fix: bt_stream_class_map_clock_class(): copy field type when mapping

Issue
=====
When a CTF writer stream class's packet context type contains the
special field types `timestamp_begin`, `timestamp_end`, and `timestamp`,
they are automatically mapped to the stream class's clock's class when
the stream class is about to be frozen in bt_trace_add_stream_class().
However, because the field type is mapped as is without a prior copy, it
is possible that this field type is shared with other locations in the
metadata tree which should not be mapped to a clock class.

Solution
========
Before automatically mapping any field type to a clock class, or more
generally, before modifying any field type, make a copy and replace the
original within its parent.

Known drawbacks
===============
None.

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
lib/ctf-ir/stream-class.c
lib/ctf-ir/trace.c
This page took 0.024755 seconds and 4 git commands to generate.