-
Notifications
You must be signed in to change notification settings - Fork 164
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
fix(test/libsinsp_e2e): fixed libsinsp_e2e tests for more stability #2085
Merged
Merged
Changes from all commits
Commits
Show all changes
20 commits
Select commit
Hold shift + click to select a range
d4ca933
fix(test/libsinsp_e2e): remove multithreaded usage of sinsp inspector…
FedeDP 5436e83
chore(test): run test synchronously on the same thread of capture unl…
FedeDP fc675a1
chore(test/libsinsp_e2e): more fixes.
FedeDP 25e2d08
chore(test/libsinsp/e2e): some renamings to improve readability.
FedeDP 0a5a79a
fix(test/libsinsp_e2e): use an `eventfd` to signal main thread that i…
FedeDP 999d876
fix(test/libsinsp_e2e): more fixes.
FedeDP fb293fc
fix(userspace/libsinsp, test/libsinsp_e2e): fixed libvirt-lxc contain…
FedeDP 016839c
chore(test/libsinsp_e2e): use an atomic for `healthcheck_helper::exit…
FedeDP d2a9338
chore(test/libsinsp_e2e): disable `get_procs_cpu_from_driver`.
FedeDP 8c2e098
chore(test,userspace): properly reset docker_socket in tests since it…
FedeDP 31378fc
fix(driver/modern_bpf): fixed cgroup paths management for path_compon…
FedeDP fdb1daa
chore(test/libsinsp_e2e): try harder to avoid issues in `tcp_client_s…
FedeDP b6dc25a
fix(test/libsinsp_e2e): only enable generic syscalls in `timestamp` t…
FedeDP 5b14800
chore(test/libsinsp_e2e): avoid using useless atomics.
FedeDP 93776c4
fix(test): try harder to avoid event loss.
FedeDP 741d193
fix(userspace/libpman): try harder to avoid leaking fds.
FedeDP 52c4d31
chore(test/libsinsp_e2e): enlarge drivers' buffer size to avoid event…
FedeDP b714249
fix(test/libsinsp_e2e): avoid possible heap use after free.
FedeDP cf084be
chore(test/libsinsp_e2e): improve test reliability.
FedeDP a904e2e
fix(test/libsinsp_e2e): make container_clone_nspid related tests more…
FedeDP File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1303,7 +1303,7 @@ static __always_inline uint16_t store_cgroup_subsys(struct auxiliary_map *auxmap | |
* at the end of the string, reading with `bpf_probe_read_str()`). | ||
* | ||
* The rationale here is to replace the string terminator '\0' | ||
* with the '/' for every path compotent, excluding the last. | ||
* with the '/' for every path component, excluding the last. | ||
* | ||
* Starting from what we have already inserted ("cpuset="), | ||
* we want to obtain as a final result: | ||
|
@@ -1323,6 +1323,39 @@ static __always_inline uint16_t store_cgroup_subsys(struct auxiliary_map *auxmap | |
* | ||
* cpuset=/path_part1/path_part2\0 | ||
*/ | ||
|
||
/* | ||
* If kernfs node is still not NULL, it means last path component retrieved | ||
* (ie: the first one to be printed) was still not '\0' (ie: '/'). | ||
* To avoid sending a cgroup that does not start with '/', manually add it. | ||
* | ||
* Example: | ||
* /user.slice/user-1000.slice/[email protected]/app.slice/app-org.gnome.Terminal.slice/vte-spawn-2f17b2eb-994e-415d-bce0-44c1447d7cd2.scope | ||
* gets split as: | ||
* * vte-spawn-2f17b2eb-994e-415d-bce0-44c1447d7cd2.scope\0 | ||
* * app-org.gnome.Terminal.slice\0 | ||
* * app.slice\0 | ||
* * [email protected]\0 | ||
* * user-1000.slice\0 | ||
* * user.slice\0 | ||
* Without the below fix, we would send to userspace "user.slice/user-1000.slice/..." without | ||
* leading '/'. | ||
* | ||
* Counter example with "5" components + the root: | ||
* /user.slice/user-1000.slice/[email protected]/app.slice/app-org.gnome.Terminal.slice | ||
* gets split as: | ||
* * app-org.gnome.Terminal.slice\0 | ||
* * app.slice\0 | ||
* * [email protected]\0 | ||
* * user-1000.slice\0 | ||
* * user.slice\0 | ||
* * \0 | ||
* In this case, we won't push the new character, instead we will push the correct string. | ||
*/ | ||
if(kn) { | ||
push__new_character(auxmap->data, &auxmap->payload_pos, '/'); | ||
total_size++; | ||
} | ||
for(int k = MAX_CGROUP_PATH_POINTERS - 1; k >= 0; --k) { | ||
if(cgroup_path_pointers[k]) { | ||
total_size += push__charbuf(auxmap->data, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Fix a bug in how modern_bpf sent cgroups, when number of paths component was greater than
MAX_CGROUP_PATH_POINTERS
.For example, for
that is 7 paths long (considering first one, ie: root, is returned by the kernel as an empty string), we would have returned to userspace:
ie: the leading
/
was missing.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.
Cc @Andreagit97