Repository navigation
feat(cli): add walltime unwinding mode and stack sample size options - #586
not-matthias wants to merge 2 commits into
Conversation
Add --walltime-unwinding-mode (CODSPEED_WALLTIME_UNWINDING_MODE) and --walltime-stack-sample-size (CODSPEED_WALLTIME_STACK_SAMPLE_SIZE) so the call-stack collection can be tuned for both walltime profilers, perf and samply. --perf-unwinding-mode / CODSPEED_PERF_UNWINDING_MODE stays as a hidden, deprecated alias so existing setups keep working; the new option wins when both are set. perf: the explicit stack size overrides the size inferred from the command (default 8192 bytes). samply: on Linux, forward the options as --unwinding-mode and --stack-size.
Match the option name added to samply-codspeed.
Merging this PR will not alter performance
|
|
| log::warn!( | ||
| "CODSPEED_PERF_UNWINDING_MODE / --perf-unwinding-mode is deprecated; use CODSPEED_WALLTIME_UNWINDING_MODE / --walltime-unwinding-mode instead." | ||
| ); |
There was a problem hiding this comment.
Deprecation warning never appears
Both codspeed run and codspeed exec call resolve_unwinding_mode() while building the config, before Orchestrator::new() installs the logger. This drops the warning, so users of --perf-unwinding-mode or CODSPEED_PERF_UNWINDING_MODE never learn about the replacement. Emit it after logger setup or use the existing startup-warning approach.
Prompt To Fix With AI
This is a comment left during a code review.
Path: src/cli/shared.rs
Line: 258-260
Comment:
**Deprecation warning never appears**
Both `codspeed run` and `codspeed exec` call `resolve_unwinding_mode()` while building the config, before `Orchestrator::new()` installs the logger. This drops the warning, so users of `--perf-unwinding-mode` or `CODSPEED_PERF_UNWINDING_MODE` never learn about the replacement. Emit it after logger setup or use the existing startup-warning approach.
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.| pub fn resolve_unwinding_mode(&self) -> Option<UnwindingMode> { | ||
| let Some(legacy) = self.perf_unwinding_mode else { | ||
| return self.walltime_unwinding_mode; | ||
| }; | ||
| log::warn!( | ||
| "CODSPEED_PERF_UNWINDING_MODE / --perf-unwinding-mode is deprecated; use CODSPEED_WALLTIME_UNWINDING_MODE / --walltime-unwinding-mode instead." | ||
| ); | ||
| Some(self.walltime_unwinding_mode.unwrap_or(legacy)) |
There was a problem hiding this comment.
The new precedence and stack-size overrides have no tests. Add focused cases for the old option alone, both options together, flag/environment combinations, and an explicit size overriding both the default and Python's inferred size. These are the main promises of this change; tests would catch later edits that silently send the wrong value to the profiler.
Prompt To Fix With AI
This is a comment left during a code review.
Path: src/cli/shared.rs
Line: 254-261
Comment:
**Option rules lack tests**
The new precedence and stack-size overrides have no tests. Add focused cases for the old option alone, both options together, flag/environment combinations, and an explicit size overriding both the default and Python's inferred size. These are the main promises of this change; tests would catch later edits that silently send the wrong value to the profiler.
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
Summary
--walltime-unwinding-mode/CODSPEED_WALLTIME_UNWINDING_MODEand--walltime-stack-sample-size/CODSPEED_WALLTIME_STACK_SAMPLE_SIZE.--perf-unwinding-mode/CODSPEED_PERF_UNWINDING_MODEas a hidden, deprecated alias. The new option wins when both are set.--unwinding-modeand--unwinding-stack-size.Notes