()
| 3052 | #[cfg(target_arch = "x86_64")] |
| 3053 | #[test] |
| 3054 | fn 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")] |
| 3089 | fn is_vtune_available() -> bool { |
nothing calls this directly
no test coverage detected