diff --git a/Cargo.toml b/Cargo.toml index 274679e..ccaf86b 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -10,8 +10,32 @@ members = [ "stack_collapse", "summarize", "mmedit", - "version_checker", ] [workspace.package] +version = "11.0.1" +authors = ["Wesley Wiser ", "Michael Woerister "] +edition = "2018" license = "MIT OR Apache-2.0" +repository = "https://github.com/rust-lang/measureme" + +[workspace.dependencies] +analyzeme = { path = "analyzeme" } +analyzeme_9_2_0 = { package = "analyzeme", git = "https://github.com/rust-lang/measureme", tag = "9.2.0" } +clap = { version = "4.5.0", features = ["derive"] } +decodeme = { path = "decodeme" } +decodeme_10_1_2 = { package = "decodeme", git = "https://github.com/rust-lang/measureme", tag = "10.1.2" } +flate2 = "1.0" +inferno = { version = "0.11", default-features = false } +log = "0.4" +measureme = { path = "measureme" } +measureme_10_1_2 = { package = "measureme", git = "https://github.com/rust-lang/measureme", tag = "10.1.2" } +memchr = "2" +memmap2 = "0.2.1" +parking_lot = "0.12.0" +perf-event-open-sys = "3.0.0" +prettytable-rs = "0.10" +rustc-hash = "1.0.1" +serde = { version = "1.0", features = ["derive"] } +serde_json = "1.0" +smallvec = "1.0" diff --git a/README.md b/README.md index 8595256..ee43427 100644 --- a/README.md +++ b/README.md @@ -42,3 +42,27 @@ It contains two main modes: [Learn more](./crox/README.md) [wg-self-profile]: https://rust-lang.github.io/compiler-team/working-groups/self-profile/ + +### mmedit + +`mmedit` is for editing `.mm_profdata` files generated by `measureme`. + +[Learn more](./mmedit/README.md) + +### mmview + +`mmview` is for printing the event data generated by `measureme`. + +[Learn more](./mmview/README.md) + +### analyzeme + +`analyzeme` is a library with common functionality for measureme tools. + +[Learn more](./analyzeme/README.md) + +### decodeme + +`decodeme` holds the decoding definitions of the profiling event data from `measureme`. + +[Learn more](./decodeme/README.md) diff --git a/analyzeme/Cargo.toml b/analyzeme/Cargo.toml index 84f548d..95b4b4a 100644 --- a/analyzeme/Cargo.toml +++ b/analyzeme/Cargo.toml @@ -1,26 +1,28 @@ [package] name = "analyzeme" -version = "11.0.1" -authors = ["Wesley Wiser ", "Michael Woerister "] -edition = "2018" +description = "Provides common functionality for measureme tools" +version.workspace = true +authors.workspace = true +edition.workspace = true license.workspace = true +repository.workspace = true [dependencies] -decodeme = { path = "../decodeme" } -memchr = "2" -measureme = { path = "../measureme" } -rustc-hash = "1.0.1" -serde = { version = "1.0", features = ["derive"] } +decodeme.workspace = true +measureme.workspace = true +memchr.workspace = true +rustc-hash.workspace = true +serde.workspace = true # Depending on older versions of this crate allows us to keep supporting older # file formats. # File format: v7 -analyzeme_9_2_0 = { package = "analyzeme", git = "https://github.com/rust-lang/measureme", tag = "9.2.0" } +analyzeme_9_2_0.workspace = true # File format: v8 -decodeme_10_1_2 = { package = "decodeme", git = "https://github.com/rust-lang/measureme", tag = "10.1.2" } -measureme_10_1_2 = { package = "measureme", git = "https://github.com/rust-lang/measureme", tag = "10.1.2" } +decodeme_10_1_2.workspace = true +measureme_10_1_2.workspace = true [dev-dependencies] -flate2 = "1.0" +flate2.workspace = true diff --git a/analyzeme/README.md b/analyzeme/README.md new file mode 100644 index 0000000..cf28564 --- /dev/null +++ b/analyzeme/README.md @@ -0,0 +1,3 @@ +# analyzeme + +This crate provides a library with common functionality for measureme tools diff --git a/crox/Cargo.toml b/crox/Cargo.toml index 256ac80..2172e93 100644 --- a/crox/Cargo.toml +++ b/crox/Cargo.toml @@ -1,14 +1,16 @@ [package] name = "crox" -version = "11.0.1" -authors = ["Wesley Wiser "] -edition = "2018" +description = "Turns `measureme` profiling data into files that can be visualized by the Chromium performance tools" +version.workspace = true +authors.workspace = true +edition.workspace = true license.workspace = true +repository.workspace = true [dependencies] -measureme = { path = "../measureme" } -analyzeme = { path = "../analyzeme" } -rustc-hash = "1.0.1" -serde = { version = "1.0", features = ["derive"] } -serde_json = "1.0" -clap = { version = "4.5.0", features = ["derive"] } +analyzeme.workspace = true +clap.workspace = true +measureme.workspace = true +rustc-hash.workspace = true +serde.workspace = true +serde_json.workspace = true diff --git a/decodeme/Cargo.toml b/decodeme/Cargo.toml index d5720f7..82d5f0e 100644 --- a/decodeme/Cargo.toml +++ b/decodeme/Cargo.toml @@ -1,14 +1,17 @@ [package] name = "decodeme" -version = "11.0.1" -edition = "2018" +description = "Decoding definitions of the profiling event data from `measureme`" +version.workspace = true +authors.workspace = true +edition.workspace = true license.workspace = true +repository.workspace = true # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -measureme = { path = "../measureme" } -memchr = "2" -rustc-hash = "1.0.1" -serde = { version = "1.0", features = ["derive"] } -serde_json = "1.0" +measureme.workspace = true +memchr.workspace = true +rustc-hash.workspace = true +serde.workspace = true +serde_json.workspace = true diff --git a/decodeme/README.md b/decodeme/README.md new file mode 100644 index 0000000..0413e75 --- /dev/null +++ b/decodeme/README.md @@ -0,0 +1,21 @@ +# decodeme + +`decodeme` holds the decoding definitions of the profiling event data from `measureme`. + +This makes it easy in the future to keep supporting old file formats by making +`analyzeme` depend on multiple versions of decodeme and always have it convert +data to the current format. + +As an example, this is what the crate graph would look like for `analyzeme@17.0.0` +if we want it to support a couple of older file formats. + +```text +measureme_15_0_0 <--- decodeme_15_0_0 <----+ + | +measureme_16_0_0 <--- decodeme_16_0_0 <----+ + | +measureme_17_0_0 <--- decodeme_17_0_0 <----+---- analyzeme_17_0_0 +``` + +See [analyzeme/src/file_formats/v7.rs](../analyzeme/src/file_formats/v7.rs) for +an example of what it looks like to implement support for an old file format. diff --git a/flamegraph/Cargo.toml b/flamegraph/Cargo.toml index febe82a..5db8997 100644 --- a/flamegraph/Cargo.toml +++ b/flamegraph/Cargo.toml @@ -1,15 +1,14 @@ [package] name = "flamegraph" -version = "11.0.1" -authors = [ - "Wesley Wiser ", - "Michael Woerister ", -] -edition = "2018" +description = "Reads `measureme` profiling data and outputs Flame Graph" +version.workspace = true +authors.workspace = true +edition.workspace = true license.workspace = true +repository.workspace = true [dependencies] -measureme = { path = "../measureme" } -analyzeme = { path = "../analyzeme" } -clap = { version = "4.5.0", features = ["derive"] } -inferno = { version = "0.11", default-features = false } +analyzeme.workspace = true +clap.workspace = true +inferno.workspace = true +measureme.workspace = true diff --git a/measureme/Cargo.toml b/measureme/Cargo.toml index 31699b0..9c9f879 100644 --- a/measureme/Cargo.toml +++ b/measureme/Cargo.toml @@ -1,26 +1,21 @@ [package] name = "measureme" -version = "11.0.1" -authors = ["Wesley Wiser ", "Michael Woerister "] -edition = "2018" description = "Support crate for rustc's self-profiling feature" +version.workspace = true +authors.workspace = true +edition.workspace = true license.workspace = true -documentation = "https://docs.rs/measureme" -homepage = "https://github.com/rust-lang/measureme" -repository = "https://github.com/rust-lang/measureme" - -[badges] -travis-ci = { repository = "rust-lang/measureme" } +repository.workspace = true [dependencies] -log = "0.4" -parking_lot = "0.12.0" -rustc-hash = "1.0.1" -smallvec = "1.0" +log.workspace = true +parking_lot.workspace = true +rustc-hash.workspace = true +smallvec.workspace = true [features] nightly = [] [target.'cfg(all(target_arch = "x86_64", target_os = "linux"))'.dependencies] -memmap2 = "0.2.1" -perf-event-open-sys = "3.0.0" +memmap2.workspace = true +perf-event-open-sys.workspace = true diff --git a/mmedit/Cargo.toml b/mmedit/Cargo.toml index 4712761..ea5511e 100644 --- a/mmedit/Cargo.toml +++ b/mmedit/Cargo.toml @@ -1,10 +1,13 @@ [package] name = "mmedit" -version = "11.0.1" -edition = "2018" +description = "A tool for editing .mm_profdata files generated by `measureme`" +version.workspace = true +authors.workspace = true +edition.workspace = true license.workspace = true +repository.workspace = true [dependencies] -measureme = { path = "../measureme" } -decodeme = { path = "../decodeme" } -clap = { version = "4.5.0", features = ["derive"] } +clap.workspace = true +decodeme.workspace = true +measureme.workspace = true diff --git a/mmview/Cargo.toml b/mmview/Cargo.toml index 46d9285..5a23314 100644 --- a/mmview/Cargo.toml +++ b/mmview/Cargo.toml @@ -1,11 +1,13 @@ [package] name = "mmview" -version = "11.0.1" -authors = ["Wesley Wiser ", "Michael Woerister "] -edition = "2018" +description = "A tool for printing the event data generated by `measureme`" +version.workspace = true +authors.workspace = true +edition.workspace = true license.workspace = true +repository.workspace = true [dependencies] -analyzeme = { path = "../analyzeme" } -measureme = { path = "../measureme" } -clap = { version = "4.5.0", features = ["derive"] } +analyzeme.workspace = true +clap.workspace = true +measureme.workspace = true diff --git a/mmview/README.md b/mmview/README.md new file mode 100644 index 0000000..4723ed8 --- /dev/null +++ b/mmview/README.md @@ -0,0 +1,16 @@ +# mmview + +A tool for printing the event data generated by `measureme`. + +## Usage + +``` +Usage: mmview [OPTIONS] + +Arguments: + + +Options: + -t, --thread-id Filter to events which occured on the specified thread id + -h, --help Print help +``` diff --git a/stack_collapse/Cargo.toml b/stack_collapse/Cargo.toml index 0642713..8d7a9d6 100644 --- a/stack_collapse/Cargo.toml +++ b/stack_collapse/Cargo.toml @@ -1,11 +1,13 @@ [package] name = "stack_collapse" -version = "11.0.1" -authors = ["Wesley Wiser ", "Michael Woerister "] -edition = "2018" +description = "Reads `measureme` profiling data and outputs folded stack traces compatible with the Flame Graph tools" +version.workspace = true +authors.workspace = true +edition.workspace = true license.workspace = true +repository.workspace = true [dependencies] -measureme = { path = "../measureme" } -analyzeme = { path = "../analyzeme" } -clap = { version = "4.5.0", features = ["derive"] } +analyzeme.workspace = true +clap.workspace = true +measureme.workspace = true diff --git a/summarize/Cargo.toml b/summarize/Cargo.toml index 701cf7a..3121e40 100644 --- a/summarize/Cargo.toml +++ b/summarize/Cargo.toml @@ -1,15 +1,17 @@ [package] name = "summarize" -version = "11.0.1" -authors = ["Wesley Wiser ", "Michael Woerister "] -edition = "2018" +description = "Produces a human readable summary of `measureme` profiling data" +version.workspace = true +authors.workspace = true +edition.workspace = true license.workspace = true +repository.workspace = true [dependencies] -measureme = { path = "../measureme" } -analyzeme = { path = "../analyzeme" } -prettytable-rs = "0.10" -rustc-hash = "1.0.1" -serde = { version = "1.0", features = [ "derive" ] } -serde_json = "1.0" -clap = { version = "4.5.0", features = ["derive"] } +analyzeme.workspace = true +clap.workspace = true +measureme.workspace = true +prettytable-rs.workspace = true +rustc-hash.workspace = true +serde.workspace = true +serde_json.workspace = true diff --git a/version_checker/Cargo.toml b/version_checker/Cargo.toml deleted file mode 100644 index 73a54ce..0000000 --- a/version_checker/Cargo.toml +++ /dev/null @@ -1,10 +0,0 @@ -[package] -name = "version_checker" -version = "11.0.1" -authors = ["Michael Woerister "] -edition = "2018" -license.workspace = true - -[dependencies] -regex = "1" -glob = "0.3.0" diff --git a/version_checker/LICENSE-APACHE b/version_checker/LICENSE-APACHE deleted file mode 120000 index 965b606..0000000 --- a/version_checker/LICENSE-APACHE +++ /dev/null @@ -1 +0,0 @@ -../LICENSE-APACHE \ No newline at end of file diff --git a/version_checker/LICENSE-MIT b/version_checker/LICENSE-MIT deleted file mode 120000 index 76219eb..0000000 --- a/version_checker/LICENSE-MIT +++ /dev/null @@ -1 +0,0 @@ -../LICENSE-MIT \ No newline at end of file diff --git a/version_checker/src/main.rs b/version_checker/src/main.rs deleted file mode 100644 index 9c4f794..0000000 --- a/version_checker/src/main.rs +++ /dev/null @@ -1,63 +0,0 @@ -// This is a small tool for making sure that we keep versions between all crates -// in the workspace consistent. It just panics if it finds an error and is -// supposed to be run as part of CI. - -use glob::glob; -use regex::Regex; -use std::collections::BTreeMap; -use std::path::{Path, PathBuf}; - -fn main() { - eprint!( - "Checking Cargo workspace \"{}\" for crate version consistency ... ", - Path::new(".").canonicalize().unwrap().display() - ); - - let workspace_cargo_toml_txt = std::fs::read_to_string("Cargo.toml").unwrap(); - - if !workspace_cargo_toml_txt.trim().starts_with("[workspace]") { - panic!( - "Could not find workspace Cargo.toml at {}.\n\ - This tool has to be executed in the top-level directory \ - of the Cargo workspace.", - Path::new("Cargo.toml").canonicalize().unwrap().display() - ); - } - - let mut versions: BTreeMap = BTreeMap::new(); - - let version_regex = Regex::new("version\\s*=\\s*\"(\\d+\\.\\d+\\.\\d+)\"").unwrap(); - - for entry in glob("./*/Cargo.toml").expect("Failed to read glob pattern") { - let cargo_toml_path = entry.unwrap(); - let cargo_toml_txt = std::fs::read_to_string(&cargo_toml_path).unwrap(); - - for line in cargo_toml_txt.lines() { - if let Some(caps) = version_regex.captures(line) { - let version = caps[1].to_string(); - versions.insert(cargo_toml_path.clone(), version); - break; - } - } - - if !versions.contains_key(&cargo_toml_path) { - panic!( - "Could not find `version` field in {}", - cargo_toml_path.display() - ); - } - } - - let reference_version = versions.values().next().unwrap(); - - if !versions.values().all(|v| v == reference_version) { - eprintln!("Crate versions found:"); - for (cargo_toml_path, version) in &versions { - eprintln!(" {} = {}", cargo_toml_path.display(), version); - } - - panic!("Not all crate versions are the same, please keep them in sync!"); - } - - eprintln!("check passed"); -}