f2fs: add f2fs_io_tracer support
authorJaegeuk Kim <jaegeuk@kernel.org>
Thu, 18 Dec 2014 03:45:05 +0000 (19:45 -0800)
committerJaegeuk Kim <jaegeuk@kernel.org>
Sat, 10 Jan 2015 01:02:24 +0000 (17:02 -0800)
This patch adds:
 o initial trace.c and trace.h with skeleton functions
 o Kconfig and Makefile to activate this feature

Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
fs/f2fs/Kconfig
fs/f2fs/Makefile
fs/f2fs/trace.c [new file with mode: 0644]
fs/f2fs/trace.h [new file with mode: 0644]

index 736a348509f7d6cfc6041d4e7f8838972c3413e3..94e2d2ffabe1a18d747fcccbe360b74389490ad0 100644 (file)
@@ -71,3 +71,13 @@ config F2FS_CHECK_FS
          Enables BUG_ONs which check the filesystem consistency in runtime.
 
          If you want to improve the performance, say N.
+
+config F2FS_IO_TRACE
+       bool "F2FS IO tracer"
+       depends on F2FS_FS
+       depends on FUNCTION_TRACER
+       help
+         F2FS IO trace is based on a function trace, which gathers process
+         information and block IO patterns in the filesystem level.
+
+         If unsure, say N.
index 2e35da12d292e48b59985f499c87d13fb32388e9..d92397731db846fd221e78027356d58dea5cf13e 100644 (file)
@@ -5,3 +5,4 @@ f2fs-y          += checkpoint.o gc.o data.o node.o segment.o recovery.o
 f2fs-$(CONFIG_F2FS_STAT_FS) += debug.o
 f2fs-$(CONFIG_F2FS_FS_XATTR) += xattr.o
 f2fs-$(CONFIG_F2FS_FS_POSIX_ACL) += acl.o
+f2fs-$(CONFIG_F2FS_IO_TRACE) += trace.o
diff --git a/fs/f2fs/trace.c b/fs/f2fs/trace.c
new file mode 100644 (file)
index 0000000..4e4a069
--- /dev/null
@@ -0,0 +1,24 @@
+/*
+ * f2fs IO tracer
+ *
+ * Copyright (c) 2014 Motorola Mobility
+ * Copyright (c) 2014 Jaegeuk Kim <jaegeuk@kernel.org>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+#include <linux/fs.h>
+#include <linux/f2fs_fs.h>
+#include <linux/sched.h>
+
+#include "f2fs.h"
+#include "trace.h"
+
+void f2fs_trace_pid(struct page *page)
+{
+}
+
+void f2fs_trace_ios(struct page *page, struct f2fs_io_info *fio, int flush)
+{
+}
diff --git a/fs/f2fs/trace.h b/fs/f2fs/trace.h
new file mode 100644 (file)
index 0000000..08856a9
--- /dev/null
@@ -0,0 +1,24 @@
+/*
+ * f2fs IO tracer
+ *
+ * Copyright (c) 2014 Motorola Mobility
+ * Copyright (c) 2014 Jaegeuk Kim <jaegeuk@kernel.org>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+#ifndef __F2FS_TRACE_H__
+#define __F2FS_TRACE_H__
+
+#ifdef CONFIG_F2FS_IO_TRACE
+#include <trace/events/f2fs.h>
+
+extern void f2fs_trace_pid(struct page *);
+extern void f2fs_trace_ios(struct page *, struct f2fs_io_info *, int);
+#else
+#define f2fs_trace_pid(p)
+#define f2fs_trace_ios(p, i, n)
+
+#endif
+#endif /* __F2FS_TRACE_H__ */
This page took 0.027339 seconds and 5 git commands to generate.