Skip to content

Commit

Permalink
fix(analyzeme): drop the support of v7 profdata format
Browse files Browse the repository at this point in the history
Based on the discussion in #229[^1]
the next release (v12) will stop supporting the v7 profdata format.

[^1]: #229 (comment)
  • Loading branch information
weihanglo authored and michaelwoerister committed May 31, 2024
1 parent bb7214a commit ff28827
Show file tree
Hide file tree
Showing 6 changed files with 0 additions and 139 deletions.
1 change: 0 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ 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" }
Expand Down
3 changes: 0 additions & 3 deletions analyzeme/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,6 @@ 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.workspace = true

# File format: v8
decodeme_10_1_2.workspace = true
measureme_10_1_2.workspace = true
Expand Down
1 change: 0 additions & 1 deletion analyzeme/src/file_formats/mod.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
use decodeme::{event::Event, lightweight_event::LightweightEvent, Metadata};
use std::fmt::Debug;

pub mod v7;
pub mod v8;
pub mod v9;

Expand Down
78 changes: 0 additions & 78 deletions analyzeme/src/file_formats/v7.rs

This file was deleted.

56 changes: 0 additions & 56 deletions analyzeme/src/profiling_data.rs
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@ impl ProfilingData {
)?;

let event_decoder: Box<dyn file_formats::EventDecoder> = match file_format_version {
file_formats::v7::FILE_FORMAT => Box::new(file_formats::v7::EventDecoder::new(data)?),
file_formats::v8::FILE_FORMAT => Box::new(file_formats::v8::EventDecoder::new(
data,
diagnostic_file_path,
Expand Down Expand Up @@ -539,61 +538,6 @@ mod tests {
use std::collections::{HashMap, HashSet};
use std::io::Read;

#[test]
fn can_read_v7_profdata_files() {
let (data, file_format_version) =
read_data_and_version("tests/profdata/v7.mm_profdata.gz");
assert_eq!(file_format_version, file_formats::v7::FILE_FORMAT);
let profiling_data = ProfilingData::from_paged_buffer(data, None)
.expect("Creating the profiling data failed");
let grouped_events = group_events(&profiling_data);
let event_kinds = grouped_events
.keys()
.map(|k| k.as_str())
.collect::<HashSet<_>>();
let expect_event_kinds = vec!["GenericActivity", "IncrementalResultHashing", "Query"]
.into_iter()
.collect::<HashSet<_>>();
assert_eq!(event_kinds, expect_event_kinds);

let generic_activity_len = 6425;
let incremental_hashing_len = 2237;
let query_len = 2260;
assert_eq!(
grouped_events["GenericActivity"].len(),
generic_activity_len
);
assert_eq!(
grouped_events["IncrementalResultHashing"].len(),
incremental_hashing_len
);
assert_eq!(grouped_events["Query"].len(), query_len);

assert_eq!(
&*grouped_events["GenericActivity"][generic_activity_len / 2].label,
"incr_comp_encode_dep_graph"
);
assert_eq!(
grouped_events["GenericActivity"][generic_activity_len / 2].duration(),
Some(Duration::from_nanos(200))
);

assert_eq!(
&*grouped_events["IncrementalResultHashing"][incremental_hashing_len - 1].label,
"item_children"
);
assert_eq!(
grouped_events["IncrementalResultHashing"][incremental_hashing_len - 1].duration(),
Some(Duration::from_nanos(300))
);

assert_eq!(&*grouped_events["Query"][0].label, "hir_crate");
assert_eq!(
grouped_events["Query"][0].duration(),
Some(Duration::from_nanos(16800))
);
}

#[test]
fn can_read_v8_profdata_files() {
let (data, file_format_version) =
Expand Down
Binary file removed analyzeme/tests/profdata/v7.mm_profdata.gz
Binary file not shown.

0 comments on commit ff28827

Please sign in to comment.