bench-api: configure execution with a flags string (#4096)

As discussed previously, we need a way to be able to configure Wasmtime when running it in the Sightglass benchmark infrastructure. The easiest way to do this seemed to be to pass a string from Sightglass to the `bench-api` library and parse this in the same way that Wasmtime parses its CLI flags. The structure that contains these flags is `CommonOptions`, so it has been moved to its own crate to be depended on by both `wasmtime-cli` and `wasmtime-bench-api`. Also, this change adds an externally-visible function for parsing a string into `CommonOptions`, which is used for configuring an engine.
This commit is contained in:
Andrew Brown
2022-05-04 16:30:39 -07:00
committed by GitHub
parent 527b7a9b05
commit 5c3642fcb1
13 changed files with 1093 additions and 744 deletions

View File

@@ -23,6 +23,7 @@ doc = false
[dependencies]
wasmtime = { path = "crates/wasmtime", version = "0.37.0", default-features = false, features = ['cache', 'cranelift'] }
wasmtime-cache = { path = "crates/cache", version = "=0.37.0" }
wasmtime-cli-flags = { path = "crates/cli-flags", version = "=0.37.0" }
wasmtime-cranelift = { path = "crates/cranelift", version = "=0.37.0" }
wasmtime-environ = { path = "crates/environ", version = "=0.37.0" }
wasmtime-wast = { path = "crates/wast", version = "=0.37.0" }
@@ -32,10 +33,7 @@ wasmtime-wasi-nn = { path = "crates/wasi-nn", version = "0.37.0", optional = tru
clap = { version = "3.1.12", features = ["color", "suggestions", "derive"] }
anyhow = "1.0.19"
target-lexicon = { version = "0.12.0", default-features = false }
pretty_env_logger = "0.4.0"
file-per-thread-logger = "0.1.1"
libc = "0.2.60"
rayon = "1.5.0"
humantime = "2.0.0"
wasmparser = "0.84.0"
lazy_static = "1.4.0"
@@ -63,6 +61,7 @@ memchr = "2.4"
async-trait = "0.1"
wat = "1.0.42"
once_cell = "1.9.0"
rayon = "1.5.0"
[build-dependencies]
anyhow = "1.0.19"
@@ -79,6 +78,7 @@ members = [
"cranelift/serde",
"crates/bench-api",
"crates/c-api",
"crates/cli-flags",
"crates/misc/run-examples",
"examples/fib-debug/wasm",
"examples/wasi/wasm",
@@ -105,11 +105,11 @@ jitdump = ["wasmtime/jitdump"]
vtune = ["wasmtime/vtune"]
wasi-crypto = ["wasmtime-wasi-crypto"]
wasi-nn = ["wasmtime-wasi-nn"]
memory-init-cow = ["wasmtime/memory-init-cow"]
pooling-allocator = ["wasmtime/pooling-allocator"]
memory-init-cow = ["wasmtime/memory-init-cow", "wasmtime-cli-flags/memory-init-cow"]
pooling-allocator = ["wasmtime/pooling-allocator", "wasmtime-cli-flags/pooling-allocator"]
all-arch = ["wasmtime/all-arch"]
posix-signals-on-macos = ["wasmtime/posix-signals-on-macos"]
wasm-backtrace = ["wasmtime/wasm-backtrace"]
wasm-backtrace = ["wasmtime/wasm-backtrace", "wasmtime-cli-flags/wasm-backtrace"]
# Stub feature that does nothing, for Cargo-features compatibility: the new
# backend is the default now.