summaryrefslogtreecommitdiffstats
path: root/linux
diff options
context:
space:
mode:
authorChristian Goettsche <cgzones@googlemail.com>2020-10-21 17:06:32 +0200
committercgzones <cgzones@googlemail.com>2020-10-29 22:21:42 +0100
commitc2fdfd99eb5bffee0f6d1e1838fb4708eac18425 (patch)
treeeee28e177708eb99f14c6aa6f67f818daaf69e18 /linux
parentc91061c84bcce51934f05df7a7ee4d219f01bc71 (diff)
FreeBSD: implement Platform_getDiskIO()
Diffstat (limited to 'linux')
-rw-r--r--linux/Platform.c8
-rw-r--r--linux/Platform.h5
2 files changed, 6 insertions, 7 deletions
diff --git a/linux/Platform.c b/linux/Platform.c
index f6f7ba19..fe9764ba 100644
--- a/linux/Platform.c
+++ b/linux/Platform.c
@@ -313,7 +313,7 @@ void Platform_getPressureStall(const char *file, bool some, double* ten, double*
fclose(fd);
}
-bool Platform_getDiskIO(unsigned long int *bytesRead, unsigned long int *bytesWrite, unsigned long int *msTimeSpend) {
+bool Platform_getDiskIO(DiskIOData* data) {
FILE *fd = fopen(PROCDIR "/diskstats", "r");
if (!fd)
return false;
@@ -352,9 +352,9 @@ bool Platform_getDiskIO(unsigned long int *bytesRead, unsigned long int *bytesWr
}
fclose(fd);
/* multiply with sector size */
- *bytesRead = 512 * read_sum;
- *bytesWrite = 512 * write_sum;
- *msTimeSpend = timeSpend_sum;
+ data->totalBytesRead = 512 * read_sum;
+ data->totalBytesWritten = 512 * write_sum;
+ data->totalMsTimeSpend = timeSpend_sum;
return true;
}
diff --git a/linux/Platform.h b/linux/Platform.h
index 3c3986e6..62402432 100644
--- a/linux/Platform.h
+++ b/linux/Platform.h
@@ -11,6 +11,7 @@ in the source distribution for its full text.
#include <sys/types.h>
#include "Action.h"
+#include "DiskIOMeter.h"
#include "Meter.h"
#include "Process.h"
#include "SignalsPanel.h"
@@ -46,9 +47,7 @@ char* Platform_getProcessEnv(pid_t pid);
void Platform_getPressureStall(const char *file, bool some, double* ten, double* sixty, double* threehundred);
-bool Platform_getDiskIO(unsigned long int *bytesRead,
- unsigned long int *bytesWrite,
- unsigned long int *msTimeSpend);
+bool Platform_getDiskIO(DiskIOData* data);
bool Platform_getNetworkIO(unsigned long int *bytesReceived,
unsigned long int *packetsReceived,

© 2014-2024 Faster IT GmbH | imprint | privacy policy