From dff7c5588e9761224f2811f0ce5792ff93d95e29 Mon Sep 17 00:00:00 2001 From: Robert Roth Date: Sun, 12 Feb 2017 17:59:08 +0200 Subject: New API to retrieve process io stats, with Linux implementation --- sysdeps/common/default.c | 15 +++++++++++++++ sysdeps/common/sysdeps_suid.c | 3 +++ 2 files changed, 18 insertions(+) (limited to 'sysdeps/common') diff --git a/sysdeps/common/default.c b/sysdeps/common/default.c index 2df25ee6..6987fb20 100644 --- a/sysdeps/common/default.c +++ b/sysdeps/common/default.c @@ -431,3 +431,18 @@ glibtop_get_proc_affinity(glibtop_proc_affinity *buf, pid_t pid) { return glibtop_get_proc_affinity_l(glibtop_global_server, buf, pid); } + +/** + * glibtop_get_proc_diskio: Get the disk io stats for the given pid + * @buf: Buffer where the result will be given + * @pid: Process id to get the io stats for + * + * Get the io stats for a process + * + * Returns: A list of processor ID of 'buf.number' elements. + */ +void +glibtop_get_proc_diskio(glibtop_proc_diskio *buf, pid_t pid) +{ + return glibtop_get_proc_diskio_l(glibtop_global_server, buf, pid); +} diff --git a/sysdeps/common/sysdeps_suid.c b/sysdeps/common/sysdeps_suid.c index 91ff806c..70dd2256 100644 --- a/sysdeps/common/sysdeps_suid.c +++ b/sysdeps/common/sysdeps_suid.c @@ -89,6 +89,9 @@ const _glibtop_init_func_t _glibtop_init_hook_p [] = { #endif #if GLIBTOP_SUID_PPP _glibtop_init_ppp_p, +#endif +#if GLIBTOP_SUID_PROC_DISKIO + _glibtop_init_proc_diskio_p, #endif NULL }; -- cgit v1.2.1 From 1bf16bfffd28e6724c35589e49db10a10cae594d Mon Sep 17 00:00:00 2001 From: Robert Roth Date: Fri, 12 May 2017 05:08:41 +0300 Subject: Renamed procdiskio to procio --- sysdeps/common/default.c | 6 +++--- sysdeps/common/sysdeps_suid.c | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) (limited to 'sysdeps/common') diff --git a/sysdeps/common/default.c b/sysdeps/common/default.c index 6987fb20..e3b096f2 100644 --- a/sysdeps/common/default.c +++ b/sysdeps/common/default.c @@ -433,7 +433,7 @@ glibtop_get_proc_affinity(glibtop_proc_affinity *buf, pid_t pid) } /** - * glibtop_get_proc_diskio: Get the disk io stats for the given pid + * glibtop_get_proc_io: Get the io stats for the given pid * @buf: Buffer where the result will be given * @pid: Process id to get the io stats for * @@ -442,7 +442,7 @@ glibtop_get_proc_affinity(glibtop_proc_affinity *buf, pid_t pid) * Returns: A list of processor ID of 'buf.number' elements. */ void -glibtop_get_proc_diskio(glibtop_proc_diskio *buf, pid_t pid) +glibtop_get_proc_io(glibtop_proc_io *buf, pid_t pid) { - return glibtop_get_proc_diskio_l(glibtop_global_server, buf, pid); + return glibtop_get_proc_io_l(glibtop_global_server, buf, pid); } diff --git a/sysdeps/common/sysdeps_suid.c b/sysdeps/common/sysdeps_suid.c index 70dd2256..24953176 100644 --- a/sysdeps/common/sysdeps_suid.c +++ b/sysdeps/common/sysdeps_suid.c @@ -90,8 +90,8 @@ const _glibtop_init_func_t _glibtop_init_hook_p [] = { #if GLIBTOP_SUID_PPP _glibtop_init_ppp_p, #endif -#if GLIBTOP_SUID_PROC_DISKIO - _glibtop_init_proc_diskio_p, +#if GLIBTOP_SUID_PROC_IO + _glibtop_init_proc_io_p, #endif NULL }; -- cgit v1.2.1