From: Li Zefan Date: Tue, 8 Dec 2009 03:15:30 +0000 (+0800) Subject: ftrace: Call trace_parser_clear() properly X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=313254a9400d388b46150c0f355e216418a2f598;p=GitHub%2Fexynos8895%2Fandroid_kernel_samsung_universal8895.git ftrace: Call trace_parser_clear() properly I found a weird behavior: # echo 'fuse:*' > set_ftrace_filter bash: echo: write error: Invalid argument # cat set_ftrace_filter fuse_dev_fasync fuse_dev_poll fuse_copy_do We should call trace_parser_clear() no matter ftrace_process_regex() returns 0 or -errno, otherwise we will actually take the unaccepted records from ftrace_regex_release(). Signed-off-by: Li Zefan Acked-by: Steven Rostedt LKML-Reference: <4B1DC4D2.3000406@cn.fujitsu.com> Signed-off-by: Frederic Weisbecker --- diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c index 08a3fb5b3187..ff8aecdc6dd6 100644 --- a/kernel/trace/ftrace.c +++ b/kernel/trace/ftrace.c @@ -2208,10 +2208,9 @@ ftrace_regex_write(struct file *file, const char __user *ubuf, !trace_parser_cont(parser)) { ret = ftrace_process_regex(parser->buffer, parser->idx, enable); + trace_parser_clear(parser); if (ret) goto out_unlock; - - trace_parser_clear(parser); } ret = read;