Fwd: Implemented getPageFaults for win32
Edward Z. Yang
ezyang at MIT.EDU
Mon Apr 22 10:20:08 CEST 2013
Hello Kyle,
Could you please resend this patch; it looks like when you forwarded it
it got linespace-wrapped inappropriately.
Thanks,
Edward
Excerpts from Kyle Van Berendonck's message of Sun Apr 14 16:39:49 -0700 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;
> }
More information about the ghc-devs
mailing list