-
Notifications
You must be signed in to change notification settings - Fork 245
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
Add JIT & Interpreter build switches. #2031
Add JIT & Interpreter build switches. #2031
Conversation
Codecov Report
@@ Coverage Diff @@
## main #2031 +/- ##
==========================================
+ Coverage 82.41% 82.66% +0.25%
==========================================
Files 141 152 +11
Lines 25402 27546 +2144
==========================================
+ Hits 20935 22771 +1836
- Misses 4467 4775 +308
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
@@ -407,10 +413,12 @@ divide_by_zero_test_km(ebpf_execution_type_t execution_type) | |||
// If we don't bug-check, the test passed. | |||
} | |||
|
|||
#if !defined(CONFIG_BPF_JIT_DISABLED) |
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.
Are we running the api_tests on 2 different flavors of the build (one which has JIT disabled and one which has JIT enabled)? If not, we will lose test coverage in kernel tests for JIT scenarios.
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.
Currently, none of the testes use the regular_native-only
build, which is the only using the new switches.
Coverage and more will be taken care of on #2030.
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.
Approving but see suggestion
@@ -3,7 +3,8 @@ | |||
|
|||
option(EBPFFORWINDOWS_ENABLE_TESTS "Set to true to enable tests" true) | |||
option(EBPFFORWINDOWS_ENABLE_INSTALL "Set to true to enable the install target") | |||
option(EBPFFORWINDOWS_ENABLE_DISABLE_EBPF_INTERPRETER "Set to true to compile with the interpreter always disabled") | |||
option(EBPFFORWINDOWS_DISABLE_JIT "Set to true to compile with the JIT compiler disabled") | |||
option(EBPFFORWINDOWS_DISABLE_INTERPRETER "Set to true to compile with the Interpreter disabled") |
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.
Since the interpreter should be off by default, can we reverse the parity and require setting it to true to compile with the interpreter enabled?
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.
@dthaler This was discussed internally, would alter the UX on Visual Studio, where you will have to build via CLI if you want the Interpreter enabled.
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.
PS: should the interpreter is disabled by default in Release
builds (i.e., regardless of the switch)?
@@ -94,7 +94,7 @@ | |||
</ItemDefinitionGroup> | |||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> | |||
<ClCompile> | |||
<PreprocessorDefinitions>WINAPI_FAMILY=WINAPI_FAMILY_DESKTOP_APP;WINAPI_PARTITION_DESKTOP=1;WINAPI_PARTITION_SYSTEM=1;WINAPI_PARTITION_APP=1;WINAPI_PARTITION_PC_APP=1;%(PreprocessorDefinitions);_NO_CRT_STDIO_INLINE=1;CONFIG_BPF_JIT_ALWAYS_ON=1</PreprocessorDefinitions> | |||
<PreprocessorDefinitions>WINAPI_FAMILY=WINAPI_FAMILY_DESKTOP_APP;WINAPI_PARTITION_DESKTOP=1;WINAPI_PARTITION_SYSTEM=1;WINAPI_PARTITION_APP=1;WINAPI_PARTITION_PC_APP=1;%(PreprocessorDefinitions);_NO_CRT_STDIO_INLINE=1;</PreprocessorDefinitions> |
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.
Should we add CONFIG_BPF_INTERPRETER_DISABLED
since we are now removing CONFIG_BPF_JIT_ALWAYS_ON
?
@@ -67,7 +67,7 @@ | |||
</ItemDefinitionGroup> | |||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> | |||
<ClCompile> | |||
<PreprocessorDefinitions>NDEBUG;_CONSOLE;CONFIG_BPF_JIT_ALWAYS_ON=1;%(PreprocessorDefinitions)</PreprocessorDefinitions> | |||
<PreprocessorDefinitions>NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions> |
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.
Same question as above: Should we add CONFIG_BPF_INTERPRETER_DISABLED
here?
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.
Same as above, it's now moved to the Directory.Build.props
for global control.
@@ -67,7 +67,7 @@ | |||
</ItemDefinitionGroup> | |||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> | |||
<ClCompile> | |||
<PreprocessorDefinitions>NDEBUG;_CONSOLE;CONFIG_BPF_JIT_ALWAYS_ON=1;%(PreprocessorDefinitions)</PreprocessorDefinitions> | |||
<PreprocessorDefinitions>NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions> |
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.
same as above.
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.
Same as above, it's now moved to the Directory.Build.props
for global control.
Closes #1883
Description
This PR adds two build switches for individually disabling the JIT compiler and the interpreter, as well as adding the corresponding support into code and project files.
Testing
CI/CD pipeline.
Documentation
GettingStarted.md