Hi, while porting the bt2-ftrace-to-ctf [1] plugin to babeltrace 2.1, I noticed that the sink.ctf.fs creates invalid clock definitions if multiple stream-classes share the same clock-class. In this case, the clock definition is added multiple times to the CTF 2 metadata, resulting in the following assertion on read-back: ERROR: [Babeltrace CLI] (babeltrace2.c:2705) Command-line error: retcode=1 CAUSED BY [Source auto-discovery] (autodisc/autodisc.c:493) babeltrace.support-info query failed. CAUSED BY [libbabeltrace2] (lib/graph/query-executor.c:233) Component class's "query" method failed: query-exec- addr=0x55cba00c12e0, cc-addr=0x55cba00b4100, cc-type=SOURCE, cc- name="fs", cc-partial-descr="Read CTF traces from the file sy", cc-is-frozen=0, cc-so-handle-addr=0x55cba00b1930, cc- so-handle-path="<...>/build/babeltrace-plugin-ctf.so", object="babeltrace.support-info", params-addr=0x55cba00cd470, params- type=MAP, params-element-count=2, log-level=WARNING CAUSED BY ['source.ctf.fs'] (plugins/ctf/common/src/metadata/json/ctf- 2-metadata-stream-parser.cpp:130) [1:1 @ 8512 bytes] Invalid fragment #12. CAUSED BY ['source.ctf.fs'] (plugins/ctf/common/src/metadata/json/ctf- 2-metadata-stream-parser.cpp:367) [1:1 @ 17024 bytes] Duplicate clock class fragment with ID `local`. When running with MIP=0, the CTF 1.8 data does not have this issue (or the reader ignores the duplicated definitions). [1] https://github.com/siemens/bt2-ftrace-to-ctf Attached you will find an AI generated reproducer using just the babeltrace2 Python bindings. Best regards, Felix Moessbauer -- Siemens AG Linux Expert Center Friedrich-Ludwig-Bauer-Str. 3 85748 Garching, Germany