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