Skip to content
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

Convert usersim to a DLL #2683

Merged
merged 9 commits into from
Jul 27, 2023
Merged

Convert usersim to a DLL #2683

merged 9 commits into from
Jul 27, 2023

Conversation

dthaler
Copy link
Collaborator

@dthaler dthaler commented Jul 18, 2023

Description

  • Convert usersim to a DLL
  • Also make the cmake build clear program info state like the VS build does. (PR Registry changes for program and section data. #1192 updated the vcxproj file but not the corresponding CMakeLists.txt file for export_program_info.)
  • Update platform_unit_test.cpp to fix deadlock in epoch_test_stale_items hit by latest usersim fixes. The main test thread can't run at DISPATCH_LEVEL or it can block execution of one of the two test threads if they are affinitized to the same processor as the main test thread.
  • Update performance test to fix the same issue.
  • Update single_instance_hook_t test class to not throw exceptions in unit tests, but rather allow using REQUIRE() so catch2 can correctly deal with fault injection

Fixes #2586

Testing

Covered by existing tests

Documentation

No impact

Signed-off-by: Dave Thaler <[email protected]>
Signed-off-by: Dave Thaler <[email protected]>
PR microsoft#1192 updated the vcxproj file but not the corresponding CMakeLists.txt file
for export_program_info

Signed-off-by: Dave Thaler <[email protected]>
Alan-Jowett
Alan-Jowett previously approved these changes Jul 18, 2023
@dthaler dthaler marked this pull request as draft July 19, 2023 18:53
Signed-off-by: Dave Thaler <[email protected]>
@codecov
Copy link

codecov bot commented Jul 26, 2023

Codecov Report

Merging #2683 (3a8a6d8) into main (792d41c) will decrease coverage by 0.02%.
Report is 9 commits behind head on main.
The diff coverage is 97.26%.

❗ Current head 3a8a6d8 differs from pull request most recent head 7e614db. Consider uploading reports for the commit 7e614db to get more accurate results

@@            Coverage Diff             @@
##             main    #2683      +/-   ##
==========================================
- Coverage   83.12%   83.11%   -0.02%     
==========================================
  Files         146      146              
  Lines       28029    28070      +41     
==========================================
+ Hits        23299    23329      +30     
- Misses       4730     4741      +11     
Files Changed Coverage Δ
libs/platform/unit/platform_unit_test.cpp 98.71% <ø> (-0.01%) ⬇️
libs/platform/user/ebpf_platform_user.cpp 86.13% <ø> (-1.21%) ⬇️
tests/end_to_end/helpers.h 90.40% <77.77%> (-0.33%) ⬇️
...ution_context/unit/execution_context_unit_test.cpp 98.89% <100.00%> (+<0.01%) ⬆️
libs/platform/ebpf_platform.c 90.81% <100.00%> (+0.23%) ⬆️
tests/end_to_end/end_to_end.cpp 97.90% <100.00%> (+0.03%) ⬆️
tests/end_to_end/test_helper.cpp 86.34% <100.00%> (-0.68%) ⬇️
tests/netebpfext_unit/netebpf_ext_helper.cpp 97.02% <100.00%> (-1.00%) ⬇️
tests/netebpfext_unit/netebpf_ext_helper.h 97.61% <100.00%> (-0.30%) ⬇️
tests/unit/libbpf_test.cpp 99.94% <100.00%> (+<0.01%) ⬆️

... and 27 files with indirect coverage changes

@dthaler dthaler marked this pull request as ready for review July 26, 2023 14:41
@dthaler dthaler requested a review from shpalani as a code owner July 26, 2023 14:41
@dthaler dthaler added the tests label Jul 26, 2023
@@ -450,9 +450,6 @@ TEST_CASE("epoch_test_stale_items", "[platform]")
return;
}

KIRQL old_irql;
KeRaiseIrql(DISPATCH_LEVEL, &old_irql);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: why did we remove this?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's explained in the PR description.

saxena-anurag
saxena-anurag previously approved these changes Jul 27, 2023
@dthaler dthaler enabled auto-merge July 27, 2023 17:40
@dthaler dthaler added this pull request to the merge queue Jul 27, 2023
Merged via the queue into microsoft:main with commit a29064a Jul 27, 2023
66 checks passed
@dthaler dthaler deleted the usersim-dll branch July 27, 2023 19:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Factor the usersim code into a separate repository
3 participants