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

Export package btf #665

Merged
merged 3 commits into from
May 11, 2022
Merged

Export package btf #665

merged 3 commits into from
May 11, 2022

Conversation

lmb
Copy link
Collaborator

@lmb lmb commented May 9, 2022

This can go in after #660 is merged.

program: make ProgramOptions.TargetBTF a *btf.Spec

Make users pass a *btf.Spec directly if they want to specify a
custom target. This allows reusing a single spec between multiple
program loads without re-parsing the BTF.

Add LoadSpec as a convenience to read BTF from a file on disk.

Fixes #550

btf: export package

@lmb lmb force-pushed the export-btf branch 2 times, most recently from 238b360 to 1877f85 Compare May 10, 2022 07:18
@ti-mo ti-mo self-requested a review May 10, 2022 14:56
@lmb lmb force-pushed the export-btf branch 5 times, most recently from ba45536 to c0889ba Compare May 11, 2022 11:20
@lmb lmb marked this pull request as ready for review May 11, 2022 11:24
lmb added 3 commits May 11, 2022 14:27
Make users pass a *btf.Spec directly if they want to specify a
custom target. This allows reusing a single spec between multiple
program loads without re-parsing the BTF.

Add LoadSpec as a convenience to read BTF from a file on disk.

Fixes cilium#550
Setting ProgramSpec.AttachTarget indicates that the program we're
about to load references another program, for example when using
freplace to hotpatch a function in a program.

The code path which takes care of this is currently intertwined
with the support for attaching to a type or function in the kernel,
which happens via ProgramSpec.AttachTo. This makes it hard to follow
what is going on.

Split out the two paths to make it clearer what is going on.
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.

1 participant