From 5880e04fccef7c2e9a5f5a688e845bb1dc3b01a9 Mon Sep 17 00:00:00 2001 From: Robert Roth Date: Fri, 12 May 2017 05:14:17 +0300 Subject: Prepended disk io struct fields with disk_ prefix --- examples/diskio.c | 2 +- include/glibtop/procio.h | 24 ++++++++++++------------ sysdeps/linux/procio.c | 12 ++++++------ 3 files changed, 19 insertions(+), 19 deletions(-) diff --git a/examples/diskio.c b/examples/diskio.c index 112b4723..de6d775c 100644 --- a/examples/diskio.c +++ b/examples/diskio.c @@ -17,7 +17,7 @@ static void show_diskio(pid_t pid) printf("<%ld>\t", (long)pid); - printf("flags: %08lx rchar : %lu, wchar : %lu, read_bytes : %lu, write_bytes : %lu\n", (unsigned long)io.flags, io.rchar, io.wchar, io.rbytes, io.wbytes); + printf("flags: %08lx disk_rchar : %lu, disk_wchar : %lu, disk_read_bytes : %lu, disk_write_bytes : %lu\n", (unsigned long)io.flags, io.disk_rchar, io.disk_wchar, io.disk_rbytes, io.disk_wbytes); } diff --git a/include/glibtop/procio.h b/include/glibtop/procio.h index 48e2c617..5eb36595 100644 --- a/include/glibtop/procio.h +++ b/include/glibtop/procio.h @@ -27,10 +27,10 @@ G_BEGIN_DECLS -#define GLIBTOP_PROC_IO_RCHAR 0 -#define GLIBTOP_PROC_IO_WCHAR 1 -#define GLIBTOP_PROC_IO_RBYTES 2 -#define GLIBTOP_PROC_IO_WBYTES 3 +#define GLIBTOP_PROC_IO_DISK_RCHAR 0 +#define GLIBTOP_PROC_IO_DISK_WCHAR 1 +#define GLIBTOP_PROC_IO_DISK_RBYTES 2 +#define GLIBTOP_PROC_IO_DISK_WBYTES 3 #define GLIBTOP_MAX_PROC_IO 3 @@ -40,15 +40,15 @@ typedef struct _glibtop_proc_io glibtop_proc_io; /** * glibtop_proc_io: - * @rchar: The number of bytes which this task has caused to be read from storage. This + * @disk_rchar: The number of bytes which this task has caused to be read from storage. This * is simply the sum of bytes which this process passed to read() and pread(), also including tty IO, * and it is unaffected by whether or not actual physical disk IO was required. - * @wchar: The number of bytes which this task has caused, or shall cause to be written + * @disk_wchar: The number of bytes which this task has caused, or shall cause to be written * to disk. Similar caveats apply here as with rchar. - * @rbytes: Attempt to count the number of bytes which this process really did cause to + * @disk_rbytes: Attempt to count the number of bytes which this process really did cause to * be fetched from the storage layer. Done at the submit_bio() level, so it is * accurate for block-backed filesystems. - * @wbytes: Attempt to count the number of bytes which this process caused to be sent to + * @disk_wbytes: Attempt to count the number of bytes which this process caused to be sent to * the storage layer. This is done at page-dirtying time. * * Process disk io data filled by glibtop_get_proc_io(). @@ -59,10 +59,10 @@ struct _glibtop_proc_io /*< private >*/ guint64 flags; /*< public >*/ - guint64 rchar; - guint64 wchar; - guint64 rbytes; - guint64 wbytes; + guint64 disk_rchar; + guint64 disk_wchar; + guint64 disk_rbytes; + guint64 disk_wbytes; }; diff --git a/sysdeps/linux/procio.c b/sysdeps/linux/procio.c index 55a37fe9..2240022f 100644 --- a/sysdeps/linux/procio.c +++ b/sysdeps/linux/procio.c @@ -27,8 +27,8 @@ #include "glibtop_private.h" static const unsigned long _glibtop_sysdeps_proc_io = -(1L << GLIBTOP_PROC_IO_RCHAR) + (1L << GLIBTOP_PROC_IO_WCHAR) + -(1L << GLIBTOP_PROC_IO_RBYTES) + (1L << GLIBTOP_PROC_IO_WBYTES); +(1L << GLIBTOP_PROC_IO_DISK_RCHAR) + (1L << GLIBTOP_PROC_IO_DISK_WCHAR) + +(1L << GLIBTOP_PROC_IO_DISK_RBYTES) + (1L << GLIBTOP_PROC_IO_DISK_WBYTES); /* Init function. */ @@ -53,18 +53,18 @@ glibtop_get_proc_io_s (glibtop *server, glibtop_proc_io *buf, pid_t pid) return; p = skip_token (buffer); - buf->rchar = g_ascii_strtoull (p, &p, 10); + buf->disk_rchar = g_ascii_strtoull (p, &p, 10); p = skip_line (p); p = skip_token (p); - buf->wchar = g_ascii_strtoull (p, &p, 10); + buf->disk_wchar = g_ascii_strtoull (p, &p, 10); p = skip_line (p); p = skip_line (p); p = skip_line (p); p = skip_token (p); - buf->rbytes = g_ascii_strtoull (p, &p, 10); + buf->disk_rbytes = g_ascii_strtoull (p, &p, 10); p = skip_line (p); p = skip_token (p); - buf->wbytes = g_ascii_strtoull (p, &p, 10); + buf->disk_wbytes = g_ascii_strtoull (p, &p, 10); buf->flags = _glibtop_sysdeps_proc_io; } -- cgit v1.2.1