-
Notifications
You must be signed in to change notification settings - Fork 20
Expand file tree
/
Copy pathexecutor.rs
More file actions
55 lines (44 loc) · 1.45 KB
/
executor.rs
File metadata and controls
55 lines (44 loc) · 1.45 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
use async_trait::async_trait;
use crate::prelude::*;
use crate::run::instruments::mongo_tracer::MongoTracer;
use crate::run::runner::executor::Executor;
use crate::run::runner::{ExecutorName, RunData};
use crate::run::{check_system::SystemInfo, config::Config};
use super::setup::install_valgrind;
use super::{helpers::perf_maps::harvest_perf_maps, helpers::venv_compat, measure};
pub struct ValgrindExecutor;
#[async_trait(?Send)]
impl Executor for ValgrindExecutor {
fn name(&self) -> ExecutorName {
ExecutorName::Valgrind
}
async fn setup(&self, system_info: &SystemInfo) -> Result<()> {
install_valgrind(system_info).await?;
if let Err(error) = venv_compat::symlink_libpython(None) {
error!("Failed to symlink libpython: {}", error);
} else {
info!("Successfully added symlink for libpython in the venv");
}
Ok(())
}
async fn run(
&self,
config: &Config,
_system_info: &SystemInfo,
run_data: &RunData,
mongo_tracer: &Option<MongoTracer>,
) -> Result<()> {
//TODO: add valgrind version check
measure::measure(config, &run_data.profile_folder, mongo_tracer).await?;
Ok(())
}
async fn teardown(
&self,
_config: &Config,
_system_info: &SystemInfo,
run_data: &RunData,
) -> Result<()> {
harvest_perf_maps(&run_data.profile_folder).await?;
Ok(())
}
}