lkml.org 
[lkml]   [2009]   [Jul]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] tracing: dont reset set_ftrace_filter/notrace when opened with r/w perm
Jiri Olsa wrote:
> On Fri, Jul 17, 2009 at 05:37:24PM +0800, Li Zefan wrote:
>> 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
>>
>
> oops, sry I missed this..
>
> Following patch adds new FTRACE_ITER_RESET flag, as the decision needs
> to be taken in "open" and applied in "write". I'm not sure whats the
> policy for adding new flags, but it looks ok to me.
>

I have no strong opinion whether to do the reset in "open" or in first
"write".

All said, I think this is cleaner, without introducing a new flag:

@@ -2260,6 +2256,9 @@ ftrace_regex_write(struct file *file, const char __user *ubuf,
return 0;

mutex_lock(&ftrace_regex_lock);
+ if (file->f_pos == 0 &&
+ (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;


\
 
 \ /
  Last update: 2009-07-20 03:01    [W:0.068 / U:6.096 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site