blob: ddd135fa3af70d66228a05110babbe3c60b4e8be [file] [log] [blame]
Matthew Wilcox5eeb2d22016-12-24 07:49:18 -05001#ifndef _TEST_RADIX_TREE_H
2#define _TEST_RADIX_TREE_H
Matthew Wilcox1366c372016-03-17 14:21:45 -07003#include "../../../../include/linux/radix-tree.h"
Matthew Wilcox5eeb2d22016-12-24 07:49:18 -05004
5extern int kmalloc_verbose;
Rehas Sachdeva73bc0292017-01-04 11:55:00 -05006extern int test_verbose;
Matthew Wilcox5eeb2d22016-12-24 07:49:18 -05007
8static inline void trace_call_rcu(struct rcu_head *head,
9 void (*func)(struct rcu_head *head))
10{
11 if (kmalloc_verbose)
12 printf("Delaying free of %p to slab\n", (char *)head -
13 offsetof(struct radix_tree_node, rcu_head));
14 call_rcu(head, func);
15}
Rehas Sachdeva73bc0292017-01-04 11:55:00 -050016
17#define printv(verbosity_level, fmt, ...) \
18 if(test_verbose >= verbosity_level) \
19 printf(fmt, ##__VA_ARGS__)
20
Matthew Wilcox5eeb2d22016-12-24 07:49:18 -050021#undef call_rcu
22#define call_rcu(x, y) trace_call_rcu(x, y)
23
24#endif /* _TEST_RADIX_TREE_H */