diff options
author | Li Zefan <lizf@cn.fujitsu.com> | 2009-06-14 22:58:39 -0400 |
---|---|---|
committer | Steven Rostedt <rostedt@goodmis.org> | 2009-06-15 11:37:16 -0400 |
commit | 5e4904cb633177046bee5d26946a7ac918e642fc (patch) | |
tree | 9ae10b1c3d707c0c3faffa8a4b337c055222d899 /kernel/trace | |
parent | e4f2d10f479d18198ebafcb5e124cc3dd8b8817a (diff) |
tracing/filters: operand can be negative
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 ]
Acked-by: Frederic Weisbecker <fweisbec@gmail.com>
Signed-off-by: Li Zefan <lizf@cn.fujitsu.com>
LKML-Reference: <4A35B8DF.60400@cn.fujitsu.com>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
Diffstat (limited to 'kernel/trace')
-rw-r--r-- | 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 db6e54bdb596..1d8192304842 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, | |||
546 | filter_pred_fn_t fn; | 546 | filter_pred_fn_t fn; |
547 | unsigned long long val; | 547 | unsigned long long val; |
548 | int string_type; | 548 | int string_type; |
549 | int ret; | ||
549 | 550 | ||
550 | pred->fn = filter_pred_none; | 551 | pred->fn = filter_pred_none; |
551 | 552 | ||
@@ -581,7 +582,11 @@ static int filter_add_pred(struct filter_parse_state *ps, | |||
581 | pred->not = 1; | 582 | pred->not = 1; |
582 | return filter_add_pred_fn(ps, call, pred, fn); | 583 | return filter_add_pred_fn(ps, call, pred, fn); |
583 | } else { | 584 | } else { |
584 | if (strict_strtoull(pred->str_val, 0, &val)) { | 585 | if (field->is_signed) |
586 | ret = strict_strtoll(pred->str_val, 0, &val); | ||
587 | else | ||
588 | ret = strict_strtoull(pred->str_val, 0, &val); | ||
589 | if (ret) { | ||
585 | parse_error(ps, FILT_ERR_ILLEGAL_INTVAL, 0); | 590 | parse_error(ps, FILT_ERR_ILLEGAL_INTVAL, 0); |
586 | return -EINVAL; | 591 | return -EINVAL; |
587 | } | 592 | } |