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

Tool fixes for new kernels #2136

Merged
merged 5 commits into from
Feb 22, 2022
Merged

Tool fixes for new kernels #2136

merged 5 commits into from
Feb 22, 2022

Conversation

viktormalik
Copy link
Contributor

Provides fixes to several tools that got broken with newer kernels. Resolves #2128.

List of changes:

Checklist
  • Language changes are updated in man/adoc/bpftrace.adoc and if needed in docs/reference_guide.md
  • User-visible and non-trivial changes updated in CHANGELOG.md
  • The new behaviour is covered by tests

Kernel 5.16 contains commit:

    torvalds/linux@be6bfe3

which renamed some of the functions that the bio* tools attach to.
tcpdrop.bt attaches to kprobe:tcp_drop which is likely inlined on newer
kernels and cannot be replaced by anything else. The script will not
work on such kernels.
Many of the tools rely on kprobes and internal kernel structs which are
not stable. This means that tools may break with newer kernel versions
and bpftrace syntax does not always allow to support all kernels within
a single script.

This introduces a new directory tools/old/ which will contain versions
of tools for older kernels.

Since the container images used in CI may require some of the old tool
versions, this also introduces a new env variable TOOLS_TEST_OLDVERSION
which makes tools-parsing-test.sh use old versions of chosen tools.
Since Linux 5.12, accessing gendisk from struct bio requires an extra
field access. tools/mdflush.bt now contains the new version while the
old version (for Linux <= 5.12) is moved to tools/old.
@fbs fbs merged commit 911f461 into bpftrace:master Feb 22, 2022
@viktormalik viktormalik deleted the tools-fixes branch May 3, 2022 04:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants