[ltt-dev] [PATCH v3 4/4] Move ltt_root_dentry to ltt-core.c and export it

Zhaolei zhaolei at cn.fujitsu.com
Tue Nov 11 04:00:48 EST 2008


ltt_root_dentry is necessary for ltt-trace-control to create
subdirs in ltt's debugfs dir.
Todo:
  Create ltt_root_dentry in ltt-core.c or ltt-trace.c
  (now in ltt-relay.c)

Signed-off-by: Zhao Lei <zhaolei at cn.fujitsu.com>
---
 include/linux/ltt-core.h |    5 +++++
 ltt/ltt-core.c           |    3 +++
 ltt/ltt-relay-locked.c   |    1 -
 ltt/ltt-relay.c          |    1 -
 4 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/include/linux/ltt-core.h b/include/linux/ltt-core.h
index 7e5ee8b..26ce779 100644
--- a/include/linux/ltt-core.h
+++ b/include/linux/ltt-core.h
@@ -24,6 +24,11 @@ struct ltt_traces {
 
 extern struct ltt_traces ltt_traces;
 
+/*
+ * exported ltt's debugfs dir for other control interface module
+ */
+extern struct dentry *ltt_root_dentry;
+
 /* Keep track of trap nesting inside LTT */
 DECLARE_PER_CPU(unsigned int, ltt_nesting);
 
diff --git a/ltt/ltt-core.c b/ltt/ltt-core.c
index aaad358..6b73a2f 100644
--- a/ltt/ltt-core.c
+++ b/ltt/ltt-core.c
@@ -20,6 +20,9 @@ EXPORT_SYMBOL(ltt_traces);
 /* Traces list writer locking */
 static DEFINE_MUTEX(ltt_traces_mutex);
 
+struct dentry *ltt_root_dentry;
+EXPORT_SYMBOL_GPL(ltt_root_dentry);
+
 void ltt_lock_traces(void)
 {
 	mutex_lock(&ltt_traces_mutex);
diff --git a/ltt/ltt-relay-locked.c b/ltt/ltt-relay-locked.c
index 393097e..04c5450 100644
--- a/ltt/ltt-relay-locked.c
+++ b/ltt/ltt-relay-locked.c
@@ -122,7 +122,6 @@ static inline int last_tsc_overflow(struct ltt_channel_buf_struct *ltt_buf,
 }
 #endif
 
-static struct dentry *ltt_root_dentry;
 static struct file_operations ltt_file_operations;
 
 /*
diff --git a/ltt/ltt-relay.c b/ltt/ltt-relay.c
index 379018d..fdfadb4 100644
--- a/ltt/ltt-relay.c
+++ b/ltt/ltt-relay.c
@@ -131,7 +131,6 @@ static inline int last_tsc_overflow(struct ltt_channel_buf_struct *ltt_buf,
 }
 #endif
 
-static struct dentry *ltt_root_dentry;
 static struct file_operations ltt_file_operations;
 
 /*
-- 
1.5.5.3






More information about the lttng-dev mailing list