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

Improve LSM support autodetection #156

Merged
merged 5 commits into from Feb 21, 2023

Conversation

MatteoNardi
Copy link
Contributor

@MatteoNardi MatteoNardi commented Feb 10, 2023

Improve LSM autodetection by trying to load an example LSM program.

  • split bpf-builder to its own crate because bpf-common would have needed to depend on itself at build-time.
  • added lsm_supported to BpfContext in order to avoid repeating the time-consuming check.
  • add a configuration field to pulsar for forcing the use of kprobes/lsm

I have

  • run cargo fmt;
  • run cargo clippy;
  • run cargo testand all tests pass;
  • linked to the originating issue (if applicable).

@MatteoNardi MatteoNardi linked an issue Feb 10, 2023 that may be closed by this pull request
@MatteoNardi MatteoNardi force-pushed the 155-improve-lsm-support-autodetection branch from c626318 to cef5533 Compare February 10, 2023 16:06
The new global setting `lsm_support` allows to skip LSM support autodetection.
The valid values are 'autodetect', 'true', 'false'. By default we try
to autodetect.
@MatteoNardi MatteoNardi force-pushed the 155-improve-lsm-support-autodetection branch from b96280c to 8f861c6 Compare February 17, 2023 09:58
@MatteoNardi
Copy link
Contributor Author

I advise to review commit by commit since the first one contains a lot of moved files.

A few notes:

  • I haven't added a CLI option in test-suite to override LSM autodetection. Since libtest_mimic does its own arguments parsing and it's a feature we don't really need, I don't think the extra complexity is justified.
  • The test-suite needs a blocking version of lsm_supported() so in async contexts I've wrapped it with spawn_blocking. Maybe I could have exposed two functions pub lsm_supported() and pub blocking_lsm_supported()

@MatteoNardi MatteoNardi marked this pull request as ready for review February 17, 2023 10:06
Copy link
Member

@banditopazzo banditopazzo left a comment

Choose a reason for hiding this comment

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

apart few minor things looks good to me

examples/pulsar-module-as-library/main.rs Outdated Show resolved Hide resolved
src/bin/probe.rs Outdated Show resolved Hide resolved
src/pulsard/daemon.rs Outdated Show resolved Hide resolved
@MatteoNardi MatteoNardi merged commit 30b5d85 into main Feb 21, 2023
@MatteoNardi MatteoNardi deleted the 155-improve-lsm-support-autodetection branch February 21, 2023 15:05
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.

Improve LSM-support autodetection
2 participants