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

btf: Add spec types iterator #678

Merged
merged 1 commit into from May 23, 2022
Merged

Conversation

brb
Copy link
Member

@brb brb commented May 18, 2022

This commit introduces the TypesIterator which is used to iterate over all types of a given spec.

One notable user is "pwru" [1] which needs to iterate over all vmlinux BTF types to find functions which accept SKB as a param.

The iterator is very similar to the existing InstructionIterator, as both export the Next() method and set the values and indices in the public fields.

[1]: https://github.com/cilium/pwru

@lmb lmb self-requested a review May 21, 2022 09:57
@brb
Copy link
Member Author

brb commented May 23, 2022

Not sure what went wrong with the Run unit tests - KERNEL_VERSION=5.15 - failing to fetch logs.

btf/btf.go Outdated Show resolved Hide resolved
@brb brb force-pushed the pr/brb/spec-types-iterator branch from cce6ff9 to e37797f Compare May 23, 2022 09:04
@brb brb requested a review from tklauser May 23, 2022 09:04
btf/btf.go Outdated Show resolved Hide resolved
btf/btf.go Outdated Show resolved Hide resolved
This commit introduces the TypesIterator which is used to iterate over
all types of a given spec.

One notable user is "pwru" [1] which needs to iterate over all vmlinux
BTF types to find functions which accept SKB as a param.

The iterator is very similar to the existing InstructionIterator, as
both export the Next() method and set the values and indices in the
public fields.

[1]: https://github.com/cilium/pwru

Suggested-by: Timo Beckers <timo@isovalent.com>
Signed-off-by: Martynas Pumputis <m@lambda.lt>
@brb brb force-pushed the pr/brb/spec-types-iterator branch from e37797f to 5618ccb Compare May 23, 2022 11:10
@brb brb requested a review from lmb May 23, 2022 11:10
Copy link
Collaborator

@lmb lmb left a comment

Choose a reason for hiding this comment

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

Thanks!

@lmb lmb merged commit c4f6259 into cilium:master May 23, 2022
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

3 participants