Id like to create an EBPF program for Golang that records when a function is entered and returns.
Some issues I have:
- A. Functions are inlined.
- B. Closures are anonymous.
- C. Reading Golang structs.
Questions:
A.
In my case its not possible to prevent function inlining with go build -gcflags '-l
.
If I could identify the instruction of the inlined function in the binary could I place a probe on it (instead of "place probe on function X" can I tell EBPF to "place probe at instruction X"?).
B.
Can I do the same with anonymous closures?
C.
How do I read Golang structs in an EBPF C program?
I want to extract scalar values that belong to a struct hierarchy. The examples I can find all probe functions that take scalars not structs as their args.
Related
- failing to attach eBPF `kretprobes` to `napi_poll()` with bcc tools
- http://www.brendangregg.com/blog/2017-01-31/golang-bcc-bpf-function-tracing.html
Thanks.