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 @@ -97,6 +97,7 @@ fn build_orchestrator_config(
poll_results_options,
extra_env: HashMap::new(),
fair_sched: args.shared.experimental.experimental_fair_sched,
rep_bulk_cost: args.shared.experimental.experimental_rep_bulk_cost,
cycle_estimation,
exclude_allocations,
simulation_track_subprocess: args.shared.simulation_track_subprocess,
Expand Down
13 changes: 13 additions & 0 deletions src/cli/experimental.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,16 @@ pub struct ExperimentalArgs {
)]
pub experimental_fair_sched: bool,

/// Enable valgrind's calibrated `rep movs`/`rep stos` cost model (--rep-bulk-cost).
/// Only applies with --cycle-estimation.
#[arg(
long,
default_value_t = false,
help_heading = "Experimental",
env = "CODSPEED_EXPERIMENTAL_REP_BULK_COST"
)]
pub experimental_rep_bulk_cost: bool,

/// Do not set PYTHONMALLOC for simulation runs.
#[arg(
long,
Expand Down Expand Up @@ -66,6 +76,9 @@ impl ExperimentalArgs {
if self.experimental_fair_sched {
flags.push("--experimental-fair-sched");
}
if self.experimental_rep_bulk_cost {
flags.push("--experimental-rep-bulk-cost");
}
if self.experimental_disable_pythonmalloc_override {
flags.push("--experimental-disable-pythonmalloc-override");
}
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 @@ -84,6 +84,7 @@ impl RunArgs {
},
experimental: ExperimentalArgs {
experimental_fair_sched: false,
experimental_rep_bulk_cost: false,
experimental_memory_capture_stack: None,
experimental_cycle_estimation: false,
experimental_exclude_allocations: false,
Expand Down Expand Up @@ -142,6 +143,7 @@ fn build_orchestrator_config(
poll_results_options,
extra_env: HashMap::new(),
fair_sched: args.shared.experimental.experimental_fair_sched,
rep_bulk_cost: args.shared.experimental.experimental_rep_bulk_cost,
cycle_estimation,
exclude_allocations,
simulation_track_subprocess: args.shared.simulation_track_subprocess,
Expand Down
6 changes: 6 additions & 0 deletions src/executor/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,8 @@ pub struct OrchestratorConfig {
pub extra_env: HashMap<String, String>,
/// Enable valgrind's --fair-sched option.
pub fair_sched: bool,
/// Enable valgrind's --rep-bulk-cost option.
pub rep_bulk_cost: bool,
/// Enable valgrind's --cycle-estimation option.
pub cycle_estimation: bool,
/// Signal the backend to exclude memory allocation time from simulation results.
Expand Down Expand Up @@ -160,6 +162,8 @@ pub struct ExecutorConfig {
pub enable_introspection: bool,
/// Enable valgrind's --fair-sched option.
pub fair_sched: bool,
/// Enable valgrind's --rep-bulk-cost option.
pub rep_bulk_cost: bool,
/// Enable valgrind's --cycle-estimation option.
pub cycle_estimation: bool,
/// Signal the backend to exclude memory allocation time from simulation results.
Expand Down Expand Up @@ -246,6 +250,7 @@ impl OrchestratorConfig {
extra_env: self.extra_env.clone(),
enable_introspection: !uses_exec_harness,
fair_sched: self.fair_sched,
rep_bulk_cost: self.rep_bulk_cost,
cycle_estimation: self.cycle_estimation,
exclude_allocations: self.exclude_allocations,
simulation_track_subprocess: self.simulation_track_subprocess || uses_exec_harness,
Expand Down Expand Up @@ -284,6 +289,7 @@ impl OrchestratorConfig {
poll_results_options: PollResultsOptions::new(false, None),
extra_env: HashMap::new(),
fair_sched: false,
rep_bulk_cost: false,
cycle_estimation: true,
exclude_allocations: false,
simulation_track_subprocess: false,
Expand Down
3 changes: 3 additions & 0 deletions src/executor/valgrind/measure.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,9 @@ fn get_valgrind_args(tool: &SimulationTool, config: &ExecutorConfig) -> Vec<Stri
SimulationTool::Callgrind => {
if config.cycle_estimation {
args.push("--cycle-estimation=yes".to_string());
if config.rep_bulk_cost {
args.push("--rep-bulk-cost=yes".to_string());
}
Comment thread
not-matthias marked this conversation as resolved.
Resolved
}

args.push("--tool=callgrind".to_string());
Expand Down
Loading