From 309ecefc16a1bef6a4e393c8f9c5a274ce2bdd9d Mon Sep 17 00:00:00 2001 From: qjerome Date: Wed, 15 Jan 2025 09:18:33 +0100 Subject: [PATCH] rename: max_eps_io -> max_eps_fs --- kunai-common/src/config.rs | 4 ++-- kunai-ebpf/src/probes/fs.rs | 4 ++-- kunai/src/bin/main.rs | 2 +- kunai/src/config.rs | 8 ++++---- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/kunai-common/src/config.rs b/kunai-common/src/config.rs index b8f7b1ee..1d731b55 100644 --- a/kunai-common/src/config.rs +++ b/kunai-common/src/config.rs @@ -67,7 +67,7 @@ impl Filter { pub struct BpfConfig { pub loader: Loader, pub filter: Filter, - pub glob_max_eps_io: Option, - pub task_max_eps_io: Option, + pub glob_max_eps_fs: Option, + pub task_max_eps_fs: Option, pub send_data_min_len: u64, } diff --git a/kunai-ebpf/src/probes/fs.rs b/kunai-ebpf/src/probes/fs.rs index 3144b583..713a5323 100644 --- a/kunai-ebpf/src/probes/fs.rs +++ b/kunai-ebpf/src/probes/fs.rs @@ -128,8 +128,8 @@ unsafe fn limit_eps_with_context(ctx: &C) -> ProbeResult { // we convert event/s to event/sampling let (Some(glob_limit), Some(task_limit)) = ( - cfg.glob_max_eps_io.map(|m| m.div(SAMPLES_IN_1S)), - cfg.task_max_eps_io.map(|m| m.div(SAMPLES_IN_1S)), + cfg.glob_max_eps_fs.map(|m| m.div(SAMPLES_IN_1S)), + cfg.task_max_eps_fs.map(|m| m.div(SAMPLES_IN_1S)), ) else { // if there is no limit we do not throttle return Ok(false); diff --git a/kunai/src/bin/main.rs b/kunai/src/bin/main.rs index 34cfec6b..9b66aca4 100644 --- a/kunai/src/bin/main.rs +++ b/kunai/src/bin/main.rs @@ -2894,7 +2894,7 @@ impl TryFrom for Config { // we want to increase max_buffered_events if let Some(max_eps_io) = opt.max_eps_io { - conf.max_eps_io = Some(max_eps_io); + conf.max_eps_fs = Some(max_eps_io); } // supersedes configuration diff --git a/kunai/src/config.rs b/kunai/src/config.rs index 434c4aa8..d7e9f492 100644 --- a/kunai/src/config.rs +++ b/kunai/src/config.rs @@ -68,7 +68,7 @@ pub struct Scanner { pub struct Config { host_uuid: Option, pub max_buffered_events: u16, - pub max_eps_io: Option, + pub max_eps_fs: Option, pub workers: Option, pub send_data_min_len: Option, pub harden: bool, @@ -102,7 +102,7 @@ impl Default for Config { }, max_buffered_events: DEFAULT_MAX_BUFFERED_EVENTS, // this x2 rule generally works for small values of max_buffered_events - max_eps_io: Some(DEFAULT_MAX_BUFFERED_EVENTS as u64 * 2), + max_eps_fs: Some(DEFAULT_MAX_BUFFERED_EVENTS as u64 * 2), workers: None, send_data_min_len: None, scanner: Scanner { @@ -229,8 +229,8 @@ impl TryFrom<&Config> for BpfConfig { Ok(Self { loader: Loader::from_own_pid(), filter: value.try_into()?, - glob_max_eps_io: value.max_eps_io, - task_max_eps_io: value.max_eps_io.map(|m| m.mul(2).div(3)), + glob_max_eps_fs: value.max_eps_fs, + task_max_eps_fs: value.max_eps_fs.map(|m| m.mul(2).div(3)), send_data_min_len: value.send_data_min_len.unwrap_or(DEFAULT_SEND_DATA_MIN_LEN), }) }