-
Notifications
You must be signed in to change notification settings - Fork 695
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
elf: Add support for map struct typedef #1125
Conversation
e7778b1
to
36e1eb1
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this work with libbpf
?
elf_reader.go
Outdated
@@ -750,7 +750,12 @@ func (ec *elfCode) loadBTFMaps() error { | |||
// Each Var representing a BTF map definition contains a Struct. | |||
mapStruct, ok := v.Type.(*btf.Struct) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think using https://pkg.go.dev/github.com/cilium/ebpf/btf#UnderlyingType here is more appropriate.
Yes, typedefs are used in some tracee ebpf code places. It uses libbpf and libbpfgo cgo wrapper. It's great that this was the only needed change to migrate such large ebpf code base to cilium/ebpf. |
I forgot: can you add a test in |
16841c3
to
ee441ef
Compare
Accept typedef'd structs in addition to regular anonymous structs. Fixes cilium#1126 Signed-off-by: anjmao <andzej@cast.ai>
Signed-off-by: Lorenz Bauer <lmb@isovalent.com>
Fixes #1126