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 fentry example #482

Merged
merged 4 commits into from
Nov 23, 2021
Merged

Add fentry example #482

merged 4 commits into from
Nov 23, 2021

Conversation

mehrdadrad
Copy link
Contributor

@mehrdadrad mehrdadrad commented Nov 11, 2021

This example demonstrates attaching a fentry eBPF program to tcp_connect (bpf2go).

@ti-mo ti-mo requested review from lmb and ti-mo November 18, 2021 12:44
Copy link
Collaborator

@ti-mo ti-mo left a comment

Choose a reason for hiding this comment

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

Thank you! I've reorganized your commits and applied a few changes, please pull your branch again to build on top.

I have a few nits around handling endianness and the use of bytes.Buffer.

examples/fentry/main.go Outdated Show resolved Hide resolved
examples/fentry/bpf/fentry_example.c Outdated Show resolved Hide resolved
mehrdadrad and others added 4 commits November 23, 2021 22:41
Signed-off-by: Timo Beckers <timo@isovalent.com>
Signed-off-by: Timo Beckers <timo@isovalent.com>
No longer allocates an Event on each unmarshal, no use of binary.Read()
or bytes.Reader.

Signed-off-by: Timo Beckers <timo@isovalent.com>
Copy link
Collaborator

@ti-mo ti-mo left a comment

Choose a reason for hiding this comment

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

Thanks!

@ti-mo ti-mo merged commit a0969f2 into cilium:master Nov 23, 2021
@mosajjal
Copy link

mosajjal commented Dec 6, 2021

any suggestions around the "github.com/cilium/ebpf/internal" dependency issue? the package is only used for the NativeEndian function. not sure how to bring this tiny function inside the code itself without the unsafe dependency though

@lmb
Copy link
Collaborator

lmb commented Dec 6, 2021

I'm assuming you want to copy the example elsewhere and modify it? I'd suggest just copying the NativeEndian declaration for now as well.

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.

None yet

4 participants