summaryrefslogtreecommitdiffstats
path: root/kernel/trace
diff options
context:
space:
mode:
authorSteven Rostedt <srostedt@redhat.com>2011-02-03 23:29:06 -0500
committerSteven Rostedt <rostedt@goodmis.org>2011-02-07 20:56:20 -0500
commit4defe682d81a4960b6840ee4ed1a36f9db77c7bd (patch)
tree57cb6ab5f8b3a552ed2e0b5a7989d23404bb6cea /kernel/trace
parent75b8e98263fdb0bfbdeba60d4db463259f1fe8a2 (diff)
downloadop-kernel-dev-4defe682d81a4960b6840ee4ed1a36f9db77c7bd.zip
op-kernel-dev-4defe682d81a4960b6840ee4ed1a36f9db77c7bd.tar.gz
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.c30
1 files changed, 7 insertions, 23 deletions
diff --git a/kernel/trace/trace_events_filter.c b/kernel/trace/trace_events_filter.c
index f5d335d..3249b4f 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)
struct filter_pred *pred;
int i;
- if (filter->preds) {
- if (filter->a_preds < n_preds) {
- /*
- * We need to reallocate.
- * We should have already have zeroed out
- * the pred count and called synchronized_sched()
- * to make sure no one is using the preds.
- */
- if (WARN_ON_ONCE(filter->n_preds)) {
- /* We need to reset it now */
- filter->n_preds = 0;
- synchronize_sched();
- }
- __free_preds(filter);
- }
- }
+ if (filter->preds)
+ __free_preds(filter);
+
+ filter->preds =
+ kzalloc(sizeof(*filter->preds) * n_preds, GFP_KERNEL);
- if (!filter->preds) {
- filter->preds =
- kzalloc(sizeof(*filter->preds) * n_preds, GFP_KERNEL);
- filter->a_preds = n_preds;
- }
if (!filter->preds)
return -ENOMEM;
- if (WARN_ON(filter->a_preds < n_preds))
- return -EINVAL;
+ filter->a_preds = n_preds;
+ filter->n_preds = 0;
for (i = 0; i < n_preds; i++) {
pred = &filter->preds[i];
OpenPOWER on IntegriCloud