Commit e5969329 authored by Kalesh Singh's avatar Kalesh Singh
Browse files

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: default avatarKalesh Singh <kaleshsingh@google.com>
parent 04c1f69d
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment