diff options
Diffstat (limited to 'kernel/trace/ftrace.c')
-rw-r--r-- | kernel/trace/ftrace.c | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c index 4521c77d1a1a..1e1d23c26308 100644 --- a/kernel/trace/ftrace.c +++ b/kernel/trace/ftrace.c | |||
@@ -1662,7 +1662,7 @@ ftrace_regex_open(struct inode *inode, struct file *file, int enable) | |||
1662 | 1662 | ||
1663 | mutex_lock(&ftrace_regex_lock); | 1663 | mutex_lock(&ftrace_regex_lock); |
1664 | if ((file->f_mode & FMODE_WRITE) && | 1664 | if ((file->f_mode & FMODE_WRITE) && |
1665 | !(file->f_flags & O_APPEND)) | 1665 | (file->f_flags & O_TRUNC)) |
1666 | ftrace_filter_reset(enable); | 1666 | ftrace_filter_reset(enable); |
1667 | 1667 | ||
1668 | if (file->f_mode & FMODE_READ) { | 1668 | if (file->f_mode & FMODE_READ) { |
@@ -2577,7 +2577,7 @@ ftrace_graph_open(struct inode *inode, struct file *file) | |||
2577 | 2577 | ||
2578 | mutex_lock(&graph_lock); | 2578 | mutex_lock(&graph_lock); |
2579 | if ((file->f_mode & FMODE_WRITE) && | 2579 | if ((file->f_mode & FMODE_WRITE) && |
2580 | !(file->f_flags & O_APPEND)) { | 2580 | (file->f_flags & O_TRUNC)) { |
2581 | ftrace_graph_count = 0; | 2581 | ftrace_graph_count = 0; |
2582 | memset(ftrace_graph_funcs, 0, sizeof(ftrace_graph_funcs)); | 2582 | memset(ftrace_graph_funcs, 0, sizeof(ftrace_graph_funcs)); |
2583 | } | 2583 | } |
@@ -2596,6 +2596,14 @@ ftrace_graph_open(struct inode *inode, struct file *file) | |||
2596 | } | 2596 | } |
2597 | 2597 | ||
2598 | static int | 2598 | static int |
2599 | ftrace_graph_release(struct inode *inode, struct file *file) | ||
2600 | { | ||
2601 | if (file->f_mode & FMODE_READ) | ||
2602 | seq_release(inode, file); | ||
2603 | return 0; | ||
2604 | } | ||
2605 | |||
2606 | static int | ||
2599 | ftrace_set_func(unsigned long *array, int *idx, char *buffer) | 2607 | ftrace_set_func(unsigned long *array, int *idx, char *buffer) |
2600 | { | 2608 | { |
2601 | struct dyn_ftrace *rec; | 2609 | struct dyn_ftrace *rec; |
@@ -2724,9 +2732,10 @@ ftrace_graph_write(struct file *file, const char __user *ubuf, | |||
2724 | } | 2732 | } |
2725 | 2733 | ||
2726 | static const struct file_operations ftrace_graph_fops = { | 2734 | static const struct file_operations ftrace_graph_fops = { |
2727 | .open = ftrace_graph_open, | 2735 | .open = ftrace_graph_open, |
2728 | .read = seq_read, | 2736 | .read = seq_read, |
2729 | .write = ftrace_graph_write, | 2737 | .write = ftrace_graph_write, |
2738 | .release = ftrace_graph_release, | ||
2730 | }; | 2739 | }; |
2731 | #endif /* CONFIG_FUNCTION_GRAPH_TRACER */ | 2740 | #endif /* CONFIG_FUNCTION_GRAPH_TRACER */ |
2732 | 2741 | ||