pg: Add missing dummy stack frames for mcount for x86_64.
[dragonfly.git] / test / dsched / dsched_stats.c
blob7a40a339221d6ecc33d37a87b159f3922da38e22
1 #include <sys/types.h>
2 #include <sys/stat.h>
3 #include <sys/sysctl.h>
5 #include <db.h>
6 #include <err.h>
7 #include <fcntl.h>
8 #include <paths.h>
9 #include <stdio.h>
10 #include <stdlib.h>
11 #include <string.h>
13 #include "../../sys/sys/dsched.h"
16 int main(void)
18 struct dsched_stats dsched_stats;
19 size_t n = sizeof(struct dsched_stats);
21 if (sysctlbyname("dsched.stats", &dsched_stats, &n, NULL, 0) != 0)
22 err(1, "sysctlbyname");
24 printf( "Allocations\n"
25 "thread_ctx:\t%d\n"
26 "thread_io:\t%d\n"
27 "disk_ctx:\t%d\n"
28 "---------------------------------------------\n"
29 "Procs/Threads tracked\n"
30 "procs:\t\t%d\n"
31 "threads:\t%d\n"
32 "---------------------------------------------\n"
33 "Transactions\n"
34 "w/o thread_ctx:\t%d\n",
36 dsched_stats.tdctx_allocations,
37 dsched_stats.tdio_allocations,
38 dsched_stats.diskctx_allocations,
40 dsched_stats.nprocs,
41 dsched_stats.nthreads,
43 dsched_stats.no_tdctx
47 return 0;