MCPcopy Create free account
hub / github.com/CodSpeedHQ/codspeed / ensure_sysctl

Function ensure_sysctl

src/executor/wall_time/profiler/linux_sysctl.rs:21–28  ·  view source on GitHub ↗
(name: &str, target_value: i64)

Source from the content-addressed store, hash-verified

19
20#[cfg(target_os = "linux")]
21fn ensure_sysctl(name: &str, target_value: i64) -> Result<()> {
22 if sysctl_read(name)? == target_value {
23 return Ok(());
24 }
25
26 let assignment = format!("{name}={target_value}");
27 run_with_sudo("sysctl", ["-w", assignment.as_str()])
28}
29
30#[cfg(target_os = "linux")]
31fn sysctl_read(name: &str) -> Result<i64> {

Callers 1

Calls 3

sysctl_readFunction · 0.85
run_with_sudoFunction · 0.85
as_strMethod · 0.80

Tested by

no test coverage detected