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

Fix attachment/listing of wildcarded module kfuncs #2914

Merged
merged 1 commit into from
Jan 15, 2024

Conversation

viktormalik
Copy link
Contributor

@viktormalik viktormalik commented Jan 11, 2024

Attachment to e.g. all functions in a module is broken:

# bpftrace -e 'kfunc:nvme:*' { @[func] = count() }
No probes to attach

This fixes the bug causing the above problem:

# bpftrace -e 'kfunc:nvme:*' { @[func] = count() }
Attaching 65 probes...
[...]

Also adds a runtime tests to check for future regressions.

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

src/driver.cpp Outdated Show resolved Hide resolved
Attachment to e.g. all functions in a module is broken:

    # bpftrace -e 'kfunc:nvme:*' { @[func] = count() }
    No probes to attach

This fixes the bug causing the above problem:

    # bpftrace -e 'kfunc:nvme:*' { @[func] = count() }
    Attaching 65 probes...
    [...]

Also adds a runtime tests to check for future regressions.
@@ -45,6 +45,16 @@ REQUIRES lsmod | grep '^nf_tables'
REQUIRES /usr/sbin/nft --help
CLEANUP nft delete table bpftrace

NAME kernel_module_attach_wildcard
Copy link
Member

Choose a reason for hiding this comment

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

Would be neat to have a NEW_NETNS runtime test directive to provide a little more isolation. But not needed for now

@danobi danobi merged commit dac8c30 into bpftrace:master Jan 15, 2024
19 checks passed
@viktormalik viktormalik deleted the kfunc-mod-fix branch January 22, 2024 07:21
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.

3 participants