summaryrefslogtreecommitdiffstats
path: root/Utilities/cmlibuv/src/win/util.c
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2016-09-29 18:19:51 (GMT)
committerBrad King <brad.king@kitware.com>2016-09-29 18:19:51 (GMT)
commitf9cab9e38df8adeac5f83f80722dedff25affdcd (patch)
treeedb096f74dd246dc2fc7787bcecbbbbb1437e06a /Utilities/cmlibuv/src/win/util.c
parent5d29506811c5b75ae48e12de6c317f6440874215 (diff)
parent66ac1febc41967599d5bdaab912d786879ce6813 (diff)
downloadCMake-f9cab9e38df8adeac5f83f80722dedff25affdcd.zip
CMake-f9cab9e38df8adeac5f83f80722dedff25affdcd.tar.gz
CMake-f9cab9e38df8adeac5f83f80722dedff25affdcd.tar.bz2
Merge branch 'upstream-libuv' into update-libuv
* upstream-libuv: libuv 2016-09-27 (8221f9b3)
Diffstat (limited to 'Utilities/cmlibuv/src/win/util.c')
-rw-r--r--Utilities/cmlibuv/src/win/util.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/Utilities/cmlibuv/src/win/util.c b/Utilities/cmlibuv/src/win/util.c
index 4a2e501..050058a 100644
--- a/Utilities/cmlibuv/src/win/util.c
+++ b/Utilities/cmlibuv/src/win/util.c
@@ -1078,6 +1078,7 @@ int uv_getrusage(uv_rusage_t *uv_rusage) {
FILETIME createTime, exitTime, kernelTime, userTime;
SYSTEMTIME kernelSystemTime, userSystemTime;
PROCESS_MEMORY_COUNTERS memCounters;
+ IO_COUNTERS ioCounters;
int ret;
ret = GetProcessTimes(GetCurrentProcess(), &createTime, &exitTime, &kernelTime, &userTime);
@@ -1102,6 +1103,11 @@ int uv_getrusage(uv_rusage_t *uv_rusage) {
return uv_translate_sys_error(GetLastError());
}
+ ret = GetProcessIoCounters(GetCurrentProcess(), &ioCounters);
+ if (ret == 0) {
+ return uv_translate_sys_error(GetLastError());
+ }
+
memset(uv_rusage, 0, sizeof(*uv_rusage));
uv_rusage->ru_utime.tv_sec = userSystemTime.wHour * 3600 +
@@ -1117,6 +1123,9 @@ int uv_getrusage(uv_rusage_t *uv_rusage) {
uv_rusage->ru_majflt = (uint64_t) memCounters.PageFaultCount;
uv_rusage->ru_maxrss = (uint64_t) memCounters.PeakWorkingSetSize / 1024;
+ uv_rusage->ru_oublock = (uint64_t) ioCounters.WriteOperationCount;
+ uv_rusage->ru_inblock = (uint64_t) ioCounters.ReadOperationCount;
+
return 0;
}