From: Xiao Guangrong <xiaoguangrong@cn.fujitsu.com>
To: Ingo Molnar <mingo@elte.hu>
Cc: "K.Prasad" <prasad@linux.vnet.ibm.com>,
Alan Stern <stern@rowland.harvard.edu>,
Frederic Weisbecker <fweisbec@gmail.com>,
Steven Rostedt <rostedt@goodmis.org>,
LKML <linux-kernel@vger.kernel.org>
Subject: [PATCH 2/3] tracing/ksym_tracer: fix write operation of ksym_trace_filter
Date: Wed, 22 Jul 2009 11:23:41 +0800 [thread overview]
Message-ID: <4A66863D.5090802@cn.fujitsu.com> (raw)
In-Reply-To: <4A6685BB.2090809@cn.fujitsu.com>
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>
---
kernel/trace/trace_ksym.c | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)
diff --git a/kernel/trace/trace_ksym.c b/kernel/trace/trace_ksym.c
index fbf3a8e..cd5cb65 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) */
--
1.6.1.2
next prev parent reply other threads:[~2009-07-22 3:23 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-07-22 3:21 [PATCH 1/3] tracing/ksym_tracer: fix the output of ksym tracer Xiao Guangrong
2009-07-22 3:23 ` Xiao Guangrong [this message]
2009-11-21 13:35 ` [tip:perf/core] tracing/ksym_tracer: fix write operation of ksym_trace_filter tip-bot for Xiao Guangrong
2009-07-22 3:25 ` [PATCH 3/3] tracing/ksym_tracer: support quick clear for ksym_trace_filter Xiao Guangrong
2009-07-22 5:06 ` K.Prasad
2009-07-22 9:56 ` Xiao Guangrong
2009-07-22 15:17 ` K.Prasad
2009-07-23 0:50 ` Xiao Guangrong
2009-07-23 4:01 ` [PATCH 3/3] tracing/ksym_tracer: support quick clear for ksym_trace_filter -- v2 Xiao Guangrong
2009-07-24 0:46 ` Steven Rostedt
2009-07-24 2:06 ` Xiao Guangrong
2009-07-24 2:11 ` Steven Rostedt
2009-11-21 13:35 ` [tip:perf/core] " tip-bot for Xiao Guangrong
2009-11-21 13:35 ` [tip:perf/core] tracing/ksym_tracer: fix the output of ksym tracer tip-bot for Xiao Guangrong
-- strict thread matches above, loose matches on Subject: below --
2009-07-24 2:14 [PATCH 0/3] [GIT PULL] tracing/ksys_tracer: misc fixes Steven Rostedt
2009-07-24 2:14 ` [PATCH 2/3] tracing/ksym_tracer: fix write operation of ksym_trace_filter 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=4A66863D.5090802@cn.fujitsu.com \
--to=xiaoguangrong@cn.fujitsu.com \
--cc=fweisbec@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=prasad@linux.vnet.ibm.com \
--cc=rostedt@goodmis.org \
--cc=stern@rowland.harvard.edu \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.