File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -48,7 +48,7 @@ struct Opt {
48
48
collapse_threads : bool ,
49
49
/// filter out events with shorter duration (in microseconds)
50
50
#[ structopt( long = "minimum-duration" ) ]
51
- minimum_duration : u128 ,
51
+ minimum_duration : Option < u128 > ,
52
52
}
53
53
54
54
// generate mapping from thread_id to collapsed thread_id or an empty map
@@ -133,8 +133,10 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
133
133
// only handle startStop events for now
134
134
if let MatchingEvent :: StartStop ( start, stop) = event {
135
135
let duration = stop. timestamp . duration_since ( start. timestamp ) . unwrap ( ) ;
136
- if duration. as_micros ( ) < opt. minimum_duration {
137
- continue ;
136
+ if let Some ( minimum_duration) = opt. minimum_duration {
137
+ if duration. as_micros ( ) < minimum_duration {
138
+ continue ;
139
+ }
138
140
}
139
141
return Some ( Event {
140
142
name : start. label . clone ( ) . into_owned ( ) ,
You can’t perform that action at this time.
0 commit comments