-
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
Merged
Merged
Changes from all commits
Commits
Show all changes
23 commits
Select commit
Hold shift + click to select a range
67b3707
feat(separate_trace_types_crate): Types moved to a separate crate: co…
nickysn cba45cc
chore: formatting
nickysn 4c9bb54
feat(separate_trace_types_crate): Added creates to workspace: codetra…
nickysn 701ad0e
feat(separate_trace_types_crate): Added NONE_TYPE_ID, NONE_VALUE and …
nickysn 1d57cb9
feat(separate_trace_types_crate): Added trait AbstractTraceWriter to …
nickysn b855e96
feat(separate_trace_types_crate): Added trait TraceWriter to codetrac…
nickysn e1a73a2
feat(separate_trace_types_crate): Added crate codetracer_trace_format…
nickysn a5de208
feat(separate_trace_types_crate): Added non_streaming_trace_writer to…
nickysn d3c4523
feat(separate_trace_types_crate): Added cbor_zstd_writer to codetrace…
nickysn 4b6d831
feat(separate_trace_types_crate): Added create_trace_writer function …
nickysn ccf9c6a
feat(separate_trace_types_crate): Added trace reader implementations …
nickysn d2cf976
feat(separate_trace_types_crate): Move duplicated definition of HEADE…
nickysn bc1e0e5
feat(separate_trace_types_crate): Support wasm32-wasip1 target in cod…
nickysn 876087f
feat(separate_trace_types_crate): Added function create_trace_reader …
nickysn 1af6865
feat(separate_trace_types_crate): Updated runtime_tracing_cli to use …
nickysn 7285ba1
feat(separate_trace_types_crate): Remove all the code from the runtim…
nickysn 8af6f03
feat(separate_trace_types_crate): Moved test test_equality_of_value_r…
nickysn 05cdfac
feat(separate_trace_types_crate): Moved test test_simple_trace to cod…
nickysn 63bb021
feat(separate_trace_types_crate): Moved tests test_binary_roundtrip_v…
nickysn 6ba31be
feat(separate_trace_types_crate): runtime_tracing_cli renamed codetra…
nickysn 47924aa
feat(separate_trace_types_crate): Added description, copyright, etc t…
nickysn 2448c6b
feat(separate_trace_types_crate): Removed the runtime_tracing crate
nickysn 7f6f07d
feat(separate_trace_types_crate): Bump version and required Rust edit…
nickysn File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,7 +1,19 @@ | ||
| [workspace] | ||
| resolver = "2" | ||
| members = ["runtime_tracing", "runtime_tracing_cli", "trace_formatter"] | ||
| members = [ | ||
| "codetracer_trace_types", | ||
| "codetracer_trace_format_capnp", | ||
| "codetracer_trace_format_cbor_zstd", | ||
| "codetracer_trace_reader", | ||
| "codetracer_trace_writer", | ||
| "codetracer_trace_util", | ||
| "trace_formatter", | ||
| ] | ||
|
|
||
| [workspace.dependencies] | ||
| runtime_tracing = { path = "runtime_tracing/" } | ||
| trace_formatter = { path = "trace_formatter/"} | ||
| codetracer_trace_types = { path = "codetracer_trace_types" } | ||
| codetracer_trace_format_capnp = { path = "codetracer_trace_format_capnp" } | ||
| codetracer_trace_format_cbor_zstd = { path = "codetracer_trace_format_cbor_zstd" } | ||
| codetracer_trace_reader = { path = "codetracer_trace_reader" } | ||
| codetracer_trace_writer = { path = "codetracer_trace_writer" } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| [package] | ||
| name = "codetracer_trace_format_capnp" | ||
| version = "0.16.0" | ||
| edition = "2024" | ||
| authors = ["Metacraft Labs Ltd"] | ||
| description = "A library containing some helpers, used internally in the reading and writing of the CodeTracer db trace format" | ||
| repository = "https://github.com/metacraft-labs/runtime_tracing" | ||
| license = "MIT" | ||
| keywords = ["debugging", "development-tools"] | ||
|
|
||
| [dependencies] | ||
| codetracer_trace_types.workspace = true | ||
| capnp = "0.21.1" | ||
|
|
||
| [build-dependencies] | ||
| capnpc = "0.21.0" |
File renamed without changes.
426 changes: 213 additions & 213 deletions
426
runtime_tracing/src/capnptrace.rs → ...acer_trace_format_capnp/src/capnptrace.rs
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| pub mod capnptrace; | ||
|
|
||
| pub mod trace_capnp { | ||
| include!(concat!(env!("OUT_DIR"), "/src/trace_capnp.rs")); | ||
| } |
File renamed without changes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| [package] | ||
| name = "codetracer_trace_format_cbor_zstd" | ||
| version = "0.16.0" | ||
| edition = "2024" | ||
| authors = ["Metacraft Labs Ltd"] | ||
| description = "A library containing some helpers, used internally in the reading and writing of the CodeTracer db trace format" | ||
| repository = "https://github.com/metacraft-labs/runtime_tracing" | ||
| license = "MIT" | ||
| keywords = ["debugging", "development-tools"] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| /// The next 3 bytes are reserved/version info. | ||
| /// The header is 8 bytes in size, ensuring 64-bit alignment for the rest of the file. | ||
| pub const HEADERV1: &[u8] = &[ | ||
| 0xC0, 0xDE, 0x72, 0xAC, 0xE2, // The first 5 bytes identify the file as a CodeTracer file (hex l33tsp33k - C0DE72ACE2 for "CodeTracer"). | ||
| 0x01, // Indicates version 1 of the file format | ||
| 0x00, 0x00, | ||
| ]; // Reserved, must be zero in this version. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| [package] | ||
| name = "codetracer_trace_reader" | ||
| version = "0.16.0" | ||
| edition = "2024" | ||
| authors = ["Metacraft Labs Ltd"] | ||
| description = "A library for reading the CodeTracer db trace format" | ||
| repository = "https://github.com/metacraft-labs/runtime_tracing" | ||
| license = "MIT" | ||
| keywords = ["debugging", "development-tools"] | ||
|
|
||
| [dependencies] | ||
| codetracer_trace_types.workspace = true | ||
| codetracer_trace_format_capnp.workspace = true | ||
| codetracer_trace_format_cbor_zstd.workspace = true | ||
| fscommon = "0.1.1" | ||
| serde_json = "1.0" | ||
| cbor4ii = { version = "1.0.0", features = ["serde1", "use_std"] } | ||
|
|
||
| [target.'cfg(not(target_arch = "wasm32"))'.dependencies] | ||
| zeekstd = "0.6.0" | ||
|
|
||
| [target.'cfg(target_arch = "wasm32")'.dependencies] | ||
| ruzstd = "0.8.1" |
3 changes: 2 additions & 1 deletion
3
runtime_tracing/src/cbor_zstd_reader.rs → ...acer_trace_reader/src/cbor_zstd_reader.rs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| mod trace_readers; | ||
|
|
||
| #[cfg(target_arch = "wasm32")] | ||
| #[path = "./cbor_zstd_reader_wasm.rs"] | ||
| mod cbor_zstd_reader; | ||
|
|
||
| #[cfg(not(target_arch = "wasm32"))] | ||
| mod cbor_zstd_reader; | ||
|
|
||
| #[derive(Debug, Clone, Copy)] | ||
| pub enum TraceEventsFileFormat { | ||
| Json, | ||
| BinaryV0, | ||
| Binary, | ||
| } | ||
|
|
||
| pub fn create_trace_reader(format: TraceEventsFileFormat) -> Box<dyn trace_readers::TraceReader> { | ||
| match format { | ||
| TraceEventsFileFormat::Json => Box::new(trace_readers::JsonTraceReader {}), | ||
| TraceEventsFileFormat::BinaryV0 | TraceEventsFileFormat::Binary => Box::new(trace_readers::BinaryTraceReader {}), | ||
| } | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| [package] | ||
| name = "codetracer_trace_types" | ||
| version = "0.16.0" | ||
| edition = "2024" | ||
| authors = ["Metacraft Labs Ltd"] | ||
| description = "A library for the schema for the CodeTracer db trace format" | ||
| repository = "https://github.com/metacraft-labs/runtime_tracing" | ||
| license = "MIT" | ||
| keywords = ["debugging", "development-tools"] | ||
|
|
||
| [dependencies] | ||
| base64 = "0.22.1" | ||
| num-traits = "0.2" | ||
| num-derive = "0.4" | ||
| serde = { version = "1.0", features = ["derive"] } | ||
| serde_json = "1.0" | ||
| serde_repr = "0.1" | ||
| schemars = "0.8.2" |
File renamed without changes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| mod base64; | ||
| mod types; | ||
| pub use types::*; | ||
|
|
||
| #[test] | ||
| fn test_equality_of_value_records() { | ||
| let a = ValueRecord::Int { i: 0, type_id: TypeId(0) }; // just an example type_id | ||
| let b = ValueRecord::Int { i: 0, type_id: TypeId(0) }; | ||
| let different = ValueRecord::Int { i: 1, type_id: TypeId(0) }; | ||
|
|
||
| assert_eq!(a, b); | ||
| assert_ne!(a, different); | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9 changes: 5 additions & 4 deletions
9
runtime_tracing_cli/Cargo.toml → codetracer_trace_util/Cargo.toml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,13 +1,14 @@ | ||
| [package] | ||
| name = "runtime_tracing_cli" | ||
| version = "0.1.0" | ||
| edition = "2021" | ||
| name = "codetracer_trace_util" | ||
| version = "0.2.0" | ||
| edition = "2024" | ||
|
|
||
| # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html | ||
|
|
||
| [dependencies] | ||
| clap = { version = "4.5.40", features = ["derive"] } | ||
| runtime_tracing.workspace = true | ||
| codetracer_trace_reader.workspace = true | ||
| codetracer_trace_writer.workspace = true | ||
| trace_formatter.workspace = true | ||
| serde = { version = "1.0", features = ["derive"] } | ||
| serde_json = "1.0" |
File renamed without changes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| [package] | ||
| name = "codetracer_trace_writer" | ||
| version = "0.16.0" | ||
| edition = "2024" | ||
| authors = ["Metacraft Labs Ltd"] | ||
| description = "A library for writing the CodeTracer db trace format" | ||
| repository = "https://github.com/metacraft-labs/runtime_tracing" | ||
| license = "MIT" | ||
| keywords = ["debugging", "development-tools"] | ||
|
|
||
| [dependencies] | ||
| codetracer_trace_types.workspace = true | ||
| codetracer_trace_format_capnp.workspace = true | ||
| codetracer_trace_format_cbor_zstd.workspace = true | ||
| serde_json = "1.0" | ||
| cbor4ii = { version = "1.0.0", features = ["serde1", "use_std"] } | ||
|
|
||
| [target.'cfg(not(target_arch = "wasm32"))'.dependencies] | ||
| zeekstd = "0.6.0" | ||
|
|
||
| [target.'cfg(target_arch = "wasm32")'.dependencies] | ||
| ruzstd = "0.8.1" |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.