Skip to content

Commit

Permalink
new(config): allow to skip LSM support autodetection
Browse files Browse the repository at this point in the history
The new global setting `lsm_support` allows to skip LSM support autodetection.
The valid values are 'autodetect', 'true', 'false'. By default we try
to autodetect.
  • Loading branch information
MatteoNardi committed Feb 17, 2023
1 parent 2fa6bcd commit 8f861c6
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions src/pulsard/daemon.rs
Expand Up @@ -67,9 +67,19 @@ impl PulsarDaemon {
} else {
BpfLogLevel::Disabled
};
let lsm_supported = tokio::task::spawn_blocking(lsm_supported)
.await
.unwrap_or(false);
let lsm_supported = match general_config
.with_default("lsm_support", "autodetect".to_string())?
.as_str()
{
"true" => true,
"false" => false,
"autodetect" => tokio::task::spawn_blocking(lsm_supported)
.await
.unwrap_or(false),
x => anyhow::bail!(
"'lsm_supoprt' has invalid value {x:?}. The valid values are 'true', 'false' and 'autodetect'"
),
};
let bpf_context =
BpfContext::new(Pinning::Enabled, perf_pages, bpf_log_level, lsm_supported)?;
#[cfg(debug_assertions)]
Expand Down

0 comments on commit 8f861c6

Please sign in to comment.