-
Notifications
You must be signed in to change notification settings - Fork 2
feat!: crate split and rename #35
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…detrace_trace_types
…cer_trace_reader and codetracer_trace_writer. Empty for now.
…TOP_LEVEL_FUNCTION_ID constants to the codetracer_trace_types crate
…codetracer_trace_writer
… codetracer_trace_writer; supports writing JSON and capnp formats
…r_trace_writer - supports writing CBOR+ZSTD files
…to codetracer_trace_writer
…to codetracer_trace_reader
…RV1 to a separate crate, called codetracer_trace_format_cbor_zstd
…etracer_trace_reader
…to codetracer_trace_reader
…the new reader and writer crates
…e_tracing crate, except the tests
…ecords to codetracer_trace_types
…etracer_trace_writer
…0 and _v1 to the runtime_tracing_cli crate
…o the Cargo.toml files of the new crates
…ion for codetracer_trace_util
| mod cbor_zstd_reader; | ||
|
|
||
| #[derive(Debug, Clone, Copy)] | ||
| pub enum TraceEventsFileFormat { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is it a problem that we define this enum twice: if we import both libraries somewhere ( i assume there is not a good central place to put it into)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd like to have separate enums for the reader and the writer. The fact that the enum was shared before lead to hacks, such as specifying BinaryV0 and BinaryV1 separately, which makes sense for the writer (which can write both versions of the format), but not for the reader (which detects the binary format version from the file header, and handles BinaryV0 and BinaryV1 the same). The question is whether they should have the same name (in different modules), or different. Also, I still haven't unified BinaryV0 and BinaryV1 for the reader, but it can be done, as soon as this PR is merged. And it will not break the writer API, which is one of the goals of this PR - being able to update the reader API, without changing the writer API.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok, but if they are different at some points, then we would need to be able to easily reasonably map the one enum to the other one: I assume that would be easy for us as maintainers of the libraries, and for the users , probably the documentation would clarify any questions
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll think of some way to map them to each other, or at least, map them to some structure of strings like ID and description - for easy implementation of GUI/TUI, because that's what we actually need. But I'm planning to do this in a future PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good: still think we might find a prelude lib useful, but we can decide on that later, when trying to upgrade runtime_tracing libs in db-backend?
The crate runtime_tracing was split into several new crates:
codetracer_trace_types - contains the types, used in the trace file
codetracer_trace_reader - library for reading trace files
codetracer_trace_writer - library for writing trace files
codetracer_trace_capnp - helpers and common types for the Cap'n'proto binary format (version 0 binary format)
codetracer_trace_cbor_zstd - helpers and common types for the CBOR+ZSTD binary format (version 1 binary format)
Additionally, the runtime_tracing_cli utility has been renamed codetracer_trace_util. The original runtime_tracing crate has been deleted. Projects that use runtime_tracing should be updated to use either codetracer_trace_reader or codetracer_trace_writer (or both, if necessary) and codetracer_trace_types. Compilation errors are expected to be easy to fix, mostly by changing the
usestatements. All the names of the types, functions and traits are the same, they are just moved around into different crates and modules.Reasons for these changes: