The "stack_trace_filter" file only makes sense if DYNAMIC_FTRACE is configured in. If it is not, then the user can not filter any functions. Not only that, the open function causes warnings when DYNAMIC_FTRACE is not set. Link: http://lkml.kernel.org/r/20170710110521.600806-1-arnd@arndb.de
Showing the changes to kernel/trace/trace_stack.c (1 of 1 file). Show all
Unified · Split
| @@ -406,6 +406,8 @@ static const struct file_operations stack_trace_fops = { · 405 unmodified lines | ||
| 406 | 406 | .release = seq_release, |
| 407 | 407 | }; |
| 408 | 408 | |
| 409 | +#ifdef CONFIG_DYNAMIC_FTRACE | |
| 410 | + | |
| 409 | 411 | static int |
| 410 | 412 | stack_trace_filter_open(struct inode *inode, struct file *file) |
| 411 | 413 | { |
| @@ -423,6 +425,8 @@ static const struct file_operations stack_trace_filter_fops = { · 11 unmodified lines | ||
| 423 | 425 | .release = ftrace_regex_release, |
| 424 | 426 | }; |
| 425 | 427 | |
| 428 | +#endif /* CONFIG_DYNAMIC_FTRACE */ | |
| 429 | + | |
| 426 | 430 | int |
| 427 | 431 | stack_trace_sysctl(struct ctl_table *table, int write, |
| 428 | 432 | void __user *buffer, size_t *lenp, |
| @@ -477,8 +481,10 @@ static __init int stack_trace_init(void) · 48 unmodified lines | ||
| 477 | 481 | trace_create_file("stack_trace", 0444, d_tracer, |
| 478 | 482 | NULL, &stack_trace_fops); |
| 479 | 483 | |
| 484 | +#ifdef CONFIG_DYNAMIC_FTRACE | |
| 480 | 485 | trace_create_file("stack_trace_filter", 0444, d_tracer, |
| 481 | 486 | &trace_ops, &stack_trace_filter_fops); |
| 487 | +#endif | |
| 482 | 488 | |
| 483 | 489 | if (stack_trace_filter_buf[0]) |
| 484 | 490 | ftrace_set_early_filter(&trace_ops, stack_trace_filter_buf, 1); |