summaryrefslogtreecommitdiffstats
path: root/kernel/trace
diff options
context:
space:
mode:
authorXiao Guangrong <xiaoguangrong@cn.fujitsu.com>2009-07-22 05:23:41 +0200
committerSteven Rostedt <rostedt@goodmis.org>2009-07-24 02:52:05 +0200
commit8e068542a8d9efec55126284d2f5cb32f003d507 (patch)
treeb3a75ae9a2dd27596bda9f1c7be1cd5ce0ebacfe /kernel/trace
parenttracing/ksym_tracer: fix the output of ksym tracer (diff)
downloadlinux-8e068542a8d9efec55126284d2f5cb32f003d507.tar.xz
linux-8e068542a8d9efec55126284d2f5cb32f003d507.zip
tracing/ksym_tracer: fix write operation of ksym_trace_filter
This patch fix 2 bugs: - fix the return value of ksym_trace_filter_write() when we want to clear symbol in ksym_trace_filter file for example: # echo global_trace:rw- > /debug/tracing/ksym_trace_filter # echo global_trace:--- > /debug/tracing/ksym_trace_filter -bash: echo: write error: Invalid argument # cat /debug/tracing/ksym_trace_filter # We want to clear 'global_trace' in ksym_trace_filter, it complain with "Invalid argument", but the operation is successful - the "r--" access types is not allowed, but ksym_trace_filter file think it OK for example: # echo ksym_tracer_mutex:r-- > ksym_trace_filter -bash: echo: write error: Resource temporarily unavailable # dmesg ksym_tracer request failed. Try again later!! The error occur at register_kernel_hw_breakpoint(), but It's should at access types parser Signed-off-by: Xiao Guangrong <xiaoguangrong@cn.fujitsu.com> LKML-Reference: <4A66863D.5090802@cn.fujitsu.com> Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
Diffstat (limited to 'kernel/trace')
-rw-r--r--kernel/trace/trace_ksym.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/kernel/trace/trace_ksym.c b/kernel/trace/trace_ksym.c
index fbf3a8e13bc5..cd5cb656c3d2 100644
--- a/kernel/trace/trace_ksym.c
+++ b/kernel/trace/trace_ksym.c
@@ -135,6 +135,9 @@ static int ksym_trace_get_access_type(char *str)
case 6:
access = HW_BREAKPOINT_RW;
break;
+ case 4:
+ access = -EINVAL;
+ break;
case 2:
access = HW_BREAKPOINT_WRITE;
break;
@@ -312,6 +315,7 @@ static ssize_t ksym_trace_filter_write(struct file *file,
kfree(entry->ksym_hbp->info.name);
kfree(entry->ksym_hbp);
kfree(entry);
+ ret = 0;
goto out;
} else {
/* Check for malformed request: (4) */