summaryrefslogtreecommitdiff
path: root/include/linux
diff options
context:
space:
mode:
authorSyed Rameez Mustafa <rameezmustafa@codeaurora.org>2013-07-15 11:52:09 -0700
committerDavid Keitel <dkeitel@codeaurora.org>2016-03-22 11:16:29 -0700
commite2cddd104051ee3f47dddaa0b8d54a5193f0971b (patch)
tree3541893ea0c24d5b15621066447568cd942bebc4 /include/linux
parente594000013901cc6f2c453487815be64a89c113f (diff)
kernel/lib: add additional debug capabilites for data corruption
Data corruptions in the kernel often end up in system crashes that are easier to debug closer to the time of detection. Specifically, if we do not panic immediately after lock or list corruptions have been detected, the problem context is lost in the ensuing system mayhem. Add support for allowing system crash immediately after such corruptions are detected. The CONFIG option controls the enabling/disabling of the feature. Change-Id: I9b2eb62da506a13007acff63e85e9515145909ff Signed-off-by: Syed Rameez Mustafa <rameezmustafa@codeaurora.org> [abhimany: minor merge conflict resolution] Signed-off-by: Abhimanyu Kapur <abhimany@codeaurora.org>
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/bug.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/include/linux/bug.h b/include/linux/bug.h
index 7f4818673c41..91eedf5fae38 100644
--- a/include/linux/bug.h
+++ b/include/linux/bug.h
@@ -109,4 +109,10 @@ static inline enum bug_trap_type report_bug(unsigned long bug_addr,
}
#endif /* CONFIG_GENERIC_BUG */
+
+#ifdef CONFIG_PANIC_ON_DATA_CORRUPTION
+#define PANIC_CORRUPTION 1
+#else
+#define PANIC_CORRUPTION 0
+#endif /* CONFIG_PANIC_ON_DATA_CORRUPTION */
#endif /* _LINUX_BUG_H */