diff options
author | James Dominic P. Guana <guana.histark@gmail.com> | 2020-05-23 08:26:34 +0800 |
---|---|---|
committer | Robert Roth <robert.roth.off@gmail.com> | 2020-11-04 13:38:03 +0000 |
commit | 9e62440b314fbf87bbeca865a4223311314c52a3 (patch) | |
tree | a2d4e2598e52ba8863182d76515caaed1dce65ab /sysdeps/common | |
parent | d49e17039e5ba43ab22e284b9764842011909984 (diff) | |
download | libgtop-9e62440b314fbf87bbeca865a4223311314c52a3.tar.gz |
New API to retrieve disk stats in Linux
Diffstat (limited to 'sysdeps/common')
-rw-r--r-- | sysdeps/common/default.c | 14 | ||||
-rw-r--r-- | sysdeps/common/sysdeps_suid.c | 3 |
2 files changed, 17 insertions, 0 deletions
diff --git a/sysdeps/common/default.c b/sysdeps/common/default.c index e3b096f2..c20f2938 100644 --- a/sysdeps/common/default.c +++ b/sysdeps/common/default.c @@ -65,6 +65,20 @@ glibtop_get_cpu(glibtop_cpu *buf) /** + * glibtop_get_disk: + * @buf: A location to return the disk usage. + * + * Get the DISK usage. + * + */ +void +glibtop_get_cpu(glibtop_cpu *buf) +{ + glibtop_get_cpu_l(glibtop_global_server, buf); +} + + +/** * glibtop_get_fsusage: * @buf: A location to return the file system usage. * @mount_dir: mount dir where to get the information of usage. diff --git a/sysdeps/common/sysdeps_suid.c b/sysdeps/common/sysdeps_suid.c index 24953176..ecb1d53e 100644 --- a/sysdeps/common/sysdeps_suid.c +++ b/sysdeps/common/sysdeps_suid.c @@ -30,6 +30,9 @@ const _glibtop_init_func_t _glibtop_init_hook_p [] = { #if GLIBTOP_SUID_CPU _glibtop_init_cpu_p, #endif +#if GLIBTOP_SUID_DISK + _glibtop_init_disk_p, +#endif #if GLIBTOP_SUID_MEM _glibtop_init_mem_p, #endif |