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.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/fault-inject.c b/lib/fault-inject.c
index b18fc2ff9ffe..23985a278bbb 100644
--- a/lib/fault-inject.c
+++ b/lib/fault-inject.c
@@ -139,12 +139,14 @@ static void debugfs_ul_set(void *data, u64 val)
139 *(unsigned long *)data = val; 139 *(unsigned long *)data = val;
140} 140}
141 141
142#ifdef CONFIG_FAULT_INJECTION_STACKTRACE_FILTER
142static void debugfs_ul_set_MAX_STACK_TRACE_DEPTH(void *data, u64 val) 143static void debugfs_ul_set_MAX_STACK_TRACE_DEPTH(void *data, u64 val)
143{ 144{
144 *(unsigned long *)data = 145 *(unsigned long *)data =
145 val < MAX_STACK_TRACE_DEPTH ? 146 val < MAX_STACK_TRACE_DEPTH ?
146 val : MAX_STACK_TRACE_DEPTH; 147 val : MAX_STACK_TRACE_DEPTH;
147} 148}
149#endif /* CONFIG_FAULT_INJECTION_STACKTRACE_FILTER */
148 150
149static u64 debugfs_ul_get(void *data) 151static u64 debugfs_ul_get(void *data)
150{ 152{
@@ -159,6 +161,7 @@ static struct dentry *debugfs_create_ul(const char *name, mode_t mode,
159 return debugfs_create_file(name, mode, parent, value, &fops_ul); 161 return debugfs_create_file(name, mode, parent, value, &fops_ul);
160} 162}
161 163
164#ifdef CONFIG_FAULT_INJECTION_STACKTRACE_FILTER
162DEFINE_SIMPLE_ATTRIBUTE(fops_ul_MAX_STACK_TRACE_DEPTH, debugfs_ul_get, 165DEFINE_SIMPLE_ATTRIBUTE(fops_ul_MAX_STACK_TRACE_DEPTH, debugfs_ul_get,
163 debugfs_ul_set_MAX_STACK_TRACE_DEPTH, "%llu\n"); 166 debugfs_ul_set_MAX_STACK_TRACE_DEPTH, "%llu\n");
164 167
@@ -169,6 +172,7 @@ static struct dentry *debugfs_create_ul_MAX_STACK_TRACE_DEPTH(
169 return debugfs_create_file(name, mode, parent, value, 172 return debugfs_create_file(name, mode, parent, value,
170 &fops_ul_MAX_STACK_TRACE_DEPTH); 173 &fops_ul_MAX_STACK_TRACE_DEPTH);
171} 174}
175#endif /* CONFIG_FAULT_INJECTION_STACKTRACE_FILTER */
172 176
173static void debugfs_atomic_t_set(void *data, u64 val) 177static void debugfs_atomic_t_set(void *data, u64 val)
174{ 178{