Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752176AbZGJEEr (ORCPT ); Fri, 10 Jul 2009 00:04:47 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1750733AbZGJEEk (ORCPT ); Fri, 10 Jul 2009 00:04:40 -0400 Received: from wa-out-1112.google.com ([209.85.146.176]:15354 "EHLO wa-out-1112.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750696AbZGJEEk (ORCPT ); Fri, 10 Jul 2009 00:04:40 -0400 DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=subject:from:to:cc:in-reply-to:references:content-type:date :message-id:mime-version:x-mailer:content-transfer-encoding; b=xeYFX79BHdYMUeHLVnPbGb3M8up4ZMh8LHzEnnMA9ZjO0eqry4SpPrdQhSwkXqN+dq cxuytBqJA9eer22qUAeqQr6XNnkmHCIya12nd5A9HYdA2SHzjSS8pq+JhXdKIso4+p3h Cf+deq+4q8FMTTJl4rIjMGqJyWCapJFWupq10= Subject: Re: [PATCH 1/2] tracing/filter: remove preds from struct event_subsystem From: Tom Zanussi To: Xiao Guangrong Cc: Ingo Molnar , Frederic Weisbecker , Steven Rostedt , LKML In-Reply-To: <4A55A83C.1030005@cn.fujitsu.com> References: <4A55A83C.1030005@cn.fujitsu.com> Content-Type: text/plain Date: Thu, 09 Jul 2009 23:04:34 -0500 Message-Id: <1247198674.6229.1.camel@tropicana> Mime-Version: 1.0 X-Mailer: Evolution 2.24.1 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2994 Lines: 100 On Thu, 2009-07-09 at 16:20 +0800, Xiao Guangrong wrote: > No need to save preds to event_subsystem, because it's not used. > > Signed-off-by: Xiao Guangrong Makes sense to me. Acked-by: Tom Zanussi > --- > kernel/trace/trace_events_filter.c | 39 +++++------------------------------ > 1 files changed, 6 insertions(+), 33 deletions(-) > > diff --git a/kernel/trace/trace_events_filter.c b/kernel/trace/trace_events_filter.c > index 936c621..b9aae72 100644 > --- a/kernel/trace/trace_events_filter.c > +++ b/kernel/trace/trace_events_filter.c > @@ -420,17 +420,7 @@ EXPORT_SYMBOL_GPL(init_preds); > > static void filter_free_subsystem_preds(struct event_subsystem *system) > { > - struct event_filter *filter = system->filter; > struct ftrace_event_call *call; > - int i; > - > - if (filter->n_preds) { > - for (i = 0; i < filter->n_preds; i++) > - filter_free_pred(filter->preds[i]); > - kfree(filter->preds); > - filter->preds = NULL; > - filter->n_preds = 0; > - } > > list_for_each_entry(call, &ftrace_events, list) { > if (!call->define_fields) > @@ -607,26 +597,9 @@ static int filter_add_subsystem_pred(struct filter_parse_state *ps, > struct filter_pred *pred, > char *filter_string) > { > - struct event_filter *filter = system->filter; > struct ftrace_event_call *call; > int err = 0; > > - if (!filter->preds) { > - filter->preds = kzalloc(MAX_FILTER_PRED * sizeof(pred), > - GFP_KERNEL); > - > - if (!filter->preds) > - return -ENOMEM; > - } > - > - if (filter->n_preds == MAX_FILTER_PRED) { > - parse_error(ps, FILT_ERR_TOO_MANY_PREDS, 0); > - return -ENOSPC; > - } > - > - filter->preds[filter->n_preds] = pred; > - filter->n_preds++; > - > list_for_each_entry(call, &ftrace_events, list) { > > if (!call->define_fields) > @@ -1029,12 +1002,12 @@ static int replace_preds(struct event_subsystem *system, > > if (elt->op == OP_AND || elt->op == OP_OR) { > pred = create_logical_pred(elt->op); > - if (call) { > + if (call) > err = filter_add_pred(ps, call, pred); > - filter_free_pred(pred); > - } else > + else > err = filter_add_subsystem_pred(ps, system, > pred, filter_string); > + filter_free_pred(pred); > if (err) > return err; > > @@ -1048,12 +1021,12 @@ static int replace_preds(struct event_subsystem *system, > } > > pred = create_pred(elt->op, operand1, operand2); > - if (call) { > + if (call) > err = filter_add_pred(ps, call, pred); > - filter_free_pred(pred); > - } else > + else > err = filter_add_subsystem_pred(ps, system, pred, > filter_string); > + filter_free_pred(pred); > if (err) > return err; > -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/