1 /* SPDX-License-Identifier: (GPL-2.0 or LGPL-2.1)
5 * wrapper around get_pfnblock_flags_mask. Using KALLSYMS to get its address
6 * when available, else we need to have a kernel that exports this function to
9 * Copyright (C) 2015 Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
12 #ifndef _LTTNG_WRAPPER_PAGE_ALLOC_H
13 #define _LTTNG_WRAPPER_PAGE_ALLOC_H
15 #include <lttng-kernel-version.h>
18 * We need to redefine get_pfnblock_flags_mask to our wrapper, because
19 * the get_pageblock_migratetype() macro uses it.
21 #if (defined(CONFIG_KALLSYMS) \
22 && (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,19,2) \
23 || LTTNG_KERNEL_RANGE(3,14,36, 3,15,0) \
24 || LTTNG_KERNEL_RANGE(3,18,10, 3,19,0) \
25 || LTTNG_DEBIAN_KERNEL_RANGE(3,16,7,9,0,0, 3,17,0,0,0,0) \
26 || LTTNG_UBUNTU_KERNEL_RANGE(3,16,7,34, 3,17,0,0)))
28 #define get_pfnblock_flags_mask wrapper_get_pfnblock_flags_mask
30 #include <linux/mm_types.h>
32 int wrapper_get_pfnblock_flags_mask_init(void);
36 #include <linux/mm_types.h>
39 int wrapper_get_pfnblock_flags_mask_init(void)
47 * For a specific range of Ubuntu 3.13 kernels, we need to redefine
48 * get_pageblock_flags_mask to our wrapper, because the
49 * get_pageblock_migratetype() macro uses it. This function has been
50 * introduced into mainline within commit
51 * e58469bafd0524e848c3733bc3918d854595e20f, but never actually showed
52 * up in a stable kernel version, since it has been changed by commit
53 * dc4b0caff24d9b2918e9f27bc65499ee63187eba. Since Ubuntu chose to only
54 * backport the former commit but not the latter, we need to do a
55 * special case to cover this.
57 #if (defined(CONFIG_KALLSYMS) \
58 && LTTNG_UBUNTU_KERNEL_RANGE(3,13,11,50, 3,14,0,0))
60 #define get_pageblock_flags_mask wrapper_get_pageblock_flags_mask
62 #include <linux/mm_types.h>
64 int wrapper_get_pageblock_flags_mask_init(void);
68 #include <linux/mm_types.h>
71 int wrapper_get_pageblock_flags_mask_init(void)
78 #endif /* _LTTNG_WRAPPER_PAGE_ALLOC_H */
This page took 0.031643 seconds and 4 git commands to generate.