]>
git.saurik.com Git - apple/hfs.git/blob - hfs-alloc-trace/hfs-alloc-trace.c
0c171b72a8d3d4725fb2de91719e246df1912ff9
5 // Created by Chris Suter on 8/19/15.
9 #include <sys/sysctl.h>
15 #include "../core/hfs_alloc_trace.h"
19 size_t sz
= 128 * 1024;
20 struct hfs_alloc_trace_info
*info
= malloc(sz
);
22 if (sysctlbyname("vfs.generic.hfs.alloc_trace_info", info
, &sz
,
24 err(1, "sysctlbyname failed");
27 for (int i
= 0; i
< info
->entry_count
; ++i
) {
28 printf(" -- 0x%llx:%llu <%llu> --\n", info
->entries
[i
].ptr
,
29 info
->entries
[i
].sequence
, info
->entries
[i
].size
);
30 for (int j
= 0; j
< HFS_ALLOC_BACKTRACE_LEN
; ++j
)
31 printf("0x%llx\n", info
->entries
[i
].backtrace
[j
]);
35 printf("[skipped]\n");