Re: perf_event_open.2: mmap ring buffer requirement for receiving overflow notifications

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Namhyung,

On Mon, Nov 25, 2024 at 09:42:54PM -0800, Namhyung Kim wrote:
> Thanks for the report and the test code.  I agree that the current man
> page is a little confusing about the overflow notification.  I can see
> the following sentences in the "overflow handling" section.
> 
>   There are two ways to generate overflow notifications.
> 
>   The  first is to set a wakeup_events or wakeup_watermark value that
>   will trigger if a certain number of samples or bytes have been
>   written to the mmap ring buffer.  In this case, POLL_IN is indicated.
> 
>   The other way is by use of the PERF_EVENT_IOC_REFRESH ioctl.  This
>   ioctl adds to a counter that decrements each  time  the  event
>   overflows.  When nonzero, POLL_IN is indicated, but once the counter
>   reaches 0 POLL_HUP is indicated and the underlying event is disabled.
> 
> I think the first and the default way uses the ring buffer to determine
> overflow condition so it should be allocated before calling poll(2) or
> similar.  The second way doesn't seem to require ring buffers, but I
> haven't tested it actually.
> 
> Maybe we can add something like this to the first section:
> 
>   If the ring buffer is not allocated, POLL_HUP is indicated.

Thanks!  Would you mind sending a patch?

Have a lovely day!
Alex

-- 
<https://www.alejandro-colomar.es/>

Attachment: signature.asc
Description: PGP signature


[Index of Archives]     [Kernel Documentation]     [Netdev]     [Linux Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux