Mirror of the lttng-dev mailing list
 help / color / mirror / Atom feed
From: zhaolei@cn.fujitsu.com (Zhaolei)
Subject: [ltt-dev] [PATCH 2/3] Change ltt_run_filter_functor arguments to support in-kernel filter
Date: Sun, 29 Mar 2009 16:43:41 +0800	[thread overview]
Message-ID: <49CF34BD.9070705@cn.fujitsu.com> (raw)
In-Reply-To: <49CF3437.50407@cn.fujitsu.com>

In-kernel filter need trace, marker and arguments information to
determine if to allow event output.
So we add these information to ltt_run_filter_functor's arguments.

Signed-off-by: Zhao Lei <zhaolei at cn.fujitsu.com>
---
 include/linux/ltt-core.h  |    5 ++++-
 ltt/ltt-core.c            |    3 ++-
 ltt/ltt-serialize.c       |    2 +-
 ltt/ltt-type-serializer.c |   10 ++++++++--
 4 files changed, 15 insertions(+), 5 deletions(-)

diff --git a/include/linux/ltt-core.h b/include/linux/ltt-core.h
index b666ad2..a59fad7 100644
--- a/include/linux/ltt-core.h
+++ b/include/linux/ltt-core.h
@@ -37,7 +37,10 @@ void put_ltt_root(void);
 /* Keep track of trap nesting inside LTT */
 DECLARE_PER_CPU(unsigned int, ltt_nesting);
 
-typedef int (*ltt_run_filter_functor)(void *trace, uint16_t eID);
+struct marker;
+struct ltt_trace_struct;
+typedef int (*ltt_run_filter_functor)(struct ltt_trace_struct *trace,
+		const struct marker *mdata, va_list *args);
 
 extern ltt_run_filter_functor ltt_run_filter;
 
diff --git a/ltt/ltt-core.c b/ltt/ltt-core.c
index 3556738..90e50ae 100644
--- a/ltt/ltt-core.c
+++ b/ltt/ltt-core.c
@@ -79,7 +79,8 @@ EXPORT_SYMBOL_GPL(ltt_unlock_traces);
 DEFINE_PER_CPU(unsigned int, ltt_nesting);
 EXPORT_PER_CPU_SYMBOL(ltt_nesting);
 
-int ltt_run_filter_default(void *trace, uint16_t eID)
+int ltt_run_filter_default(struct ltt_trace_struct *trace,
+		const struct marker *mdata, va_list *args)
 {
 	return 1;
 }
diff --git a/ltt/ltt-serialize.c b/ltt/ltt-serialize.c
index 77f6317..f706664 100644
--- a/ltt/ltt-serialize.c
+++ b/ltt/ltt-serialize.c
@@ -849,7 +849,7 @@ notrace void ltt_vtrace(const struct marker *mdata, void *probe_data,
 			continue;
 		if (unlikely(!trace->active))
 			continue;
-		if (unlikely(!ltt_run_filter(trace, eID)))
+		if (unlikely(!ltt_run_filter(trace, mdata, args)))
 			continue;
 #ifdef CONFIG_LTT_DEBUG_EVENT_SIZE
 		rflags = LTT_RFLAG_ID_SIZE;
diff --git a/ltt/ltt-type-serializer.c b/ltt/ltt-type-serializer.c
index ebf9cb6..38c9130 100644
--- a/ltt/ltt-type-serializer.c
+++ b/ltt/ltt-type-serializer.c
@@ -48,8 +48,14 @@ notrace void _ltt_specialized_trace(const struct marker *mdata,
 	__list_for_each_entry_rcu(trace, &ltt_traces.head, list) {
 		if (unlikely(!trace->active))
 			continue;
-		if (unlikely(!ltt_run_filter(trace, eID)))
-			continue;
+	/*
+	 * specialized trace filter is temporarily disabled
+	 * because we are implement a generic filter which can't
+	 * support specialized trace now.
+	 *
+	 * if (unlikely(!ltt_run_filter(trace, eID)))
+	 *      continue;
+	 */
 #ifdef CONFIG_LTT_DEBUG_EVENT_SIZE
 		rflags = LTT_RFLAG_ID_SIZE;
 #else
-- 
1.5.5.3






  parent reply	other threads:[~2009-03-29  8:43 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <49646F42.5040003@cn.fujitsu.com>
2009-01-07 17:05 ` [ltt-dev] lttng development plan Mathieu Desnoyers
2009-01-19  3:43   ` Lai Jiangshan
2009-01-20  1:55     ` Mathieu Desnoyers
2009-01-20  6:58       ` Lai Jiangshan
2009-01-23  3:21         ` KOSAKI Motohiro
2009-01-23  3:21       ` KOSAKI Motohiro
2009-01-23  4:49         ` Mathieu Desnoyers
2009-02-02  4:59   ` Gui Jianfeng
2009-02-03  5:11     ` Mathieu Desnoyers
2009-02-11  6:33       ` Zhaolei
2009-02-11  6:50         ` Mathieu Desnoyers
2009-02-11  7:24           ` Zhaolei
2009-02-11  7:37             ` Mathieu Desnoyers
2009-02-19  8:17               ` Zhaolei
2009-03-02  7:01                 ` Zhaolei
2009-03-03 19:25                   ` Mathieu Desnoyers
2009-03-29  8:41                     ` [ltt-dev] [PATCH 0/3] In-kernel filter module Zhaolei
2009-03-29  8:42                       ` [ltt-dev] [PATCH 1/3] Remove old per-type filter Zhaolei
2009-03-29  8:43                       ` Zhaolei [this message]
2009-03-29  8:44                       ` [ltt-dev] [PATCH 3/3] In-kernel filter module Zhaolei
2009-04-06 17:52                         ` Mathieu Desnoyers
2009-04-07  5:45                           ` Zhaolei
2009-04-07 16:48                             ` Mathieu Desnoyers
2009-04-08  3:19                               ` Zhaolei

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=49CF34BD.9070705@cn.fujitsu.com \
    --to=zhaolei@cn.fujitsu.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