read, write values in glibtop_fsusage are in units of sectors, not block size
Submitted by MT
Link to original bug (#672995)
Description
The read and write counters should show the number of blocks read. But on Linux systems (I haven't verified for other platforms), the values are parsed via the sysfs interface and are in units of 512-byte sectors, not the standard 4096-byte block size. So either the code in sysdeps/linux/fsusage.c, or the comment description of the read and write variables, needs to be corrected to avoid any confusion.
From include/glibtop/fsusage.h:
struct _glibtop_fsusage { guint64 flags; guint64 blocks; /* Total number of blocks. / guint64 bfree; / Free blocks available to superuser. / guint64 bavail; / Free blocks available to non-superuser. / guint64 files; / Total file nodes. / guint64 ffree; / Free file nodes. / guint32 block_size; / Size of a block in bytes. / guint64 read, write; / Total blocks read and written */ };
From the kernel documentation (block/stat.txt):
read sectors, write sectors
These values count the number of sectors read from or written to this block device. The "sectors" in question are the standard UNIX 512-byte sectors, not any device- or filesystem-specific block size. The counters are incremented when the I/O completes.