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

add support for kprobe session #1623

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

Conversation

olsajiri
Copy link
Contributor

@olsajiri olsajiri commented Dec 10, 2024

kprobe session support plus 6.11 kernel update

@olsajiri olsajiri requested review from ti-mo, dylandreimerink and a team as code owners December 10, 2024 14:24
curl -fL "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/plain/tools/lib/bpf/libbpf.c?h=v$KERNEL_VERSION" -o "$tmp/libbpf.c"
if [ -d $KERNEL_VERSION ]; then
# Copy libbpf/vmlinux/bpf_testmod from local directory
cp $KERNEL_VERSION/libbpf.c $tmp
Copy link
Collaborator

Choose a reason for hiding this comment

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

Are these paths correct? ie. libbpf typically sits in tools/lib/bpf/libbpf.c. Do you copy it there manually?

Same for bpf_testmod.ko, isn't it somewhere in selftests?

Asking because I'd like to use it too, would be nice if this works on a default Linux tree.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

sorry I meant to create draft ;-) I'm including this branch in tetragon to enable and use kprobe.session programs
and then I wanted to do the official 6.11 interface update if you wouldn't beat me to it

I'm using the that KERNEL_VERSION change to use my kernel with changed interface for testing
and I usually do not have the kernel tree on the same machine so I just copy those files in the
directory and feed it to update-kernel-deps.sh script

I'm not clear on how you guys add the new ci kernel though.. but I can find out ;-)

Copy link
Collaborator

Choose a reason for hiding this comment

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

I'm using the that KERNEL_VERSION change to use my kernel with changed interface for testing and I usually do not have the kernel tree on the same machine so I just copy those files in the directory and feed it to update-kernel-deps.sh script

I see. In that case, would you be willing to adjust your workflow to mount the tree locally, e.g. using sshfs and running the script against the mount? I think most folks would iterate using virtme locally, so this could still be useful for them.

I'm not clear on how you guys add the new ci kernel though.. but I can find out ;-)

Images are built and published by https://github.com/cilium/ci-kernels. rc's are pulled from Linus' tree, mainline is pulled from kernel.org (see https://github.com/cilium/ci-kernels/blob/main/download.sh). No bpf-next currently, maybe we can consider this at some point. (so you'll have to wait for an rc at least 😄)

@ti-mo ti-mo changed the title Session update-kernel-deps: fetch objects from local Linux checkout Dec 10, 2024
@olsajiri olsajiri marked this pull request as draft December 10, 2024 19:46
@olsajiri olsajiri changed the title update-kernel-deps: fetch objects from local Linux checkout add support for kprobe session Dec 29, 2024
@olsajiri olsajiri force-pushed the session branch 2 times, most recently from 2a2f948 to d02c6b1 Compare December 29, 2024 10:35
Signed-off-by: Jiri Olsa <[email protected]>
Adding support to attach kprobe multi link as session by adding
Session bool to KprobeMultiOptions. When set true it attaches the
link with BPF_TRACE_KPROBE_SESSION attach_type.

Signed-off-by: Jiri Olsa <[email protected]>
@olsajiri olsajiri marked this pull request as ready for review December 29, 2024 11:15
@olsajiri olsajiri requested a review from mmat11 as a code owner December 29, 2024 11:15
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