Skip to content

Commit f63d98e

Browse files
committed
[mmview] Add a thread-id filter argument
This limits the output to jsut events which occurred on the specified thread.
1 parent a832a8a commit f63d98e

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
## Unreleased
44
### Added
55
- `measureme`: Added support for compiling the library under wasm/wasi ([GH-43])
6+
- `mmview`: Added the `-t` flag to limit output to results on the specified thread id ([GH-49])
67

78
## [0.3.0] - 2019-05-14
89
### Added
@@ -23,3 +24,4 @@
2324
[GH-35]: https://github.com/rust-lang/measureme/pull/35
2425
[GH-41]: https://github.com/rust-lang/measureme/pull/41
2526
[GH-43]: https://github.com/rust-lang/measureme/pull/43
27+
[GH-49]: https://github.com/rust-lang/measureme/pull/49

mmview/src/main.rs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ use structopt::StructOpt;
77
#[derive(StructOpt, Debug)]
88
struct Opt {
99
file_prefix: PathBuf,
10+
11+
/// Filter to events which occured on the specified thread id
12+
#[structopt(short = "t", long = "thread-id")]
13+
thread_id: Option<u64>,
1014
}
1115

1216
fn main() -> Result<(), Box<dyn Error>> {
@@ -15,6 +19,12 @@ fn main() -> Result<(), Box<dyn Error>> {
1519
let data = ProfilingData::new(&opt.file_prefix)?;
1620

1721
for event in data.iter() {
22+
if let Some(thread_id) = opt.thread_id {
23+
if event.thread_id != thread_id {
24+
continue;
25+
}
26+
}
27+
1828
println!("{:?}", event);
1929
}
2030

0 commit comments

Comments
 (0)