-
Notifications
You must be signed in to change notification settings - Fork 11
Add tests for Cilium style global variables, using named sections and non-static #53
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
Conversation
… non-static Signed-off-by: Alan Jowett <[email protected]>
WalkthroughThis update introduces a new custom build command in the CMake configuration to compile Changes
Sequence Diagram(s)sequenceDiagram
participant CMake
participant Compiler
CMake->>Compiler: Invoke compile command for global_variable_2.c
Compiler-->>CMake: Generate global_variable_2.o
sequenceDiagram
participant Caller
participant func
participant CONFIG
Caller->>func: Call func()
func->>CONFIG: Access global variable via CONFIG macro
CONFIG-->>func: Return value (10)
func-->>Caller: Return global variable value
Poem
Tip 🌐 Web search-backed reviews and chat
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
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.
Actionable comments posted: 0
🧹 Nitpick comments (1)
src/global_variable_2.c (1)
37-40: Add function documentation.Document the purpose of this function and the expected usage of the ctx parameter.
+/** + * Returns the value of the global configuration variable. + * @param ctx The eBPF context (unused in this function) + * @return The current value of global_var + */ int func(void* ctx) {
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (1)
build/global_variable_2.ois excluded by!**/*.o
📒 Files selected for processing (2)
CMakeLists.txt(2 hunks)src/global_variable_2.c(1 hunks)
🔇 Additional comments (4)
src/global_variable_2.c (2)
12-31: LGTM! Well-structured macro definitions.The macros provide a robust mechanism for declaring, assigning, and accessing global configuration variables with proper section placement and BTF declarations.
33-35: LGTM! Proper usage of configuration macros.The global variable is declared with a clear description and assigned an initial value following the macro pattern.
CMakeLists.txt (2)
29-29: LGTM! Proper target addition.The new target is correctly added to the samples dependencies in alphabetical order.
102-104: LGTM! Consistent custom command implementation.The build command follows the established pattern with correct flags and dependencies.
This pull request includes updates to the
CMakeLists.txtfile and the addition of a new source filesrc/global_variable_2.c. The changes primarily focus on adding a new global variable configuration.Updates to
CMakeLists.txt:global_variable_2.oto theadd_custom_target(samples ALLlist.global_variable_2.ofromglobal_variable_2.cusingclang.Addition of
src/global_variable_2.c:global_variable_2.cwhich includes macros for declaring, assigning, and accessing a global configuration variable.Summary by CodeRabbit