[Ocfs2-devel] [PATCH 4/5] ocfs2: Add ocfs2_trace.h.

Tao Ma tao.ma at oracle.com
Tue Nov 9 18:52:22 PST 2010


About one year ago, Wengang Wang tried some first steps
to add tracepoints to ocfs2. But at that time we don't
have ocfs2 1.6 introduced, so we delay this work until now
after ocfs2 1.6 and UEK(Unbreakable Enterprise Kernel) are
released.

Wengang's original patch is here:
http://oss.oracle.com/pipermail/ocfs2-devel/2009-November/005512.html

But as Steven Rostedt indicated in his article
http://lwn.net/Articles/383362/, we'd better have our trace
files resides in fs/ocfs2, so I rewrited the patch using the
method Steven mentioned in that article.

Signed-off-by: Wengang Wang <wen.gang.wang at oracle.com>
Signed-off-by: Tao Ma <tao.ma at oracle.com>
---
 fs/ocfs2/ocfs2_trace.h |   16 ++++++++++++++++
 fs/ocfs2/super.c       |    3 +++
 2 files changed, 19 insertions(+), 0 deletions(-)
 create mode 100644 fs/ocfs2/ocfs2_trace.h

diff --git a/fs/ocfs2/ocfs2_trace.h b/fs/ocfs2/ocfs2_trace.h
new file mode 100644
index 0000000..8d4e49a
--- /dev/null
+++ b/fs/ocfs2/ocfs2_trace.h
@@ -0,0 +1,16 @@
+#undef TRACE_SYSTEM
+#define TRACE_SYSTEM ocfs2
+
+#if !defined(_TRACE_OCFS2_H) || defined(TRACE_HEADER_MULTI_READ)
+#define _TRACE_OCFS2_H
+
+#include <linux/tracepoint.h>
+
+
+#endif /* _TRACE_OCFS2_H */
+
+/* This part must be outside protection */
+#undef TRACE_INCLUDE_PATH
+#define TRACE_INCLUDE_PATH .
+#define TRACE_INCLUDE_FILE ocfs2_trace
+#include <trace/define_trace.h>
diff --git a/fs/ocfs2/super.c b/fs/ocfs2/super.c
index 21eb934..d592a6e 100644
--- a/fs/ocfs2/super.c
+++ b/fs/ocfs2/super.c
@@ -43,6 +43,9 @@
 #include <linux/quotaops.h>
 #include <linux/smp_lock.h>
 
+#define CREATE_TRACE_POINTS
+#include "ocfs2_trace.h"
+
 #define MLOG_MASK_PREFIX ML_SUPER
 #include <cluster/masklog.h>
 
-- 
1.7.1.GIT




More information about the Ocfs2-devel mailing list