aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/trace/ftrace.c
diff options
context:
space:
mode:
authorIngo Molnar <mingo@elte.hu>2009-08-11 08:19:09 -0400
committerIngo Molnar <mingo@elte.hu>2009-08-11 08:19:09 -0400
commit89034bc2c7b839702c00a704e79d112737f98be0 (patch)
treee65b1f3d4c751baa840efc81bc4734f089379eb3 /kernel/trace/ftrace.c
parentfb82ad719831db58e9baa4c67015aae3fe27e7e3 (diff)
parent85dfd81dc57e8183a277ddd7a56aa65c96f3f487 (diff)
Merge branch 'linus' into tracing/core
Conflicts: kernel/trace/trace_events_filter.c We use the tracing/core version. Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'kernel/trace/ftrace.c')
-rw-r--r--kernel/trace/ftrace.c19
1 files changed, 14 insertions, 5 deletions
diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c
index 24e3ff53b24b..094863416b2e 100644
--- a/kernel/trace/ftrace.c
+++ b/kernel/trace/ftrace.c
@@ -1617,7 +1617,7 @@ ftrace_regex_open(struct inode *inode, struct file *file, int enable)
1617 1617
1618 mutex_lock(&ftrace_regex_lock); 1618 mutex_lock(&ftrace_regex_lock);
1619 if ((file->f_mode & FMODE_WRITE) && 1619 if ((file->f_mode & FMODE_WRITE) &&
1620 !(file->f_flags & O_APPEND)) 1620 (file->f_flags & O_TRUNC))
1621 ftrace_filter_reset(enable); 1621 ftrace_filter_reset(enable);
1622 1622
1623 if (file->f_mode & FMODE_READ) { 1623 if (file->f_mode & FMODE_READ) {
@@ -2527,7 +2527,7 @@ ftrace_graph_open(struct inode *inode, struct file *file)
2527 2527
2528 mutex_lock(&graph_lock); 2528 mutex_lock(&graph_lock);
2529 if ((file->f_mode & FMODE_WRITE) && 2529 if ((file->f_mode & FMODE_WRITE) &&
2530 !(file->f_flags & O_APPEND)) { 2530 (file->f_flags & O_TRUNC)) {
2531 ftrace_graph_count = 0; 2531 ftrace_graph_count = 0;
2532 memset(ftrace_graph_funcs, 0, sizeof(ftrace_graph_funcs)); 2532 memset(ftrace_graph_funcs, 0, sizeof(ftrace_graph_funcs));
2533 } 2533 }
@@ -2546,6 +2546,14 @@ ftrace_graph_open(struct inode *inode, struct file *file)
2546} 2546}
2547 2547
2548static int 2548static int
2549ftrace_graph_release(struct inode *inode, struct file *file)
2550{
2551 if (file->f_mode & FMODE_READ)
2552 seq_release(inode, file);
2553 return 0;
2554}
2555
2556static int
2549ftrace_set_func(unsigned long *array, int *idx, char *buffer) 2557ftrace_set_func(unsigned long *array, int *idx, char *buffer)
2550{ 2558{
2551 struct dyn_ftrace *rec; 2559 struct dyn_ftrace *rec;
@@ -2674,9 +2682,10 @@ ftrace_graph_write(struct file *file, const char __user *ubuf,
2674} 2682}
2675 2683
2676static const struct file_operations ftrace_graph_fops = { 2684static const struct file_operations ftrace_graph_fops = {
2677 .open = ftrace_graph_open, 2685 .open = ftrace_graph_open,
2678 .read = seq_read, 2686 .read = seq_read,
2679 .write = ftrace_graph_write, 2687 .write = ftrace_graph_write,
2688 .release = ftrace_graph_release,
2680}; 2689};
2681#endif /* CONFIG_FUNCTION_GRAPH_TRACER */ 2690#endif /* CONFIG_FUNCTION_GRAPH_TRACER */
2682 2691