fix: take into consideration that load_yaml is called more than once

Signed-off-by: Andrea Terzolo <andreaterzolo3@gmail.com>
This commit is contained in:
Andrea Terzolo
2023-11-18 15:24:57 +01:00
committed by poiana
parent 5e8e0a4722
commit 588a94578a
6 changed files with 250 additions and 25 deletions

View File

@@ -184,7 +184,12 @@ void falco_configuration::load_engine_config(const std::string& config_name, con
}
// If we arrive here it means we have at least one change in the `engine` config.
// Please note that `load_config` is called more than one time during initialization
// so the last time wins
m_changes_in_engine_config = true;
m_syscall_buf_size_preset = 0;
m_cpus_for_each_syscall_buffer = 0;
m_syscall_drop_failed_exit = false;
}
void falco_configuration::load_yaml(const std::string& config_name, const yaml_helper& config)

View File

@@ -172,9 +172,9 @@ public:
// used to keep track if the `engine` config is used.
bool m_changes_in_engine_config = false;
// Index corresponding to the syscall buffer dimension.
uint16_t m_syscall_buf_size_preset = 4;
uint16_t m_syscall_buf_size_preset = 0;
// Number of CPUs associated with a single ring buffer.
uint16_t m_cpus_for_each_syscall_buffer = 2;
uint16_t m_cpus_for_each_syscall_buffer = 0;
bool m_syscall_drop_failed_exit = false;
private: