public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Li Zefan <lizf@cn.fujitsu.com>
To: Jiri Olsa <jolsa@redhat.com>
Cc: Ingo Molnar <mingo@elte.hu>, Steven Rostedt <rostedt@goodmis.org>,
	lkml <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] tracing: dont reset set_ftrace_filter/notrace when	opened with r/w perm
Date: Mon, 20 Jul 2009 08:55:54 +0800	[thread overview]
Message-ID: <4A63C09A.80904@cn.fujitsu.com> (raw)
In-Reply-To: <20090717111025.GC2891@jolsa.lab.eng.brq.redhat.com>

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;

  reply	other threads:[~2009-07-20  0:57 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-07-16 16:51 [PATCH] tracing: dont reset set_ftrace_filter/notrace when opened with r/w perm Jiri Olsa
2009-07-17  9:37 ` Li Zefan
2009-07-17 11:10   ` Jiri Olsa
2009-07-20  0:55     ` Li Zefan [this message]
2009-07-20  1:32       ` Frederic Weisbecker
2009-07-22 12:19         ` Jiri Olsa
2009-07-21  1:11 ` Steven Rostedt
2009-07-22  7:42   ` Jiri Olsa
2009-07-22 15:19     ` Steven Rostedt

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4A63C09A.80904@cn.fujitsu.com \
    --to=lizf@cn.fujitsu.com \
    --cc=jolsa@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=rostedt@goodmis.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox