From: Li Zefan <lizf@cn.fujitsu.com>
To: Ingo Molnar <mingo@elte.hu>
Cc: Steven Rostedt <rostedt@goodmis.org>,
Frederic Weisbecker <fweisbec@gmail.com>,
LKML <linux-kernel@vger.kernel.org>
Subject: [PATCH 3/4] tracing/filters: operand can be negative
Date: Mon, 15 Jun 2009 10:58:39 +0800 [thread overview]
Message-ID: <4A35B8DF.60400@cn.fujitsu.com> (raw)
In-Reply-To: <4A35B84B.40904@cn.fujitsu.com>
This should be a bug:
# cat format
name: foo_bar
ID: 71
format:
...
field:int bar; offset:24; size:4;
# echo 'bar < 0' > filter
# echo 'bar < -1' > filter
bash: echo: write error: Invalid argument
[ Impact: fix to allow negative operand in filer expr ]
Signed-off-by: Li Zefan <lizf@cn.fujitsu.com>
---
kernel/trace/trace_events_filter.c | 7 ++++++-
1 files changed, 6 insertions(+), 1 deletions(-)
diff --git a/kernel/trace/trace_events_filter.c b/kernel/trace/trace_events_filter.c
index db6e54b..1d81923 100644
--- a/kernel/trace/trace_events_filter.c
+++ b/kernel/trace/trace_events_filter.c
@@ -546,6 +546,7 @@ static int filter_add_pred(struct filter_parse_state *ps,
filter_pred_fn_t fn;
unsigned long long val;
int string_type;
+ int ret;
pred->fn = filter_pred_none;
@@ -581,7 +582,11 @@ static int filter_add_pred(struct filter_parse_state *ps,
pred->not = 1;
return filter_add_pred_fn(ps, call, pred, fn);
} else {
- if (strict_strtoull(pred->str_val, 0, &val)) {
+ if (field->is_signed)
+ ret = strict_strtoll(pred->str_val, 0, &val);
+ else
+ ret = strict_strtoull(pred->str_val, 0, &val);
+ if (ret) {
parse_error(ps, FILT_ERR_ILLEGAL_INTVAL, 0);
return -EINVAL;
}
--
1.5.4.rc3
next prev parent reply other threads:[~2009-06-15 2:57 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-06-15 2:56 [PATCH 0/4] tracing: some fixes for 2.6.31 Li Zefan
2009-06-15 2:56 ` [PATCH 1/4] tracing: fix a typo in tracing_cpumask_write() Li Zefan
2009-06-15 18:13 ` [tip:tracing/urgent] " tip-bot for Li Zefan
2009-06-15 2:57 ` [PATCH 2/4] tracing: replace a GFP_ATOMIC with GFP_KERNEL allocation Li Zefan
2009-06-15 18:13 ` [tip:tracing/urgent] " tip-bot for Li Zefan
2009-06-15 2:58 ` Li Zefan [this message]
2009-06-15 18:13 ` [tip:tracing/urgent] tracing/filters: operand can be negative tip-bot for Li Zefan
2009-06-15 2:59 ` [PATCH 4/4] tracing/filters: strloc should be unsigned short Li Zefan
2009-06-15 18:13 ` [tip:tracing/urgent] " tip-bot for Li Zefan
2009-06-15 12:21 ` [PATCH 0/4] tracing: some fixes for 2.6.31 Frederic Weisbecker
2009-06-15 12:48 ` 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=4A35B8DF.60400@cn.fujitsu.com \
--to=lizf@cn.fujitsu.com \
--cc=fweisbec@gmail.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 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.