diff options
| author | Steven Rostedt <srostedt@redhat.com> | 2011-02-03 23:29:06 -0500 |
|---|---|---|
| committer | Steven Rostedt <rostedt@goodmis.org> | 2011-02-07 20:56:20 -0500 |
| commit | 4defe682d81a4960b6840ee4ed1a36f9db77c7bd (patch) | |
| tree | 57cb6ab5f8b3a552ed2e0b5a7989d23404bb6cea /kernel/trace | |
| parent | 75b8e98263fdb0bfbdeba60d4db463259f1fe8a2 (diff) | |
tracing/filter: Remove synchronize_sched() from __alloc_preds()
Because the filters are processed first and then activated
(added to the call), we no longer need to worry about the preds
of the filter in __alloc_preds() being used. As the filter that
is allocating preds is not activated yet.
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
Diffstat (limited to 'kernel/trace')
| -rw-r--r-- | kernel/trace/trace_events_filter.c | 30 |
1 files changed, 7 insertions, 23 deletions
diff --git a/kernel/trace/trace_events_filter.c b/kernel/trace/trace_events_filter.c index f5d335d28d0b..3249b4f77ef0 100644 --- a/kernel/trace/trace_events_filter.c +++ b/kernel/trace/trace_events_filter.c | |||
| @@ -795,33 +795,17 @@ static int __alloc_preds(struct event_filter *filter, int n_preds) | |||
| 795 | struct filter_pred *pred; | 795 | struct filter_pred *pred; |
| 796 | int i; | 796 | int i; |
| 797 | 797 | ||
| 798 | if (filter->preds) { | 798 | if (filter->preds) |
| 799 | if (filter->a_preds < n_preds) { | 799 | __free_preds(filter); |
| 800 | /* | 800 | |
| 801 | * We need to reallocate. | 801 | filter->preds = |
| 802 | * We should have already have zeroed out | 802 | kzalloc(sizeof(*filter->preds) * n_preds, GFP_KERNEL); |
| 803 | * the pred count and called synchronized_sched() | ||
| 804 | * to make sure no one is using the preds. | ||
| 805 | */ | ||
| 806 | if (WARN_ON_ONCE(filter->n_preds)) { | ||
| 807 | /* We need to reset it now */ | ||
| 808 | filter->n_preds = 0; | ||
| 809 | synchronize_sched(); | ||
| 810 | } | ||
| 811 | __free_preds(filter); | ||
| 812 | } | ||
| 813 | } | ||
| 814 | 803 | ||
| 815 | if (!filter->preds) { | ||
| 816 | filter->preds = | ||
| 817 | kzalloc(sizeof(*filter->preds) * n_preds, GFP_KERNEL); | ||
| 818 | filter->a_preds = n_preds; | ||
| 819 | } | ||
| 820 | if (!filter->preds) | 804 | if (!filter->preds) |
| 821 | return -ENOMEM; | 805 | return -ENOMEM; |
| 822 | 806 | ||
| 823 | if (WARN_ON(filter->a_preds < n_preds)) | 807 | filter->a_preds = n_preds; |
| 824 | return -EINVAL; | 808 | filter->n_preds = 0; |
| 825 | 809 | ||
| 826 | for (i = 0; i < n_preds; i++) { | 810 | for (i = 0; i < n_preds; i++) { |
| 827 | pred = &filter->preds[i]; | 811 | pred = &filter->preds[i]; |
