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

Update libbpf to v1.0.0 #216

Merged
merged 1 commit into from Aug 26, 2022
Merged

Conversation

saschagrunert
Copy link
Contributor

Updates libbpf to the latest release: https://github.com/libbpf/libbpf/releases/tag/v1.0.0

@saschagrunert saschagrunert force-pushed the libbpf-1.0.0 branch 12 times, most recently from 0443742 to e285a0b Compare August 23, 2022 08:55
@saschagrunert saschagrunert changed the title WIP: Update libbpf to v1.0.0 Update libbpf to v1.0.0 Aug 23, 2022
@javierhonduco
Copy link
Contributor

This is great! Just as a reminder for folks migrating their application to libbpf v1, the strict mode API we added in #160 can be very useful to ensure a smooth transition

@grantseltzer
Copy link
Contributor

Thanks @saschagrunert ! I'm really excited for this, hoping to have time to review and merge this by EOD tomorrow and a new release sometime next week once we're sure we've removed everything that's deprecated and firmly standardized error checking the way 1.0 does it.

I'll also share publicly our roadmap towards libbpfgo 1.0 which will certainly have to include a full implementation of the libbpf API. I gotta setup a public office hours so we (all contributors/maintainers) can discuss that and other exciting things we can do such as being part of the libbpf project more officially. Will keep you posted!

@rafaeldtinoco
Copy link
Contributor

I gotta setup a public office hours so we (all contributors/maintainers) can discuss that and other exciting things we can do such as being part of the libbpf project more officially. Will keep you posted!

And things that don't need documentation can also be discussed in Slack (#libbpfgo), as long as we also keep track of things in github (Always).

@kakkoyun
Copy link
Contributor

I'll also share publicly our roadmap towards libbpfgo 1.0 which will certainly have to include a full implementation of the libbpf API.

As Parca Agent maintainers, we would be more than happy to give a hand on this effort.

I gotta setup a public office hours so we (all contributors/maintainers) can discuss that and other exciting things we can do such as being part of the libbpf project more officially.

❤️ It will be amazing to have office hours!

@grantseltzer
Copy link
Contributor

I'm presently going through libbpfgo to make sure we're not using any now removed APIs and are handling errors correctly. There's also a bunch of new APIs and things that we can do differently in 1.0 that'll i'm going to be creating issues for but won't hold up this PR (but will be before the next libbpfgo release).

@grantseltzer
Copy link
Contributor

I'll also share publicly our roadmap towards libbpfgo 1.0 which will certainly have to include a full implementation of the libbpf API.

As Parca Agent maintainers, we would be more than happy to give a hand on this effort.

❤️

I gotta setup a public office hours so we (all contributors/maintainers) can discuss that and other exciting things we can do such as being part of the libbpf project more officially.

heart It will be amazing to have office hours!

Will let you know very soon!

@grantseltzer
Copy link
Contributor

Alright I've opened #225 which we'll merge at the same time as this one. For some reason github doesn't let me tag people out of the aqua org for review but @kakkoyun @javierhonduco @saschagrunert your feedback is always greatly appreciated!

@@ -1031,7 +1031,7 @@ func (it *BPFMapIterator) Next() bool {
nextPtr := unsafe.Pointer(&next[0])

errC, err := C.bpf_map_get_next_key(it.b.fd, prevPtr, nextPtr)
if errno, ok := err.(syscall.Errno); errC == -1 && ok && errno == C.ENOENT {
if errno, ok := err.(syscall.Errno); errC == -2 && ok && errno == C.ENOENT {
Copy link
Contributor

Choose a reason for hiding this comment

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

Why is this?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That's the return code for the function call, the iterator test failed because of this change.

Copy link
Contributor

Choose a reason for hiding this comment

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

Got it! I see now. i guess it's redundant to check errno == C.ENOENT and errC = -2. Do you think we should simplify to just the following?:

Suggested change
if errno, ok := err.(syscall.Errno); errC == -2 && ok && errno == C.ENOENT {
if errC == -2 {

Copy link
Contributor

Choose a reason for hiding this comment

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

This is actually outside the scope of this PR, so I'd say leave it for now and we can reassess before the next release

selftest/cgroup/main.bpf.c Show resolved Hide resolved
selftest/iterators/main.go Outdated Show resolved Hide resolved
Updates libbpf to the latest release:
https://github.com/libbpf/libbpf/releases/tag/v1.0.0

Signed-off-by: Sascha Grunert <sgrunert@redhat.com>
Copy link
Contributor

@grantseltzer grantseltzer left a comment

Choose a reason for hiding this comment

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

Let's do this!

@grantseltzer grantseltzer merged commit b4fab9e into aquasecurity:main Aug 26, 2022
@grantseltzer
Copy link
Contributor

Thanks again @saschagrunert, Ill be looking to cut a release by middle of next week.

@saschagrunert saschagrunert deleted the libbpf-1.0.0 branch August 26, 2022 17:07
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

5 participants