[ltt-dev] [PATCH 2/3] Change ltt_run_filter_functor arguments to support in-kernel filter

Zhaolei zhaolei at cn.fujitsu.com
Sun Mar 29 04:43:41 EDT 2009


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






More information about the lttng-dev mailing list