public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] tracing/function: fix the return value of ftrace_trace_onoff_callback()
@ 2009-07-15  4:29 Xiao Guangrong
  2009-07-15  4:32 ` [PATCH 2/2] tracing/function: simplify for __ftrace_replace_code() Xiao Guangrong
  2009-07-15 14:28 ` [PATCH 1/2] tracing/function: fix the return value of ftrace_trace_onoff_callback() Frederic Weisbecker
  0 siblings, 2 replies; 9+ messages in thread
From: Xiao Guangrong @ 2009-07-15  4:29 UTC (permalink / raw)
  To: Ingo Molnar; +Cc: Steven Rostedt, Frederic Weisbecker, LKML

ftrace_trace_onoff_callback() will return error even if we do the
right operation, for example:

# echo _spin_*:traceon:10 > set_ftrace_filter
-bash: echo: write error: Invalid argument
# cat set_ftrace_filter
#### all functions enabled ####
_spin_trylock_bh:traceon:count=10
_spin_unlock_irq:traceon:count=10
_spin_unlock_bh:traceon:count=10
_spin_lock_irq:traceon:count=10
_spin_unlock:traceon:count=10
_spin_trylock:traceon:count=10
_spin_unlock_irqrestore:traceon:count=10
_spin_lock_irqsave:traceon:count=10
_spin_lock_bh:traceon:count=10
_spin_lock:traceon:count=10

We want to set _spin_*:traceon:10 to set_ftrace_filter, it complain
with "Invalid argument", but the operation is successful.
So, this patch fix it.

Signed-off-by: Xiao Guangrong <xiaoguangrong@cn.fujitsu.com>
---
 kernel/trace/trace_functions.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/kernel/trace/trace_functions.c b/kernel/trace/trace_functions.c
index 7402144..75ef000 100644
--- a/kernel/trace/trace_functions.c
+++ b/kernel/trace/trace_functions.c
@@ -363,7 +363,7 @@ ftrace_trace_onoff_callback(char *glob, char *cmd, char *param, int enable)
  out_reg:
 	ret = register_ftrace_function_probe(glob, ops, count);
 
-	return ret;
+	return ret < 0 ? ret : 0;
 }
 
 static struct ftrace_func_command ftrace_traceon_cmd = {
-- 
1.6.1.2


^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2009-07-17  4:45 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-07-15  4:29 [PATCH 1/2] tracing/function: fix the return value of ftrace_trace_onoff_callback() Xiao Guangrong
2009-07-15  4:32 ` [PATCH 2/2] tracing/function: simplify for __ftrace_replace_code() Xiao Guangrong
2009-07-16  9:29   ` Li Zefan
2009-07-17  4:05   ` Frederic Weisbecker
2009-07-17  4:30     ` Li Zefan
2009-07-17  4:39       ` Frederic Weisbecker
2009-07-15 14:28 ` [PATCH 1/2] tracing/function: fix the return value of ftrace_trace_onoff_callback() Frederic Weisbecker
2009-07-16  9:29   ` Li Zefan
2009-07-17  3:35     ` Frederic Weisbecker

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox