|
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? |
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. |
Hi @Jun10ng
In general
ebpfandperfare two very different subsystem of the Linux Kernel. And as far as I can tell, libbpf only provides a very limited part of theperfsubsystem to use withebpf.If you check out github.com/cilium/ebpf/link you will notice, the package
linkmake use ofperfelements for its use inTracepoints andKprobes. 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
perfsubsystem is based on sampling. And I think you might look for a solution in this space. Implementing a more wider spectrum of theperfKernel subsystem in Go is quite complex. But there are packages like github…