#data-stream #trace #ctf #parse #file #barectf #barectf-generated

barectf-parser

A Rust library to parse barectf-generated CTF trace data

2 unstable releases

new 0.3.0 Feb 27, 2025
0.2.0 Feb 26, 2025
0.1.0 Feb 26, 2025

#356 in Data structures

Download history

99 downloads per month

Apache-2.0

95KB
2K SLoC

barectf-parser   crates.io docs.rs

A Rust library to parse barectf-generated CTF trace data.

Rather than attempt to parse the standard CTF metadata description file, this library takes advantage of the simplifying constraints imposed by barectf, using its configuration yaml to produce a CTF byte-stream parser.

See the examples for getting started.

This library supports barectf 3.1.

cargo run --example events_async -- test_resources/fixtures/full/effective_config.yaml test_resources/fixtures/full/trace/stream

Configuration

The library uses the effective configuration file generated from the show-effective-configuration command.

See the integration test source and fixtures for example invocations.

Limitations

Most of these will be resolved in future versions.

  • The special auto variant of the trace.type.uuid is not supported
    • You can omit uuid altogether or provide one in string form
  • The trace.type.$features.uuid-field-type field only supports true or false
    • Doesn't support explicit static array field type; assumes 16 byte static array
  • Enumeration field types are always treated as i64, regardless of the actual field type
  • minimum-alignment in structure field types are not supported
  • Clock offsets and timestamp rollover tracking is to be done by the caller
    • Types are provided to make it easier
  • Static and dynamic array field types don't support nested arrays
  • Bit-packed field types are not supported
  • trace.type.$features and trace.type.data-stream-types.*.$features need to be explicitly set (either false or some field type)

LICENSE

See LICENSE for more details.

Copyright 2025 Auxon Corporation

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Dependencies

~6–13MB
~150K SLoC