Skip to content

Commit 0fdb0de

Browse files
committed
fixup! feat(walltime): rename CODSPEED_PERF_ENABLED to CODSPEED_PROFILER_ENABLED
1 parent 72e81ac commit 0fdb0de

3 files changed

Lines changed: 18 additions & 10 deletions

File tree

src/cli/exec/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,8 @@ fn build_orchestrator_config(
7777
targets: vec![target],
7878
modes,
7979
instruments: Instruments { mongodb: None }, // exec doesn't support MongoDB
80-
perf_unwinding_mode: args.shared.perf_run_args.perf_unwinding_mode,
81-
enable_profiler: args.shared.perf_run_args.resolve_enable_profiler(),
80+
perf_unwinding_mode: args.shared.profiler_run_args.perf.perf_unwinding_mode,
81+
enable_profiler: args.shared.profiler_run_args.resolve_enable_profiler(),
8282
simulation_tool: args.shared.simulation_tool.unwrap_or_default(),
8383
profile_folder: args.shared.profile_folder,
8484
skip_upload: args.shared.skip_upload,

src/cli/run/mod.rs

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,8 @@ pub enum MessageFormat {
4848
impl RunArgs {
4949
/// Constructs a new `RunArgs` with default values for testing purposes
5050
pub fn test() -> Self {
51-
use super::PerfRunArgs;
5251
use super::experimental::ExperimentalArgs;
52+
use super::{PerfRunArgs, ProfilerRunArgs};
5353
use crate::RunnerMode;
5454

5555
Self {
@@ -69,10 +69,12 @@ impl RunArgs {
6969
go_runner_version: None,
7070
show_full_output: false,
7171
base: None,
72-
perf_run_args: PerfRunArgs {
72+
profiler_run_args: ProfilerRunArgs {
7373
enable_profiler: false,
7474
enable_perf: None,
75-
perf_unwinding_mode: None,
75+
perf: PerfRunArgs {
76+
perf_unwinding_mode: None,
77+
},
7678
},
7779
experimental: ExperimentalArgs {
7880
experimental_fair_sched: false,
@@ -112,8 +114,8 @@ fn build_orchestrator_config(
112114
targets,
113115
modes,
114116
instruments,
115-
perf_unwinding_mode: args.shared.perf_run_args.perf_unwinding_mode,
116-
enable_profiler: args.shared.perf_run_args.resolve_enable_profiler(),
117+
perf_unwinding_mode: args.shared.profiler_run_args.perf.perf_unwinding_mode,
118+
enable_profiler: args.shared.profiler_run_args.resolve_enable_profiler(),
117119
simulation_tool: args.shared.simulation_tool.unwrap_or_default(),
118120
profile_folder: args.shared.profile_folder,
119121
skip_upload: args.shared.skip_upload,

src/cli/shared.rs

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ pub struct ExecAndRunSharedArgs {
109109
pub base: Option<String>,
110110

111111
#[command(flatten)]
112-
pub perf_run_args: PerfRunArgs,
112+
pub profiler_run_args: ProfilerRunArgs,
113113

114114
#[command(flatten)]
115115
pub experimental: ExperimentalArgs,
@@ -151,7 +151,7 @@ pub enum UnwindingMode {
151151
}
152152

153153
#[derive(Args, Debug, Clone)]
154-
pub struct PerfRunArgs {
154+
pub struct ProfilerRunArgs {
155155
/// Enable a profiler to collect granular performance data.
156156
/// This is only supported on Linux.
157157
#[arg(long, env = "CODSPEED_PROFILER_ENABLED", default_value_t = true)]
@@ -161,12 +161,18 @@ pub struct PerfRunArgs {
161161
#[arg(long, env = "CODSPEED_PERF_ENABLED", hide = true)]
162162
pub enable_perf: Option<bool>,
163163

164+
#[command(flatten)]
165+
pub perf: PerfRunArgs,
166+
}
167+
168+
#[derive(Args, Debug, Clone)]
169+
pub struct PerfRunArgs {
164170
/// The unwinding mode that should be used with perf to collect the call stack.
165171
#[arg(long, env = "CODSPEED_PERF_UNWINDING_MODE")]
166172
pub perf_unwinding_mode: Option<UnwindingMode>,
167173
}
168174

169-
impl PerfRunArgs {
175+
impl ProfilerRunArgs {
170176
/// Resolves the effective `enable_profiler` value, honoring the deprecated
171177
/// `--enable-perf` / `CODSPEED_PERF_ENABLED` flag with a warning.
172178
pub fn resolve_enable_profiler(&self) -> bool {

0 commit comments

Comments
 (0)