diff options
author | Jaegeuk Kim <jaegeuk@kernel.org> | 2014-12-17 22:45:05 -0500 |
---|---|---|
committer | Jaegeuk Kim <jaegeuk@kernel.org> | 2015-01-09 20:02:24 -0500 |
commit | 63f92ddc8aee18838441179064338702a93326a9 (patch) | |
tree | 42cf7109edcebe2bebb8dca7f4419721a32231db | |
parent | cf04e8eb55290c7b836c36f0b4e1a8d0fe8ee275 (diff) |
f2fs: add f2fs_io_tracer support
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>
-rw-r--r-- | fs/f2fs/Kconfig | 10 | ||||
-rw-r--r-- | fs/f2fs/Makefile | 1 | ||||
-rw-r--r-- | fs/f2fs/trace.c | 24 | ||||
-rw-r--r-- | fs/f2fs/trace.h | 24 |
4 files changed, 59 insertions, 0 deletions
diff --git a/fs/f2fs/Kconfig b/fs/f2fs/Kconfig index 736a348509f7..94e2d2ffabe1 100644 --- a/fs/f2fs/Kconfig +++ b/fs/f2fs/Kconfig | |||
@@ -71,3 +71,13 @@ config F2FS_CHECK_FS | |||
71 | Enables BUG_ONs which check the filesystem consistency in runtime. | 71 | Enables BUG_ONs which check the filesystem consistency in runtime. |
72 | 72 | ||
73 | If you want to improve the performance, say N. | 73 | If you want to improve the performance, say N. |
74 | |||
75 | config F2FS_IO_TRACE | ||
76 | bool "F2FS IO tracer" | ||
77 | depends on F2FS_FS | ||
78 | depends on FUNCTION_TRACER | ||
79 | help | ||
80 | F2FS IO trace is based on a function trace, which gathers process | ||
81 | information and block IO patterns in the filesystem level. | ||
82 | |||
83 | If unsure, say N. | ||
diff --git a/fs/f2fs/Makefile b/fs/f2fs/Makefile index 2e35da12d292..d92397731db8 100644 --- a/fs/f2fs/Makefile +++ b/fs/f2fs/Makefile | |||
@@ -5,3 +5,4 @@ f2fs-y += checkpoint.o gc.o data.o node.o segment.o recovery.o | |||
5 | f2fs-$(CONFIG_F2FS_STAT_FS) += debug.o | 5 | f2fs-$(CONFIG_F2FS_STAT_FS) += debug.o |
6 | f2fs-$(CONFIG_F2FS_FS_XATTR) += xattr.o | 6 | f2fs-$(CONFIG_F2FS_FS_XATTR) += xattr.o |
7 | f2fs-$(CONFIG_F2FS_FS_POSIX_ACL) += acl.o | 7 | f2fs-$(CONFIG_F2FS_FS_POSIX_ACL) += acl.o |
8 | f2fs-$(CONFIG_F2FS_IO_TRACE) += trace.o | ||
diff --git a/fs/f2fs/trace.c b/fs/f2fs/trace.c new file mode 100644 index 000000000000..4e4a0691d32f --- /dev/null +++ b/fs/f2fs/trace.c | |||
@@ -0,0 +1,24 @@ | |||
1 | /* | ||
2 | * f2fs IO tracer | ||
3 | * | ||
4 | * Copyright (c) 2014 Motorola Mobility | ||
5 | * Copyright (c) 2014 Jaegeuk Kim <jaegeuk@kernel.org> | ||
6 | * | ||
7 | * This program is free software; you can redistribute it and/or modify | ||
8 | * it under the terms of the GNU General Public License version 2 as | ||
9 | * published by the Free Software Foundation. | ||
10 | */ | ||
11 | #include <linux/fs.h> | ||
12 | #include <linux/f2fs_fs.h> | ||
13 | #include <linux/sched.h> | ||
14 | |||
15 | #include "f2fs.h" | ||
16 | #include "trace.h" | ||
17 | |||
18 | void f2fs_trace_pid(struct page *page) | ||
19 | { | ||
20 | } | ||
21 | |||
22 | void f2fs_trace_ios(struct page *page, struct f2fs_io_info *fio, int flush) | ||
23 | { | ||
24 | } | ||
diff --git a/fs/f2fs/trace.h b/fs/f2fs/trace.h new file mode 100644 index 000000000000..08856a978d6b --- /dev/null +++ b/fs/f2fs/trace.h | |||
@@ -0,0 +1,24 @@ | |||
1 | /* | ||
2 | * f2fs IO tracer | ||
3 | * | ||
4 | * Copyright (c) 2014 Motorola Mobility | ||
5 | * Copyright (c) 2014 Jaegeuk Kim <jaegeuk@kernel.org> | ||
6 | * | ||
7 | * This program is free software; you can redistribute it and/or modify | ||
8 | * it under the terms of the GNU General Public License version 2 as | ||
9 | * published by the Free Software Foundation. | ||
10 | */ | ||
11 | #ifndef __F2FS_TRACE_H__ | ||
12 | #define __F2FS_TRACE_H__ | ||
13 | |||
14 | #ifdef CONFIG_F2FS_IO_TRACE | ||
15 | #include <trace/events/f2fs.h> | ||
16 | |||
17 | extern void f2fs_trace_pid(struct page *); | ||
18 | extern void f2fs_trace_ios(struct page *, struct f2fs_io_info *, int); | ||
19 | #else | ||
20 | #define f2fs_trace_pid(p) | ||
21 | #define f2fs_trace_ios(p, i, n) | ||
22 | |||
23 | #endif | ||
24 | #endif /* __F2FS_TRACE_H__ */ | ||