aboutsummaryrefslogtreecommitdiffstats
path: root/lib/fault-inject.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/fault-inject.c')
-rw-r--r--lib/fault-inject.c32
1 files changed, 1 insertions, 31 deletions
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{