Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion analyzeme/src/testing_common.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ use crate::{Event, EventPayload, ProfilingData, Timestamp};
use measureme::{EventId, EventIdBuilder, Profiler, StringId};
use rustc_hash::FxHashMap;
use std::borrow::Cow;
use std::default::Default;
use std::path::{Path, PathBuf};
use std::sync::Arc;
use std::time::SystemTime;
Expand Down
2 changes: 1 addition & 1 deletion crox/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ analyzeme = { path = "../analyzeme" }
rustc-hash = "1.0.1"
serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"
clap = { version = "3.2", features = ["derive"] }
clap = { version = "4.5.0", features = ["derive"] }
10 changes: 5 additions & 5 deletions crox/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,16 +44,16 @@ struct Event {

#[derive(Parser, Debug)]
struct Opt {
#[clap(required_unless = "dir")]
#[arg(required_unless_present = "dir")]
file_prefix: Vec<PathBuf>,
/// all event trace files in dir will be merged to one chrome_profiler.json file
#[clap(long = "dir")]
#[arg(long = "dir")]
dir: Option<PathBuf>,
/// collapse threads without overlapping events
#[clap(long = "collapse-threads")]
#[arg(long = "collapse-threads")]
collapse_threads: bool,
/// filter out events with shorter duration (in microseconds)
#[clap(long = "minimum-duration")]
#[arg(long = "minimum-duration")]
minimum_duration: Option<u128>,
}

Expand Down Expand Up @@ -135,7 +135,7 @@ fn get_args(full_event: &analyzeme::Event<'_>) -> Option<FxHashMap<String, Strin
}

fn main() -> Result<(), Box<dyn std::error::Error + Send + Sync>> {
let opt = Opt::from_args();
let opt = Opt::parse();

let chrome_file = BufWriter::new(fs::File::create("chrome_profiler.json")?);
let mut serializer = serde_json::Serializer::new(chrome_file);
Expand Down
2 changes: 1 addition & 1 deletion flamegraph/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@ license = "MIT OR Apache-2.0"
[dependencies]
measureme = { path = "../measureme" }
analyzeme = { path = "../analyzeme" }
clap = { version = "3.2", features = ["derive"] }
clap = { version = "4.5.0", features = ["derive"] }
inferno = { version = "0.11", default-features = false }
2 changes: 1 addition & 1 deletion flamegraph/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ struct Opt {
}

fn main() -> Result<(), Box<dyn Error + Send + Sync>> {
let opt = Opt::from_args();
let opt = Opt::parse();

let profiling_data = ProfilingData::new(&opt.file_prefix)?;

Expand Down
2 changes: 1 addition & 1 deletion mmedit/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ edition = "2018"
[dependencies]
measureme = { path = "../measureme" }
decodeme = { path = "../decodeme" }
clap = { version = "3.2", features = ["derive"] }
clap = { version = "4.5.0", features = ["derive"] }
4 changes: 2 additions & 2 deletions mmedit/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ struct TruncateOpt {
#[derive(Parser, Debug)]
enum Opt {
/// Truncate to a single page per tag
#[clap(name = "truncate")]
#[command(name = "truncate")]
Truncate(TruncateOpt),
}

Expand Down Expand Up @@ -61,7 +61,7 @@ fn truncate(file_contents: &[u8]) -> Result<Vec<u8>, Box<dyn Error + Send + Sync
}

fn main() -> Result<(), Box<dyn Error + Send + Sync>> {
let opt = Opt::from_args();
let opt = Opt::parse();

match opt {
Opt::Truncate(opt) => {
Expand Down
2 changes: 1 addition & 1 deletion mmview/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ license = "MIT OR Apache-2.0"
[dependencies]
analyzeme = { path = "../analyzeme" }
measureme = { path = "../measureme" }
clap = { version = "3.2", features = ["derive"] }
clap = { version = "4.5.0", features = ["derive"] }
4 changes: 2 additions & 2 deletions mmview/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@ struct Opt {
file_prefix: PathBuf,

/// Filter to events which occured on the specified thread id
#[clap(short = 't', long = "thread-id")]
#[arg(short = 't', long = "thread-id")]
thread_id: Option<u32>,
}

fn main() -> Result<(), Box<dyn Error + Send + Sync>> {
let opt = Opt::from_args();
let opt = Opt::parse();

let data = ProfilingData::new(&opt.file_prefix)?;

Expand Down
2 changes: 1 addition & 1 deletion stack_collapse/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ license = "MIT OR Apache-2.0"
[dependencies]
measureme = { path = "../measureme" }
analyzeme = { path = "../analyzeme" }
clap = { version = "3.2", features = ["derive"] }
clap = { version = "4.5.0", features = ["derive"] }
2 changes: 1 addition & 1 deletion stack_collapse/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ struct Opt {
}

fn main() -> Result<(), Box<dyn Error + Send + Sync>> {
let opt = Opt::from_args();
let opt = Opt::parse();

let profiling_data = ProfilingData::new(&opt.file_prefix)?;

Expand Down
2 changes: 1 addition & 1 deletion summarize/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ prettytable-rs = "0.10"
rustc-hash = "1.0.1"
serde = { version = "1.0", features = [ "derive" ] }
serde_json = "1.0"
clap = { version = "3.2", features = ["derive"] }
clap = { version = "4.5.0", features = ["derive"] }
16 changes: 8 additions & 8 deletions summarize/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@ struct DiffOpt {
base: PathBuf,
change: PathBuf,

#[clap(short = 'e', long = "exclude")]
#[arg(short = 'e', long = "exclude")]
exclude: Vec<String>,

#[clap(long = "json")]
#[arg(long = "json")]
json: bool,
}

Expand All @@ -37,25 +37,25 @@ struct SummarizeOpt {
file_prefix: PathBuf,

/// Writes the analysis to a json file next to <file_prefix> instead of stdout
#[clap(long = "json")]
#[arg(long = "json")]
json: bool,

/// Filter the output to items whose self-time is greater than this value
#[clap(short = 'p', long = "percent-above", default_value = "0.0")]
#[arg(short = 'p', long = "percent-above", default_value = "0.0")]
percent_above: f64,
}

#[derive(Parser, Debug)]
enum Opt {
/// Processes a set of trace files with identical events and analyze variance
#[clap(name = "aggregate")]
#[command(name = "aggregate")]
Aggregate(AggregateOpt),

#[clap(name = "diff")]
#[command(name = "diff")]
Diff(DiffOpt),

/// Processes trace files and produces a summary
#[clap(name = "summarize")]
#[command(name = "summarize")]
Summarize(SummarizeOpt),
}

Expand Down Expand Up @@ -312,7 +312,7 @@ fn summarize(opt: SummarizeOpt) -> Result<(), Box<dyn Error + Send + Sync>> {
}

fn main() -> Result<(), Box<dyn Error + Send + Sync>> {
let opt = Opt::from_args();
let opt = Opt::parse();

match opt {
Opt::Summarize(opt) => summarize(opt),
Expand Down