[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <4A604654.1090303@cn.fujitsu.com>
Date: Fri, 17 Jul 2009 17:37:24 +0800
From: Li Zefan <lizf@...fujitsu.com>
To: Jiri Olsa <jolsa@...hat.com>
CC: Ingo Molnar <mingo@...e.hu>, Steven Rostedt <rostedt@...dmis.org>,
lkml <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] tracing: dont reset set_ftrace_filter/notrace when opened
with r/w perm
Jiri Olsa wrote:
> If user setup set_ftrace_filter/set_ftrace_notrace files and then opens them
> with read&write permissions, the previous setup will be removed.
>
Currently:
# echo 'sys_open sys_close' > set_ftrace_filter
# cat set_ftrace_filter
sys_open
sys_close
After your patch:
# echo 'sys_open sys_close' > set_ftrace_filter
# cat set_ftrace_filter
sys_close
> Tested with following program:
...
>
> Signed-off-by: Jiri Olsa <jolsa@...hat.com>
>
> ---
> diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c
> index 4521c77..11394bc 100644
> --- a/kernel/trace/ftrace.c
> +++ b/kernel/trace/ftrace.c
> @@ -1661,10 +1661,6 @@ ftrace_regex_open(struct inode *inode, struct file *file, int enable)
> return -ENOMEM;
>
> mutex_lock(&ftrace_regex_lock);
> - if ((file->f_mode & FMODE_WRITE) &&
> - !(file->f_flags & O_APPEND))
> - ftrace_filter_reset(enable);
> -
> if (file->f_mode & FMODE_READ) {
> iter->pg = ftrace_pages_start;
> iter->flags = enable ? FTRACE_ITER_FILTER :
> @@ -2260,6 +2256,9 @@ ftrace_regex_write(struct file *file, const char __user *ubuf,
> return 0;
>
> mutex_lock(&ftrace_regex_lock);
> + if ((file->f_mode & FMODE_WRITE) &&
> + !(file->f_flags & O_APPEND))
> + ftrace_filter_reset(enable);
>
> if (file->f_mode & FMODE_READ) {
> struct seq_file *m = file->private_data;
> --
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists