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

sensor pinning fixes (and misc updates) #409

Merged
merged 7 commits into from
Sep 16, 2022
Merged

Conversation

kkourt
Copy link
Contributor

@kkourt kkourt commented Sep 15, 2022

This PR aims to sanitize pinning and meant as an intermediate step towards #408. It also includes some simple (first 3) patches.

One of the immediate effects of this PR is that generic tracepoints have unique map names and collisions that may cause problems are avoided.

See patches for more information.

@kkourt kkourt force-pushed the pr/kkourt/pinning-fixes branch from cb42792 to c9a0eae Compare September 15, 2022 09:22
@kkourt kkourt marked this pull request as ready for review September 15, 2022 09:32
@kkourt kkourt requested a review from a team as a code owner September 15, 2022 09:32
pkg/selectors/kernel.go Outdated Show resolved Hide resolved
Copy link
Member

@tpapagian tpapagian left a comment

Choose a reason for hiding this comment

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

LGTM!

nit: typo "hiearachy" -> "hierarchy" in the description of 68fae5b

The ordering of how selectors are encoded in the comment is wrong. Fix
it. Also, specify that the array includes filter offsets and not the
filters themselves.

Signed-off-by: Kornilios Kourtis <[email protected]>
verifier log is only dumped if verbose != 0. Only print the log message
if that's true.

Signed-off-by: Kornilios Kourtis <[email protected]>
Don't use the static tail call path. Instead use whatever name was
configured in the PinMap information.

Signed-off-by: Kornilios Kourtis <[email protected]>
This is meant to be used by sensors to create paths for their objects
under /sys/fs/bpf. Ideally, we would want a directory hierarchy under
each sensor, as described in #408.

This is currently not easy to do, however. Instead, use a function that
adds "-" instead of "/", leading to a flat hierarchy that has unique
names. This function can be changed to filepath.Join once everything is
in place.

The purpose of the function is to document the above intention.

Signed-off-by: Kornilios Kourtis <[email protected]>
Signed-off-by: Kornilios Kourtis <[email protected]>
generic tracepoints are defined in tracing policies. There can be
multiple tracing policies defined in a system, and each tracing policy
can have multiple tracepoints.

Currently paths are not unique, which may cause collisions. Collisions
can lead to unexpected errors.

This patch makes the pinned filepaths for tracepoints unique. The path
is build using sensor.PathJoin so, for now, there are no directories and
the hierarchy is flat.

The path is constructed using:
 - the sensor name
 - an identifier for each tracepoint
 - the program or map name

Signed-off-by: Kornilios Kourtis <[email protected]>
@kkourt kkourt force-pushed the pr/kkourt/pinning-fixes branch from c9a0eae to ea78cf5 Compare September 15, 2022 10:44
@kkourt
Copy link
Contributor Author

kkourt commented Sep 15, 2022

LGTM!

nit: typo "hiearachy" -> "hierarchy" in the description of 68fae5b

Thanks! Pushed a new version with above fixed, as well as the rest of the comments.

@kkourt kkourt merged commit d521ae1 into main Sep 16, 2022
@kkourt kkourt deleted the pr/kkourt/pinning-fixes branch September 16, 2022 05:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants