bcc icon indicating copy to clipboard operation
bcc copied to clipboard

BPF.ring_buffer_poll(timeout=T) documentation ambigious

Open AITleo opened this issue 8 months ago • 2 comments

The documentation about the timeout for BPF.ring_buffer_poll(timeout=T) is unclear. At least for me.

It states:

The timeout parameter is optional and measured in milliseconds. In its absence, polling continues until there is no more data or the callback returns a negative value.

From reading this I get an understanding, that if there is no timeout specified and no data available in the ringbuffer (yet), the function would not block but return immediately.

My experiments on the other hand show that it does block indefinitely and waits for data.

For my use case supplying a timeout fixes the problem, but may I suggest to be more precise in the documentation?

I am talking about this line here.

AITleo avatar Jun 18 '24 12:06 AITleo