mirror of
git://git.yoctoproject.org/linux-yocto.git
synced 2025-08-21 16:31:14 +02:00

The core components contained within the radix-tree tests which provide shims for kernel headers and access to the maple tree are useful for testing other things, so separate them out and make the radix tree tests dependent on the shared components. This lays the groundwork for us to add VMA tests of the newly introduced vma.c file. Link: https://lkml.kernel.org/r/1ee720c265808168e0d75608e687607d77c36719.1722251717.git.lorenzo.stoakes@oracle.com Signed-off-by: Lorenzo Stoakes <lorenzo.stoakes@oracle.com> Acked-by: Vlastimil Babka <vbabka@suse.cz> Reviewed-by: Liam R. Howlett <Liam.Howlett@oracle.com> Cc: Alexander Viro <viro@zeniv.linux.org.uk> Cc: Brendan Higgins <brendanhiggins@google.com> Cc: Christian Brauner <brauner@kernel.org> Cc: David Gow <davidgow@google.com> Cc: Eric W. Biederman <ebiederm@xmission.com> Cc: Jan Kara <jack@suse.cz> Cc: Kees Cook <kees@kernel.org> Cc: Matthew Wilcox (Oracle) <willy@infradead.org> Cc: Rae Moar <rmoar@google.com> Cc: SeongJae Park <sj@kernel.org> Cc: Shuah Khan <shuah@kernel.org> Cc: Suren Baghdasaryan <surenb@google.com> Cc: Pengfei Xu <pengfei.xu@intel.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
27 lines
657 B
C
27 lines
657 B
C
/* SPDX-License-Identifier: GPL-2.0 */
|
|
#ifndef _TEST_RADIX_TREE_H
|
|
#define _TEST_RADIX_TREE_H
|
|
|
|
#include "../../../../include/linux/radix-tree.h"
|
|
|
|
extern int kmalloc_verbose;
|
|
extern int test_verbose;
|
|
|
|
static inline void trace_call_rcu(struct rcu_head *head,
|
|
void (*func)(struct rcu_head *head))
|
|
{
|
|
if (kmalloc_verbose)
|
|
printf("Delaying free of %p to slab\n", (char *)head -
|
|
offsetof(struct radix_tree_node, rcu_head));
|
|
call_rcu(head, func);
|
|
}
|
|
|
|
#define printv(verbosity_level, fmt, ...) \
|
|
if(test_verbose >= verbosity_level) \
|
|
printf(fmt, ##__VA_ARGS__)
|
|
|
|
#undef call_rcu
|
|
#define call_rcu(x, y) trace_call_rcu(x, y)
|
|
|
|
#endif /* _TEST_RADIX_TREE_H */
|