-
Hi masters, I want to pprof my prog by ebpf, so I need to call the interface But cilium/ebpf seems not to implement the interface. Is it that I did not find this method? Or is there another way to achieve my goal? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Hi @Jun10ng In general If you check out github.com/cilium/ebpf/link you will notice, the package A different part of the Here I'm providing a minimal example of setting up a sample based profiling. |
Beta Was this translation helpful? Give feedback.
Hi @Jun10ng
In general
ebpf
andperf
are two very different subsystem of the Linux Kernel. And as far as I can tell, libbpf only provides a very limited part of theperf
subsystem to use withebpf
.If you check out github.com/cilium/ebpf/link you will notice, the package
link
make use ofperf
elements for its use inTracepoint
s andKprobe
s. This approaches are event based. So your eBPF program will only be triggered if the tracepoint or kprobe is used.A different part of the
perf
subsystem is based on sampling. And I think you might look for a solution in this space. Implementing a more wider spectrum of theperf
Kernel subsystem in Go is quite complex. But there are packages like github…