debug - Add mbufinfo
[dragonfly.git] / test / dsched / dsched_stats.c
1 #include <sys/types.h>
2 #include <sys/stat.h>
3 #include <sys/sysctl.h>
4
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>
12
13 #include "../../sys/sys/dsched.h"
14
15
16 int main(void)
17 {
18         struct dsched_stats     dsched_stats;
19         size_t n = sizeof(struct dsched_stats);
20
21         if (sysctlbyname("dsched.stats", &dsched_stats, &n, NULL, 0) != 0)
22                 err(1, "sysctlbyname");
23
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",
35
36                 dsched_stats.tdctx_allocations,
37                 dsched_stats.tdio_allocations,
38                 dsched_stats.diskctx_allocations,
39
40                 dsched_stats.nprocs,
41                 dsched_stats.nthreads,
42
43                 dsched_stats.no_tdctx
44                 );
45
46
47         return 0;
48 }