change the bcachestats structures members to int64_t's and do the
authorthib <thib@openbsd.org>
Tue, 22 Jul 2008 08:05:02 +0000 (08:05 +0000)
committerthib <thib@openbsd.org>
Tue, 22 Jul 2008 08:05:02 +0000 (08:05 +0000)
printing in systat with the new print_fld_ssize() function.

"same diff I wrote" deraadt@
ok art@

sys/sys/mount.h
usr.bin/systat/iostat.c

index e3811be..d15bb6c 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: mount.h,v 1.90 2008/07/05 12:56:52 thib Exp $ */
+/*     $OpenBSD: mount.h,v 1.91 2008/07/22 08:05:02 thib Exp $ */
 /*     $NetBSD: mount.h,v 1.48 1996/02/18 11:55:47 fvdl Exp $  */
 
 /*
@@ -490,17 +490,17 @@ struct vfsconf {
 
 /* buffer cache statistics */
 struct bcachestats {
-       u_int64_t numbufs;              /* number of buffers allocated */
-       u_int64_t freebufs;             /* number of free buffers */
-       u_int64_t numbufpages;          /* number of pages in buffer cache */
-       u_int64_t numfreepages;         /* number of free pages */
-       u_int64_t numdirtypages;        /* number of dirty free pages */
-       u_int64_t numcleanpages;        /* number of clean free pages */
-       u_int64_t pendingwrites;        /* number of pending writes */
-       u_int64_t pendingreads;         /* number of pending reads */
-       u_int64_t numwrites;            /* total writes started */
-       u_int64_t numreads;             /* total reads started */
-       u_int64_t cachehits;            /* total reads found in cache */
+       int64_t numbufs;                /* number of buffers allocated */
+       int64_t freebufs;               /* number of free buffers */
+       int64_t numbufpages;            /* number of pages in buffer cache */
+       int64_t numfreepages;           /* number of free pages */
+       int64_t numdirtypages;          /* number of dirty free pages */
+       int64_t numcleanpages;          /* number of clean free pages */
+       int64_t pendingwrites;          /* number of pending writes */
+       int64_t pendingreads;           /* number of pending reads */
+       int64_t numwrites;              /* total writes started */
+       int64_t numreads;               /* total reads started */
+       int64_t cachehits;              /* total reads found in cache */
 };
 #ifdef _KERNEL
 extern struct bcachestats bcstats;
index 7a9e369..ceaa06b 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: iostat.c,v 1.32 2008/07/07 17:16:27 thib Exp $        */
+/*     $OpenBSD: iostat.c,v 1.33 2008/07/22 08:05:02 thib Exp $        */
 /*     $NetBSD: iostat.c,v 1.5 1996/05/10 23:16:35 thorpej Exp $       */
 
 /*
@@ -230,46 +230,46 @@ showbcache(void)
        int count = 0;
 
        print_fld_str(FLD_IO_SSTR, "numbufs");
-       print_fld_size(FLD_IO_SVAL, bccur.numbufs);
+       print_fld_ssize(FLD_IO_SVAL, bccur.numbufs);
        end_line();
 
        print_fld_str(FLD_IO_SSTR, "freebufs");
-       print_fld_size(FLD_IO_SVAL, bccur.freebufs);
+       print_fld_ssize(FLD_IO_SVAL, bccur.freebufs);
        end_line();
 
        print_fld_str(FLD_IO_SSTR, "numbufpages");
-       print_fld_size(FLD_IO_SVAL, bccur.numbufpages);
+       print_fld_ssize(FLD_IO_SVAL, bccur.numbufpages);
        end_line();
 
        print_fld_str(FLD_IO_SSTR, "numfreepages");
-       print_fld_size(FLD_IO_SVAL, bccur.numfreepages);
+       print_fld_ssize(FLD_IO_SVAL, bccur.numfreepages);
        end_line();
 
        print_fld_str(FLD_IO_SSTR, "numdirtypages");
-       print_fld_size(FLD_IO_SVAL, bccur.numdirtypages);
+       print_fld_ssize(FLD_IO_SVAL, bccur.numdirtypages);
        end_line();
 
        print_fld_str(FLD_IO_SSTR, "numcleanpages");
-       print_fld_size(FLD_IO_SVAL, bccur.numcleanpages);
+       print_fld_ssize(FLD_IO_SVAL, bccur.numcleanpages);
        end_line();
 
        print_fld_str(FLD_IO_SSTR, "pendingwrites");
-       print_fld_size(FLD_IO_SVAL, bccur.pendingwrites);
+       print_fld_ssize(FLD_IO_SVAL, bccur.pendingwrites);
        end_line();
 
        print_fld_str(FLD_IO_SSTR, "pendingreads");
-       print_fld_size(FLD_IO_SVAL, bccur.pendingreads);
+       print_fld_ssize(FLD_IO_SVAL, bccur.pendingreads);
        end_line();
 
        print_fld_str(FLD_IO_SSTR, "numwrites");
-       print_fld_size(FLD_IO_SVAL, bccur.numwrites - bclast.numwrites);
+       print_fld_ssize(FLD_IO_SVAL, bccur.numwrites - bclast.numwrites);
        end_line();
 
        print_fld_str(FLD_IO_SSTR, "numreads");
-       print_fld_size(FLD_IO_SVAL, bccur.numreads - bclast.numreads);
+       print_fld_ssize(FLD_IO_SVAL, bccur.numreads - bclast.numreads);
        end_line();
 
        print_fld_str(FLD_IO_SSTR, "cachehits");
-       print_fld_size(FLD_IO_SVAL, bccur.cachehits - bclast.cachehits);
+       print_fld_ssize(FLD_IO_SVAL, bccur.cachehits - bclast.cachehits);
        end_line();
 }