tools/testing: add PROCMAP_QUERY helper functions in mm self tests
authorLorenzo Stoakes <lorenzo.stoakes@oracle.com>
Tue, 8 Apr 2025 09:29:32 +0000 (10:29 +0100)
committerAndrew Morton <akpm@linux-foundation.org>
Mon, 12 May 2025 00:48:26 +0000 (17:48 -0700)
commitbd23f293a0d56fd18d51e5364ecf8c277c6e9531
tree6021a8a8ebe0afb0a37aa6d2330a4fc224f877bd
parent879bca0a2c4f40b08d09a95a2a0c3c6513060b5c
tools/testing: add PROCMAP_QUERY helper functions in mm self tests

The PROCMAP_QUERY ioctl() is very useful - it allows for binary access to
/proc/$pid/[s]maps data and thus convenient lookup of data contained
there.

This patch exposes this for convenient use by mm self tests so the state
of VMAs can easily be queried.

Link: https://lkml.kernel.org/r/ce83d877093d1fc594762cf4b82f0c27963030ee.1744104124.git.lorenzo.stoakes@oracle.com
Signed-off-by: Lorenzo Stoakes <lorenzo.stoakes@oracle.com>
Reviewed-by: Yeoreum Yun <yeoreum.yun@arm.com>
Reviewed-by: Wei Yang <richard.weiyang@gmail.com>
Cc: David Hildenbrand <david@redhat.com>
Cc: Jann Horn <jannh@google.com>
Cc: Liam Howlett <liam.howlett@oracle.com>
Cc: Matthew Wilcox (Oracle) <willy@infradead.org>
Cc: Rik van Riel <riel@surriel.com>
Cc: Suren Baghdasaryan <surenb@google.com>
Cc: Vlastimil Babka <vbabka@suse.cz>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
tools/testing/selftests/mm/vm_util.c
tools/testing/selftests/mm/vm_util.h