From: Xiao Guangrong <xiaoguangrong@cn.fujitsu.com>
To: Ingo Molnar <mingo@elte.hu>
Cc: Frederic Weisbecker <fweisbec@gmail.com>,
Steven Rostedt <rostedt@goodmis.org>,
Tom Zanussi <tzanussi@gmail.com>,
LKML <linux-kernel@vger.kernel.org>
Subject: [PATCH 1/2] tracing/filter: remove preds from struct event_subsystem
Date: Thu, 09 Jul 2009 16:20:12 +0800 [thread overview]
Message-ID: <4A55A83C.1030005@cn.fujitsu.com> (raw)
No need to save preds to event_subsystem, because it's not used.
Signed-off-by: Xiao Guangrong <xiaoguangrong@cn.fujitsu.com>
---
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;
--
1.6.1.2
next reply other threads:[~2009-07-09 8:20 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-07-09 8:20 Xiao Guangrong [this message]
2009-07-09 8:22 ` [PATCH 2/2] tracing/filter: remove empty subsystem and it's directory Xiao Guangrong
2009-07-10 4:06 ` Tom Zanussi
2009-07-10 5:28 ` Li Zefan
2009-07-10 10:41 ` [tip:tracing/core] tracing/filter: Remove empty subsystem and its directory tip-bot for Xiao Guangrong
2009-07-14 17:00 ` Steven Rostedt
2009-07-10 4:04 ` [PATCH 1/2] tracing/filter: remove preds from struct event_subsystem Tom Zanussi
2009-07-10 5:23 ` Li Zefan
2009-07-10 10:41 ` [tip:tracing/core] tracing/filter: Remove " tip-bot for Xiao Guangrong
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4A55A83C.1030005@cn.fujitsu.com \
--to=xiaoguangrong@cn.fujitsu.com \
--cc=fweisbec@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=rostedt@goodmis.org \
--cc=tzanussi@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox