Commit | Line | Data |
---|---|---|
59ea7463 JS |
1 | #ifndef LINUX_MM_DEBUG_H |
2 | #define LINUX_MM_DEBUG_H 1 | |
3 | ||
309381fe SL |
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 | ||
59ea7463 JS |
10 | #ifdef CONFIG_DEBUG_VM |
11 | #define VM_BUG_ON(cond) BUG_ON(cond) | |
309381fe SL |
12 | #define VM_BUG_ON_PAGE(cond, page) \ |
13 | do { if (unlikely(cond)) { dump_page(page, NULL); BUG(); } } while (0) | |
59ea7463 | 14 | #else |
02602a18 | 15 | #define VM_BUG_ON(cond) BUILD_BUG_ON_INVALID(cond) |
309381fe | 16 | #define VM_BUG_ON_PAGE(cond, page) VM_BUG_ON(cond) |
59ea7463 JS |
17 | #endif |
18 | ||
19 | #ifdef CONFIG_DEBUG_VIRTUAL | |
20 | #define VIRTUAL_BUG_ON(cond) BUG_ON(cond) | |
21 | #else | |
7aa413de | 22 | #define VIRTUAL_BUG_ON(cond) do { } while (0) |
59ea7463 JS |
23 | #endif |
24 | ||
25 | #endif |