Skip to content

perf.NewReader just hangs if perCPUBuffer is too small #561

Answered by lmb
psanford asked this question in Q&A
Discussion options

You must be logged in to vote

A perf ring has no "inherent sample size", you can submit samples of variable length to it if you want. Therefore the perf reader can't know whether 4096 is enough for your needs or not.

I think if you check the return code from bpf_perf_event_output you'll see that it returns an error because the sample was too big. You may also be able to check https://pkg.go.dev/github.com/cilium/ebpf/perf#Record LostSamples but I haven't validated that.

Replies: 1 comment 12 replies

Comment options

You must be logged in to vote
12 replies
@florianl
Comment options

@brycekahle
Comment options

@brycekahle
Comment options

@asdfsx
Comment options

@florianl
Comment options

Answer selected by ti-mo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
5 participants
Converted from issue

This discussion was converted from issue #559 on February 07, 2022 12:05.