MCPcopy Create free account
hub / github.com/bytecodealliance/wasmtime / profile_with_vtune

Function profile_with_vtune

tests/all/cli_tests.rs:3054–3086  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

3052#[cfg(target_arch = "x86_64")]
3053#[test]
3054fn profile_with_vtune() -> Result<()> {
3055 if !is_vtune_available() {
3056 println!("> `vtune` is not available on the system path; skipping test");
3057 return Ok(());
3058 }
3059
3060 let mut bin = Command::new("vtune");
3061 bin.args(&[
3062 // Configure VTune...
3063 "-verbose",
3064 "-collect",
3065 "hotspots",
3066 "-user-data-dir",
3067 &std::env::temp_dir().to_string_lossy(),
3068 // ...then run Wasmtime with profiling enabled:
3069 get_wasmtime_path(),
3070 "--profile=vtune",
3071 "tests/all/cli_tests/simple.wat",
3072 ]);
3073
3074 println!("> executing: {bin:?}");
3075 let output = bin.output()?;
3076
3077 let stdout = String::from_utf8_lossy(&output.stdout);
3078 let stderr = String::from_utf8_lossy(&output.stderr);
3079 println!("> stdout:\n{stdout}");
3080 println!("> stderr:\n{stderr}");
3081
3082 assert!(output.status.success());
3083 assert!(!stderr.contains("Error"));
3084 assert!(stdout.contains("CPU Time"));
3085 Ok(())
3086}
3087
3088#[cfg(target_arch = "x86_64")]
3089fn is_vtune_available() -> bool {

Callers

nothing calls this directly

Calls 6

is_vtune_availableFunction · 0.85
OkFunction · 0.85
get_wasmtime_pathFunction · 0.85
outputMethod · 0.80
newFunction · 0.50
argsMethod · 0.45

Tested by

no test coverage detected