+void
+snapshot(void)
+{
+
+ get_stats(&vm_stat);
+ printf("Mach Virtual Memory Statistics: (page size of %d bytes)\n",
+ (int) (pageSize));
+
+ sspstat("Pages free:", (uint64_t) (vm_stat.free_count - vm_stat.speculative_count));
+ sspstat("Pages active:", (uint64_t) (vm_stat.active_count));
+ sspstat("Pages inactive:", (uint64_t) (vm_stat.inactive_count));
+ sspstat("Pages speculative:", (uint64_t) (vm_stat.speculative_count));
+ sspstat("Pages wired down:", (uint64_t) (vm_stat.wire_count));
+ sspstat("\"Translation faults\":", (uint64_t) (vm_stat.faults));
+ sspstat("Pages copy-on-write:", (uint64_t) (vm_stat.cow_faults));
+ sspstat("Pages zero filled:", (uint64_t) (vm_stat.zero_fill_count));
+ sspstat("Pages reactivated:", (uint64_t) (vm_stat.reactivations));
+ sspstat("Pageins:", (uint64_t) (vm_stat.pageins));
+ sspstat("Pageouts:", (uint64_t) (vm_stat.pageouts));
+#if defined(__ppc__) /* vm_statistics are still 32-bit on ppc */
+ printf("Object cache: %u hits of %u lookups (%u%% hit rate)\n",
+#else
+ printf("Object cache: %llu hits of %llu lookups (%u%% hit rate)\n",
+#endif
+ vm_stat.hits, vm_stat.lookups, percent);
+
+}
+
+void
+sspstat(char *str, uint64_t n)
+{
+ printf("%-25s %16llu.\n", str, n);
+}
+