]> git.kernelconcepts.de Git - karo-tx-linux.git/blob - include/linux/mmdebug.h
mm: dump page when hitting a VM_BUG_ON using VM_BUG_ON_PAGE
[karo-tx-linux.git] / include / linux / mmdebug.h
1 #ifndef LINUX_MM_DEBUG_H
2 #define LINUX_MM_DEBUG_H 1
3
4 struct page;
5
6 extern void dump_page(struct page *page, char *reason);
7 extern void dump_page_badflags(struct page *page, char *reason,
8                                unsigned long badflags);
9
10 #ifdef CONFIG_DEBUG_VM
11 #define VM_BUG_ON(cond) BUG_ON(cond)
12 #define VM_BUG_ON_PAGE(cond, page) \
13         do { if (unlikely(cond)) { dump_page(page, NULL); BUG(); } } while (0)
14 #else
15 #define VM_BUG_ON(cond) BUILD_BUG_ON_INVALID(cond)
16 #define VM_BUG_ON_PAGE(cond, page) VM_BUG_ON(cond)
17 #endif
18
19 #ifdef CONFIG_DEBUG_VIRTUAL
20 #define VIRTUAL_BUG_ON(cond) BUG_ON(cond)
21 #else
22 #define VIRTUAL_BUG_ON(cond) do { } while (0)
23 #endif
24
25 #endif