Add support to retrieve missed counts from probes#1295
Conversation
70e2c60 to
772a299
Compare
772a299 to
682ab7b
Compare
118316b to
ecb4d92
Compare
ecb4d92 to
76bbea8
Compare
76bbea8 to
6c7b356
Compare
447e99d to
e84d2f0
Compare
rgo3
left a comment
There was a problem hiding this comment.
I've reviewed this PR with Lorenz yesterday and we concluded that we might need to figure out a better way of dealing with the bpf_link_info UAPI in ebpf-go before your proposed changes can be implemented. I've pointed out two specific problems in the PR where we hope a better UAPI representation will enable better solutions to retrieve and write metadata on LinkInfo objects. Lorenz and I will spend an hour today to see what we can come up with.
|
I will spend some more time next week to work on the ideas Lorenz had to change how ebpf-go represents the |
sounds great, please let me know if I can help in any way |
850d561 to
53e95f9
Compare
|
@lmb @rgo3 hey guys, could you plz check on the new changes? |
lmb
left a comment
There was a problem hiding this comment.
I pushed some fixups in order to get this merged quickly. Main changes:
- We can't just return ErrNotSupported. Instead I added getters on
KprobeInfowhich allow the caller to detect whether we could get the info from the kernel. This is howMapInfoandProgramInfowork already. - Add
sys.PerfEventLinkInfoand clean up usage. Yes, another syscall. I've outlined the way to fix this in Robin's last PR. The current approach is cheating and will have to change as soon as the next perf event info thingie lands.
Please take a look, and let me know whether you're OK with dropping exporting the new constants from package link.
de6a6bc to
c677521
Compare
|
@olsajiri good to go? |
|
@lmb yes, I have tetragon changes on top of this and it looks good, so looks good to me |
Generate needs link info structures and related PerfEventType enum to retrieve kprobe info data from both perf event kprobe and kprobe multi. Signed-off-by: Lorenz Bauer <[email protected]> Signed-off-by: Jiri Olsa <[email protected]>
Implementing Info function (Link interface) for kprobe multi link, it's now possibe to retrieve link's info data with: kmulti := info.KprobeMulti() addresses, ok := kmulti.Addresses() flags, ok = kmulti.Flags() missed, ok = kmulti.Missed() At the moment we support/return only Count/Flags/Missed data returned by Addresses/Flags/Missed KprobeMultiInfo methods respectively. Signed-off-by: Lorenz Bauer <[email protected]> Signed-off-by: Jiri Olsa <[email protected]>
Implementing Info function (Link interface) for perf event
kprobe link, it's now possibe to retrieve link's data with:
pevent := info.PerfEvent()
switch pevent.Type {
case unix.BPF_PERF_EVENT_KPROBE, unix.BPF_PERF_EVENT_KRETPROBE:
kp := pevent.Kprobe()
addr, ok := kp.Address()
addr, ok := kp.Flags()
missed, ok := kp.Missed()
}
At the moment we support/return only Addr/Flags/Missed data
returned by Address/Flags/Missed KprobeMultiInfo methods
respectively.
Signed-off-by: Jiri Olsa <[email protected]>
lmb
left a comment
There was a problem hiding this comment.
Renamed MultiInfo.Addresses to MultiInfo.AddressCount.
adding support to get info data from kprobe_multi/perf_events probes, using it in tetragon 1941