summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Roth <robert.roth.off@gmail.com>2017-05-12 05:14:17 +0300
committerRobert Roth <robert.roth.off@gmail.com>2017-05-12 05:14:17 +0300
commit5880e04fccef7c2e9a5f5a688e845bb1dc3b01a9 (patch)
treedf13c52c94c3a3bf405f056e4ee9306fe6f62c4d
parent1bf16bfffd28e6724c35589e49db10a10cae594d (diff)
downloadlibgtop-5880e04fccef7c2e9a5f5a688e845bb1dc3b01a9.tar.gz
Prepended disk io struct fields with disk_ prefix
-rw-r--r--examples/diskio.c2
-rw-r--r--include/glibtop/procio.h24
-rw-r--r--sysdeps/linux/procio.c12
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;
}