near / wasmtime

Standalone JIT-style runtime for WebAssembly, using Cranelift
https://wasmtime.dev/
Apache License 2.0
3 stars 4 forks source link

feat(bench): add subcommand to go from WAT to instruction trace #250

Closed mooori closed 6 months ago

mooori commented 6 months ago

The subcommand is called profile-inst and it can be run, for example, with:

cargo run -p analyze-zkasm -- profile-inst \
    cranelift/zkasm_data/benchmarks/sha256/from_rust.wat \
    trace.txt

To print the command's docs:

cargo run -p analyze-zkasm -- profile-inst --help

Generates instrumented zkasm and runs it produce the trace of executed instructions

Usage: analyze-zkasm profile-inst <WAT_PATH> <OUT_PATH>

Arguments:
  <WAT_PATH>  Path to the input WAT file
  <OUT_PATH>  Path to the file where the trace is written

Options:
  -h, --help     Print help
  -V, --version  Print version