Fwd: Implemented getPageFaults for win32

Kyle Van Berendonck kvanberendonck at gmail.com
Mon Apr 15 01:39:49 CEST 2013


---------- Forwarded message ----------
From: Kyle Van Berendonck <kvanberendonck at gmail.com>
Date: Sun, Apr 14, 2013 at 5:56 PM
Subject: Implemented getPageFaults for win32
To: ghc-devs at haskell.org


Author: Kyle Van Berendonck <kvanberendonck at gmail.com>  2013-04-14 17:45:39
Committer: Kyle Van Berendonck <kvanberendonck at gmail.com>  2013-04-14
17:45:39
Parent: 52efb2c8aefbd448e765e62a34c3e53ab7202a11 (No need to map over all
blocks, setting up PIC.)
Branch: master
Follows: ghc-darcs-git-switchover
Precedes:

Implemented getPageFaults for win32

----------------------------- rts/win32/GetTime.c
-----------------------------
index bfab43a..50a2c4d 100644
@@ -157,6 +157,13 @@ W_
 getPageFaults(void)
 {
   /* ToDo (on NT): better, get this via the performance data
-     that's stored in the registry. */
+     that's stored in the registry.
+
+     nb: this includes the number of soft page faults, but it's better
than nothing
+     */
+     PROCESS_MEMORY_COUNTERS pmc;
+     if (GetProcessMemoryInfo(GetCurrentProcess(), &pmc, sizeof(pmc))) {
+         return pmc.PageFaultCount;
+     }
     return 0;
 }
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/ghc-devs/attachments/20130415/f802330c/attachment.htm>


More information about the ghc-devs mailing list