aboutsummaryrefslogtreecommitdiffstats
path: root/kernel
diff options
context:
space:
mode:
authorLi Zefan <lizf@cn.fujitsu.com>2009-04-11 03:52:51 -0400
committerIngo Molnar <mingo@elte.hu>2009-04-12 05:59:28 -0400
commita3e0ab050774117d4a6173087c8bf3888662a83f (patch)
tree91d0f5c56a6b01d06c18864e5bcd8ec2c3405eb8 /kernel
parentbcabd91c271e50eebc0cb9220ac92700332b452e (diff)
tracing/filters: allow user input integer to be oct or hex
Before patch: # echo 'parent_pid == 0x10' > events/sched/sched_process_fork/filter # cat sched/sched_process_fork/filter parent_pid == 0 After patch: # cat sched/sched_process_fork/filter parent_pid == 16 Also check the input more strictly. Signed-off-by: Li Zefan <lizf@cn.fujitsu.com> Acked-by: Tom Zanussi <tzanussi@gmail.com> Acked-by: Frederic Weisbecker <fweisbec@gmail.com> Cc: Steven Rostedt <rostedt@goodmis.org> LKML-Reference: <49E04C53.4010600@cn.fujitsu.com> Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'kernel')
-rw-r--r--kernel/trace/trace_events_filter.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/kernel/trace/trace_events_filter.c b/kernel/trace/trace_events_filter.c
index 9d2162fd2305..49b3ef54ec46 100644
--- a/kernel/trace/trace_events_filter.c
+++ b/kernel/trace/trace_events_filter.c
@@ -419,12 +419,13 @@ int filter_parse(char **pbuf, struct filter_pred *pred)
419 if (!pred->field_name) 419 if (!pred->field_name)
420 return -ENOMEM; 420 return -ENOMEM;
421 421
422 pred->val = simple_strtoull(val_str, &tmp, 10); 422 pred->val = simple_strtoull(val_str, &tmp, 0);
423 if (tmp == val_str) { 423 if (tmp == val_str) {
424 pred->str_val = kstrdup(val_str, GFP_KERNEL); 424 pred->str_val = kstrdup(val_str, GFP_KERNEL);
425 if (!pred->str_val) 425 if (!pred->str_val)
426 return -ENOMEM; 426 return -ENOMEM;
427 } 427 } else if (*tmp != '\0')
428 return -EINVAL;
428 429
429 return 0; 430 return 0;
430} 431}