summaryrefslogtreecommitdiff
path: root/fs/f2fs/iostat.h
diff options
context:
space:
mode:
authorDaeho Jeong <daehojeong@google.com>2021-08-19 20:52:28 -0700
committerJaegeuk Kim <jaegeuk@kernel.org>2021-08-23 10:25:51 -0700
commit521187439abfb3e1c946796dc2187c443e5457ab (patch)
treefce6c67e0ba999bb4ab8f3463dccf8f005c77be5 /fs/f2fs/iostat.h
parentbbe1da7e34ac5a830163bfdfa09cbe3dadfda3ce (diff)
f2fs: separate out iostat feature
Added F2FS_IOSTAT config option to support getting IO statistics through sysfs and printing out periodic IO statistics tracepoint events and moved I/O statistics related codes into separate files for better maintenance. Signed-off-by: Daeho Jeong <daehojeong@google.com> Reviewed-by: Chao Yu <chao@kernel.org> [Jaegeuk Kim: set default=y] Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Diffstat (limited to 'fs/f2fs/iostat.h')
-rw-r--r--fs/f2fs/iostat.h27
1 files changed, 27 insertions, 0 deletions
diff --git a/fs/f2fs/iostat.h b/fs/f2fs/iostat.h
new file mode 100644
index 000000000000..46e4a36fc8e9
--- /dev/null
+++ b/fs/f2fs/iostat.h
@@ -0,0 +1,27 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+/*
+ * Copyright 2021 Google LLC
+ * Author: Daeho Jeong <daehojeong@google.com>
+ */
+#ifndef __F2FS_IOSTAT_H__
+#define __F2FS_IOSTAT_H__
+
+#ifdef CONFIG_F2FS_IOSTAT
+
+#define DEFAULT_IOSTAT_PERIOD_MS 3000
+#define MIN_IOSTAT_PERIOD_MS 100
+/* maximum period of iostat tracing is 1 day */
+#define MAX_IOSTAT_PERIOD_MS 8640000
+
+extern int __maybe_unused iostat_info_seq_show(struct seq_file *seq,
+ void *offset);
+extern void f2fs_reset_iostat(struct f2fs_sb_info *sbi);
+extern void f2fs_update_iostat(struct f2fs_sb_info *sbi,
+ enum iostat_type type, unsigned long long io_bytes);
+extern int f2fs_init_iostat(struct f2fs_sb_info *sbi);
+#else
+static inline void f2fs_update_iostat(struct f2fs_sb_info *sbi,
+ enum iostat_type type, unsigned long long io_bytes) {}
+static inline int f2fs_init_iostat(struct f2fs_sb_info *sbi) { return 0; }
+#endif
+#endif /* __F2FS_IOSTAT_H__ */