Skip to content

Commit cdc098a

Browse files
committed
refactor(walltime): rename Profiler::wrap to wrap_command
1 parent f94e5b3 commit cdc098a

4 files changed

Lines changed: 12 additions & 10 deletions

File tree

src/executor/wall_time/executor.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,9 @@ async fn run_with_profiler(
241241
profile_folder: &Path,
242242
benchmark_state: &OnceCell<(FifoBenchmarkData, ExecutionTimestamps)>,
243243
) -> Result<std::process::ExitStatus> {
244-
let wrapped = profiler.wrap(cmd_builder, config, profile_folder).await?;
244+
let wrapped = profiler
245+
.wrap_command(cmd_builder, config, profile_folder)
246+
.await?;
245247
let cmd = wrapped.build();
246248
debug!("cmd: {cmd:?}");
247249

src/executor/wall_time/profiler/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ pub trait Profiler {
4646
/// `CommandBuilder` is what gets spawned. Profilers stash any live state
4747
/// they need for the duration of the run (control fifos, output paths)
4848
/// on `self`.
49-
async fn wrap(
49+
async fn wrap_command(
5050
&mut self,
5151
cmd: CommandBuilder,
5252
config: &ExecutorConfig,

src/executor/wall_time/profiler/perf/mod.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -47,12 +47,12 @@ pub mod perf_executable;
4747
const PERF_PIPEDATA_FILE_NAME: &str = "perf.pipedata";
4848

4949
pub struct PerfProfiler {
50-
/// Set by [`Profiler::wrap`]; used by the FIFO hooks to control event
50+
/// Set by [`Profiler::wrap_command`]; used by the FIFO hooks to control event
5151
/// recording on the live `perf record` process.
5252
perf_fifo: Option<PerfFifo>,
5353

5454
/// Path to the file that the wrapped command pipes `perf record`'s
55-
/// stdout into. Set by [`Profiler::wrap`]; consumed by [`Profiler::finalize`].
55+
/// stdout into. Set by [`Profiler::wrap_command`]; consumed by [`Profiler::finalize`].
5656
perf_file_path: Option<PathBuf>,
5757
}
5858

@@ -67,7 +67,7 @@ impl PerfProfiler {
6767
fn perf_fifo_mut(&mut self) -> anyhow::Result<&mut PerfFifo> {
6868
self.perf_fifo
6969
.as_mut()
70-
.context("PerfProfiler::wrap must be called before FIFO hooks")
70+
.context("PerfProfiler::wrap_command must be called before FIFO hooks")
7171
}
7272
}
7373

@@ -86,7 +86,7 @@ impl Profiler for PerfProfiler {
8686
ensure_linux_profiling_sysctls()
8787
}
8888

89-
async fn wrap(
89+
async fn wrap_command(
9090
&mut self,
9191
mut cmd_builder: CommandBuilder,
9292
config: &ExecutorConfig,
@@ -210,7 +210,7 @@ impl Profiler for PerfProfiler {
210210
let perf_file_path = self
211211
.perf_file_path
212212
.as_ref()
213-
.context("PerfProfiler::wrap must be called before finalize")?;
213+
.context("PerfProfiler::wrap_command must be called before finalize")?;
214214

215215
let bench_data = BenchmarkData {
216216
fifo_data,

src/executor/wall_time/profiler/samply/mod.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ use super::WALLTIME_METADATA_CURRENT_VERSION;
2121
const SAMPLY_OUTPUT_FILE_NAME: &str = "samply-profile.json.gz";
2222

2323
pub struct SamplyProfiler {
24-
/// Set by [`Profiler::wrap`]. Currently unused after `wrap` returns —
25-
/// samply writes the file itself — but we hold onto it so future
24+
/// Set by [`Profiler::wrap_command`]. Currently unused after `wrap_command`
25+
/// returns — samply writes the file itself — but we hold onto it so future
2626
/// `finalize` work (e.g. validation, conversion) has the path on hand.
2727
output_path: Option<PathBuf>,
2828
}
@@ -43,7 +43,7 @@ impl Profiler for SamplyProfiler {
4343
ensure_linux_profiling_sysctls()
4444
}
4545

46-
async fn wrap(
46+
async fn wrap_command(
4747
&mut self,
4848
mut cmd_builder: CommandBuilder,
4949
_config: &ExecutorConfig,

0 commit comments

Comments
 (0)