Add I/O statistics to e2fsck
This patch instruments the libext2fs unix I/O manager and adds bytes
read/written and data rate to e2fsck -tt pass/overall timing output.
Signed-off-by: Jim Garlick <garlick@llnl.gov>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
diff --git a/lib/ext2fs/ext2_io.h b/lib/ext2fs/ext2_io.h
index eada278..bee75a6 100644
--- a/lib/ext2fs/ext2_io.h
+++ b/lib/ext2fs/ext2_io.h
@@ -26,6 +26,7 @@
typedef struct struct_io_manager *io_manager;
typedef struct struct_io_channel *io_channel;
+typedef struct struct_io_stats *io_stats;
#define CHANNEL_FLAGS_WRITETHROUGH 0x01
@@ -55,6 +56,13 @@
void *app_data;
};
+struct struct_io_stats {
+ int num_fields;
+ int reserved;
+ unsigned long long bytes_read;
+ unsigned long long bytes_written;
+};
+
struct struct_io_manager {
errcode_t magic;
const char *name;
@@ -70,6 +78,7 @@
int count, const void *data);
errcode_t (*set_option)(io_channel channel, const char *option,
const char *arg);
+ errcode_t (*get_stats)(io_channel channel, io_stats *io_stats);
int reserved[14];
};