aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--kernel/trace/trace_stack.c19
1 files changed, 18 insertions, 1 deletions
diff --git a/kernel/trace/trace_stack.c b/kernel/trace/trace_stack.c
index 77575b386d97..0398b7c7afd6 100644
--- a/kernel/trace/trace_stack.c
+++ b/kernel/trace/trace_stack.c
@@ -133,7 +133,6 @@ stack_trace_call(unsigned long ip, unsigned long parent_ip)
133static struct ftrace_ops trace_ops __read_mostly = 133static struct ftrace_ops trace_ops __read_mostly =
134{ 134{
135 .func = stack_trace_call, 135 .func = stack_trace_call,
136 .flags = FTRACE_OPS_FL_GLOBAL,
137}; 136};
138 137
139static ssize_t 138static ssize_t
@@ -311,6 +310,21 @@ static const struct file_operations stack_trace_fops = {
311 .release = seq_release, 310 .release = seq_release,
312}; 311};
313 312
313static int
314stack_trace_filter_open(struct inode *inode, struct file *file)
315{
316 return ftrace_regex_open(&trace_ops, FTRACE_ITER_FILTER,
317 inode, file);
318}
319
320static const struct file_operations stack_trace_filter_fops = {
321 .open = stack_trace_filter_open,
322 .read = seq_read,
323 .write = ftrace_filter_write,
324 .llseek = ftrace_regex_lseek,
325 .release = ftrace_regex_release,
326};
327
314int 328int
315stack_trace_sysctl(struct ctl_table *table, int write, 329stack_trace_sysctl(struct ctl_table *table, int write,
316 void __user *buffer, size_t *lenp, 330 void __user *buffer, size_t *lenp,
@@ -358,6 +372,9 @@ static __init int stack_trace_init(void)
358 trace_create_file("stack_trace", 0444, d_tracer, 372 trace_create_file("stack_trace", 0444, d_tracer,
359 NULL, &stack_trace_fops); 373 NULL, &stack_trace_fops);
360 374
375 trace_create_file("stack_trace_filter", 0444, d_tracer,
376 NULL, &stack_trace_filter_fops);
377
361 if (stack_tracer_enabled) 378 if (stack_tracer_enabled)
362 register_ftrace_function(&trace_ops); 379 register_ftrace_function(&trace_ops);
363 380