ANDROID: 16K: Fixup perf_mmap check for metadata page
perf_mmap() expects a power of 2 number of pages plus 1 additional page.
In the emulated __PAGE_SIZE case, the one extra page is actually
(__PAGE_SIZE / PAGE_SIZE) number of 4KiB pages in the kernel.
See MMAP layout in perf_event_open():
The mmap size should be 1+2^n pages, where the first page is a
metadata page (struct perf_event_mmap_page) that contains various
bits of information such as where the ring-buffer head is. [1]
Also update perf_event_mmap_kb's default value to reflect this;
i.e 512KiB + sizeof 1 page in KiB (__PAGE_SIZE/1024)
[1] https://man7.org/linux/man-pages/man2/perf_event_open.2.html
Bug: 366098040
Test: atest vts_ltp_test_x86_64
Change-Id: I475e3c9ed896d8e3735681b1143e31c62ed20359
Signed-off-by:
Kalesh Singh <kaleshsingh@google.com>
Loading
Please sign in to comment