Skip to content

Commit 50190ae

Browse files
committed
pagemap-cache: add an ability to run tests without PAGEMAP_SCAN
This change adds a new injectable fault (135) to disable PAGEMAP_SCAN and fault back to read pagemap files. Signed-off-by: Andrei Vagin <[email protected]>
1 parent bfa9428 commit 50190ae

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

criu/include/fault-injection.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ enum faults {
1919
FI_HUGE_ANON_SHMEM_ID = 132,
2020
FI_CANNOT_MAP_VDSO = 133,
2121
FI_CORRUPT_EXTREGS = 134,
22+
FI_DONT_USE_PAGEMAP_SCAN = 135,
2223
FI_MAX,
2324
};
2425

criu/pagemap-cache.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
#include "vma.h"
1212
#include "mem.h"
1313
#include "kerndat.h"
14+
#include "fault-injection.h"
1415

1516
#undef LOG_PREFIX
1617
#define LOG_PREFIX "pagemap-cache: "
@@ -61,7 +62,7 @@ int pmc_init(pmc_t *pmc, pid_t pid, const struct list_head *vma_head, size_t siz
6162
pmc->regs = NULL;
6263
pmc->map = NULL;
6364

64-
if (kdat.has_pagemap_scan) {
65+
if (kdat.has_pagemap_scan && !fault_injected(FI_DONT_USE_PAGEMAP_SCAN)) {
6566
pmc->regs = xmalloc(pmc->regs_max_len * sizeof(struct page_region));
6667
if (!pmc->regs)
6768
goto err;

0 commit comments

Comments
 (0)