DragonFly BSD
DragonFly kernel List (threaded) for 2011-02
[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]

Function assist with iostat


From: Pratyush Kshirsagar <pratyush.kshirsagar@xxxxxxxxx>
Date: Fri, 25 Feb 2011 11:21:39 -0500

Hello,
I am porting the iostat from FreeBSD.
I have problem with the function devstat_compute_statistics()
Here is how its used in FreeBSD ans I tried the compute_stats() in dragonfly but still need this equivalent to be correct
So, please give me the correct usage of compute_stats similar to devstat_compute_statistics in the FreeBSD, here it is:
        if (devstat_compute_statistics(&cur.dinfo->devices[di],
             &last.dinfo->devices[di], busy_seconds,
             DSM_KB_PER_TRANSFER, &kb_per_transfer,
             DSM_TRANSFERS_PER_SECOND, &transfers_per_second,
             DSM_MB_PER_SECOND, &mb_per_second, DSM_NONE) != 0)
                 errx(1, "%s", devstat_errbuf);

Also, is it OK if we call getnumdevs() without any arguments (its similar to freebsd devstat_getdevs()).
The FreeBSD uses:
switch (devstat_getdevs(NULL, &cur)) {
         case -1:
                errx(1, "%s", devstat_errbuf);
                 break;
         case 1:
                 cmdiostat("refresh", NULL);
                 break;
         default:
                 break;
 }

I am still trying to remove some warnings and error. Will mail you if need more help.

pratyush.kshirsagar (@ gmail.com)



[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]