diff options
author | Matthew Wilcox <mawilcox@microsoft.com> | 2016-12-24 15:49:18 +0300 |
---|---|---|
committer | Matthew Wilcox <mawilcox@microsoft.com> | 2017-02-14 05:44:03 +0300 |
commit | 5eeb2d23df29212f901a36dabf16f93d8bd50814 (patch) | |
tree | 378aac4a3639c24343014a58c5c492a1bd886491 /tools/testing/radix-tree/linux | |
parent | d3e709e63e97e5f3f129b639991cfe266da60bae (diff) | |
download | linux-5eeb2d23df29212f901a36dabf16f93d8bd50814.tar.xz |
radix tree test suite: Introduce kmalloc_verbose
To help track down where memory leaks may be, add the ability to turn
on/off printing allocations, frees and delayed frees.
Signed-off-by: Matthew Wilcox <mawilcox@microsoft.com>
Diffstat (limited to 'tools/testing/radix-tree/linux')
-rw-r--r-- | tools/testing/radix-tree/linux/radix-tree.h | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/tools/testing/radix-tree/linux/radix-tree.h b/tools/testing/radix-tree/linux/radix-tree.h index ce694ddd4aea..f4d8532e1bef 100644 --- a/tools/testing/radix-tree/linux/radix-tree.h +++ b/tools/testing/radix-tree/linux/radix-tree.h @@ -1 +1,18 @@ +#ifndef _TEST_RADIX_TREE_H +#define _TEST_RADIX_TREE_H #include "../../../../include/linux/radix-tree.h" + +extern int kmalloc_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); +} +#undef call_rcu +#define call_rcu(x, y) trace_call_rcu(x, y) + +#endif /* _TEST_RADIX_TREE_H */ |