8150843: [windows] os::getTimesSecs() returns negative values for kernel, user times
authorstuefe
Sun, 06 Mar 2016 19:07:57 -0500
changeset 36571 350fddc3a0c6
parent 36570 9608a7830fe9
child 36572 bdbf53032b6a
8150843: [windows] os::getTimesSecs() returns negative values for kernel, user times Reviewed-by: dholmes
hotspot/src/os/windows/vm/os_windows.cpp
--- a/hotspot/src/os/windows/vm/os_windows.cpp	Sun Mar 06 15:50:13 2016 -0500
+++ b/hotspot/src/os/windows/vm/os_windows.cpp	Sun Mar 06 19:07:57 2016 -0500
@@ -951,11 +951,11 @@
     FILETIME wt;
     GetSystemTimeAsFileTime(&wt);
     jlong rtc_millis = windows_to_java_time(wt);
-    jlong user_millis = windows_to_java_time(user_time);
-    jlong system_millis = windows_to_java_time(kernel_time);
     *process_real_time = ((double) rtc_millis) / ((double) MILLIUNITS);
-    *process_user_time = ((double) user_millis) / ((double) MILLIUNITS);
-    *process_system_time = ((double) system_millis) / ((double) MILLIUNITS);
+    *process_user_time =
+      (double) jlong_from(user_time.dwHighDateTime, user_time.dwLowDateTime) / (10 * MICROUNITS);
+    *process_system_time =
+      (double) jlong_from(kernel_time.dwHighDateTime, kernel_time.dwLowDateTime) / (10 * MICROUNITS);
     return true;
   } else {
     return false;