New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature issue Allow defining shared memory size at runtime #282 #285
base: master
Are you sure you want to change the base?
Conversation
@NobinPegasus Is this PR finished yet? I haven't seen things related to read environment variables |
@Officeyutong I've make changes in tools/cli/main.cpp. Can you check it? And provide feedback? |
@@ -19,6 +19,8 @@ | |||
|
|||
static bool global_shm_initialized = false; | |||
|
|||
size_t BPFTIME_SHARED_MEMORY_SIZE = 20; // Default size |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
non-const variables should not be in upper case
.help("Set the size of the shared memory in megabytes") | ||
.default_value(std::string("20")) // defaulting to the original #define value | ||
.action([](const std::string& value) { | ||
BPFTIME_SHARED_MEMORY_SIZE = std::stoi(value); // Convert MB to bytes |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Have you tested this program? CLI will not be linked with runtime
Description
I have declared
extern size_t BPFTIME_SHARED_MEMORY_SIZE;
insidebpftime_shm_internal.hpp
and insidebpftime_shm_internal.cpp
defined thesize_t BPFTIME_SHARED_MEMORY_SIZE = 20; // Default size
Then inside the cli/main.cpp I have added support for --shared-memory-size.
Fixes #282
Type of change
How Has This Been Tested?
Test Configuration:
Checklist