blob: d1635a5bef021fe354a607ec6c2ab6582992e1a3 [file] [log] [blame]
Greg Kroah-Hartmanb2441312017-11-01 15:07:57 +01001/* SPDX-License-Identifier: GPL-2.0 */
Matthew Wilcox5eeb2d22016-12-24 07:49:18 -05002#ifndef _TEST_RADIX_TREE_H
3#define _TEST_RADIX_TREE_H
Rehas Sachdevac6ce3e22017-02-13 16:16:03 -05004
Matthew Wilcox1366c372016-03-17 14:21:45 -07005#include "../../../../include/linux/radix-tree.h"
Matthew Wilcox5eeb2d22016-12-24 07:49:18 -05006
7extern int kmalloc_verbose;
Rehas Sachdeva73bc0292017-01-04 11:55:00 -05008extern int test_verbose;
Matthew Wilcox5eeb2d22016-12-24 07:49:18 -05009
10static inline void trace_call_rcu(struct rcu_head *head,
11 void (*func)(struct rcu_head *head))
12{
13 if (kmalloc_verbose)
14 printf("Delaying free of %p to slab\n", (char *)head -
15 offsetof(struct radix_tree_node, rcu_head));
16 call_rcu(head, func);
17}
Rehas Sachdeva73bc0292017-01-04 11:55:00 -050018
19#define printv(verbosity_level, fmt, ...) \
20 if(test_verbose >= verbosity_level) \
21 printf(fmt, ##__VA_ARGS__)
22
Matthew Wilcox5eeb2d22016-12-24 07:49:18 -050023#undef call_rcu
24#define call_rcu(x, y) trace_call_rcu(x, y)
25
26#endif /* _TEST_RADIX_TREE_H */