Matthew Wilcox | 5eeb2d2 | 2016-12-24 07:49:18 -0500 | [diff] [blame] | 1 | #ifndef _TEST_RADIX_TREE_H |
| 2 | #define _TEST_RADIX_TREE_H |
Matthew Wilcox | 1366c37 | 2016-03-17 14:21:45 -0700 | [diff] [blame] | 3 | #include "../../../../include/linux/radix-tree.h" |
Matthew Wilcox | 5eeb2d2 | 2016-12-24 07:49:18 -0500 | [diff] [blame] | 4 | |
| 5 | extern int kmalloc_verbose; |
Rehas Sachdeva | 73bc029 | 2017-01-04 11:55:00 -0500 | [diff] [blame^] | 6 | extern int test_verbose; |
Matthew Wilcox | 5eeb2d2 | 2016-12-24 07:49:18 -0500 | [diff] [blame] | 7 | |
| 8 | static 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 Sachdeva | 73bc029 | 2017-01-04 11:55:00 -0500 | [diff] [blame^] | 16 | |
| 17 | #define printv(verbosity_level, fmt, ...) \ |
| 18 | if(test_verbose >= verbosity_level) \ |
| 19 | printf(fmt, ##__VA_ARGS__) |
| 20 | |
Matthew Wilcox | 5eeb2d2 | 2016-12-24 07:49:18 -0500 | [diff] [blame] | 21 | #undef call_rcu |
| 22 | #define call_rcu(x, y) trace_call_rcu(x, y) |
| 23 | |
| 24 | #endif /* _TEST_RADIX_TREE_H */ |