-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
4816b40
commit 617c6cb
Showing
7 changed files
with
799 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,4 +4,5 @@ node_modules/** | |
**/.DS_Store | ||
.DS_Store | ||
performance.db.ndjson | ||
performance.ndjson | ||
performance.ndjson | ||
target/ |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
[workspace] | ||
members = ["replay_gen"] | ||
resolver = "2" | ||
|
||
[profile.release] | ||
# Optimize all the things! | ||
opt-level = 3 | ||
lto = "fat" | ||
overflow-checks = true | ||
# Some debug info for profiling. | ||
debug = 1 | ||
|
||
[profile.test] | ||
# Speed-up test execution and avoid stack overflow with deeply-nested ASTs. | ||
opt-level = 2 | ||
lto = "thin" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
[package] | ||
name = "replay_gen" | ||
version = "0.1.0" | ||
edition = "2021" | ||
|
||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html | ||
|
||
[dependencies] | ||
tempfile = "3.2.0" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
pub mod trace; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
use std::env; | ||
use std::fs::File; | ||
use std::io::{self, BufRead}; | ||
use std::path::Path; | ||
|
||
use replay_gen::trace; | ||
|
||
fn main() -> io::Result<()> { | ||
// FIXME: use clap to parse args. currently just panics. | ||
let args: Vec<String> = env::args().collect(); | ||
let newline = &args[1]; | ||
let path = Path::new(newline); | ||
let file = File::open(&path)?; | ||
let reader = io::BufReader::new(file); | ||
|
||
let mut lines = reader.lines().peekable(); | ||
|
||
while let Some(line) = lines.next() { | ||
let line = line?; | ||
let event = line.parse::<trace::WasmEvent>()?; | ||
// hack to print the last event without a newline that matches the current behavior. | ||
if lines.peek().is_some() { | ||
println!("{:?}", event); | ||
} else { | ||
print!("{:?}", event); | ||
} | ||
} | ||
Ok(()) | ||
} |
Oops, something went wrong.