Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/cli/exec/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ fn build_orchestrator_config(
extra_env: HashMap::new(),
fair_sched: args.shared.experimental.experimental_fair_sched,
cycle_estimation: args.shared.experimental.cycle_estimation,
exclude_allocations: args.shared.experimental.exclude_allocations,
})
}

Expand Down
16 changes: 16 additions & 0 deletions src/cli/experimental.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,19 @@ pub struct ExperimentalArgs {
env = "CODSPEED_CYCLE_ESTIMATION"
)]
pub cycle_estimation: bool,

/// Exclude memory allocation time from simulation results.
///
/// Signals the backend to parse and subtract allocator time when interpreting
/// the run. Runs with different values are not comparable, so the value is part
/// of the run's measurement configuration.
#[arg(
long,
default_value_t = false,
help_heading = "Experimental",
env = "CODSPEED_EXCLUDE_ALLOCATIONS"
)]
pub exclude_allocations: bool,
}

impl ExperimentalArgs {
Expand All @@ -37,6 +50,9 @@ impl ExperimentalArgs {
if self.cycle_estimation {
flags.push("--cycle-estimation");
}
if self.exclude_allocations {
flags.push("--exclude-allocations");
}
flags
}

Expand Down
2 changes: 2 additions & 0 deletions src/cli/run/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ impl RunArgs {
experimental: ExperimentalArgs {
experimental_fair_sched: false,
cycle_estimation: false,
exclude_allocations: false,
},
},
instruments: vec![],
Expand Down Expand Up @@ -129,6 +130,7 @@ fn build_orchestrator_config(
extra_env: HashMap::new(),
fair_sched: args.shared.experimental.experimental_fair_sched,
cycle_estimation: args.shared.experimental.cycle_estimation,
exclude_allocations: args.shared.experimental.exclude_allocations,
})
}

Expand Down
6 changes: 6 additions & 0 deletions src/executor/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,8 @@ pub struct OrchestratorConfig {
pub fair_sched: bool,
/// Enable valgrind's --cycle-estimation option.
pub cycle_estimation: bool,
/// Signal the backend to exclude memory allocation time from simulation results.
pub exclude_allocations: bool,
}

/// Per-execution configuration passed to executors.
Expand Down Expand Up @@ -128,6 +130,8 @@ pub struct ExecutorConfig {
pub fair_sched: bool,
/// Enable valgrind's --cycle-estimation option.
pub cycle_estimation: bool,
/// Signal the backend to exclude memory allocation time from simulation results.
pub exclude_allocations: bool,
}

#[derive(Debug, Clone, PartialEq)]
Expand Down Expand Up @@ -198,6 +202,7 @@ impl OrchestratorConfig {
enable_introspection,
fair_sched: self.fair_sched,
cycle_estimation: self.cycle_estimation,
exclude_allocations: self.exclude_allocations,
}
}
}
Expand Down Expand Up @@ -231,6 +236,7 @@ impl OrchestratorConfig {
extra_env: HashMap::new(),
fair_sched: false,
cycle_estimation: false,
exclude_allocations: false,
}
}
}
Expand Down
1 change: 1 addition & 0 deletions src/run_environment/provider.rs
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,7 @@ pub trait RunEnvironmentProvider {
version: crate::VERSION.into(),
instruments: config.instruments.get_active_instrument_names(),
executor: executor_name,
exclude_allocations: config.exclude_allocations,
system_info: system_info.clone(),
},
run_environment: self.get_run_environment(),
Expand Down
7 changes: 7 additions & 0 deletions src/upload/interfaces.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,13 @@ pub struct Runner {
pub version: String,
pub instruments: Vec<InstrumentName>,
pub executor: ExecutorName,
/// Whether memory allocation time is excluded from results. Part of the run's
/// measurement configuration: runs with different values are not comparable.
///
/// Skipped when `false` so the default payload stays byte-identical to runs
/// without this feature, keeping the metadata hash and version unchanged.
#[serde(skip_serializing_if = "std::ops::Not::not")]
pub exclude_allocations: bool,
Comment thread
greptile-apps[bot] marked this conversation as resolved.
#[serde(flatten)]
pub system_info: SystemInfo,
}
Expand Down
2 changes: 2 additions & 0 deletions src/upload/upload_metadata.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ mod tests {
version: "2.1.0".into(),
instruments: vec![InstrumentName::MongoDB],
executor: ExecutorName::Valgrind,
exclude_allocations: false,
system_info: SystemInfo::test(),
},
run_environment: RunEnvironment::GithubActions,
Expand Down Expand Up @@ -95,6 +96,7 @@ mod tests {
version: "4.11.1".into(),
instruments: vec![],
executor: ExecutorName::Valgrind,
exclude_allocations: false,
system_info: SystemInfo {
os: crate::system::SupportedOs::Linux(
crate::system::LinuxDistribution::Other {
Expand Down
Loading