aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/Kconfig.debug18
-rw-r--r--lib/fault-inject.c32
2 files changed, 1 insertions, 49 deletions
diff --git a/lib/Kconfig.debug b/lib/Kconfig.debug
index 818e4589f718..5c2681875b9a 100644
--- a/lib/Kconfig.debug
+++ b/lib/Kconfig.debug
@@ -354,24 +354,6 @@ config FRAME_POINTER
354 some architectures or if you use external debuggers. 354 some architectures or if you use external debuggers.
355 If you don't debug the kernel, you can say N. 355 If you don't debug the kernel, you can say N.
356 356
357config UNWIND_INFO
358 bool "Compile the kernel with frame unwind information"
359 depends on !IA64 && !PARISC && !ARM
360 depends on !MODULES || !(MIPS || PPC || SUPERH || V850)
361 help
362 If you say Y here the resulting kernel image will be slightly larger
363 but not slower, and it will give very useful debugging information.
364 If you don't debug the kernel, you can say N, but we may not be able
365 to solve problems without frame unwind information or frame pointers.
366
367config STACK_UNWIND
368 bool "Stack unwind support"
369 depends on UNWIND_INFO
370 depends on X86
371 help
372 This enables more precise stack traces, omitting all unrelated
373 occurrences of pointers into kernel code from the dump.
374
375config FORCED_INLINING 357config FORCED_INLINING
376 bool "Force gcc to inline functions marked 'inline'" 358 bool "Force gcc to inline functions marked 'inline'"
377 depends on DEBUG_KERNEL 359 depends on DEBUG_KERNEL
diff --git a/lib/fault-inject.c b/lib/fault-inject.c
index d143c0faf248..b5a90fc056d3 100644
--- a/lib/fault-inject.c
+++ b/lib/fault-inject.c
@@ -55,37 +55,7 @@ static bool fail_task(struct fault_attr *attr, struct task_struct *task)
55 55
56#define MAX_STACK_TRACE_DEPTH 32 56#define MAX_STACK_TRACE_DEPTH 32
57 57
58#ifdef CONFIG_STACK_UNWIND 58#if defined(CONFIG_STACKTRACE)
59
60static asmlinkage int fail_stacktrace_callback(struct unwind_frame_info *info,
61 void *arg)
62{
63 int depth;
64 struct fault_attr *attr = arg;
65 bool found = (attr->require_start == 0 && attr->require_end == ULONG_MAX);
66
67 for (depth = 0; depth < attr->stacktrace_depth
68 && unwind(info) == 0 && UNW_PC(info); depth++) {
69 if (arch_unw_user_mode(info))
70 break;
71 if (attr->reject_start <= UNW_PC(info) &&
72 UNW_PC(info) < attr->reject_end)
73 return false;
74 if (attr->require_start <= UNW_PC(info) &&
75 UNW_PC(info) < attr->require_end)
76 found = true;
77 }
78 return found;
79}
80
81static bool fail_stacktrace(struct fault_attr *attr)
82{
83 struct unwind_frame_info info;
84
85 return unwind_init_running(&info, fail_stacktrace_callback, attr);
86}
87
88#elif defined(CONFIG_STACKTRACE)
89 59
90static bool fail_stacktrace(struct fault_attr *attr) 60static bool fail_stacktrace(struct fault_attr *attr)
91{ 61{