rpms/sysstat/FC-6 sysstat-7.0.0-nfs2.patch, NONE, 1.1 sysstat.spec, 1.44, 1.45

fedora-cvs-commits at redhat.com fedora-cvs-commits at redhat.com
Tue Nov 21 15:42:50 UTC 2006


Author: varekova

Update of /cvs/dist/rpms/sysstat/FC-6
In directory cvs.devel.redhat.com:/tmp/cvs-serv15216

Modified Files:
	sysstat.spec 
Added Files:
	sysstat-7.0.0-nfs2.patch 
Log Message:
 - update NFS mount statistic patch 


sysstat-7.0.0-nfs2.patch:
 iostat.c |   82 ++++++++++++++++++++++++++++++++++++---------------------------
 1 files changed, 47 insertions(+), 35 deletions(-)

--- NEW FILE sysstat-7.0.0-nfs2.patch ---
--- sysstat-7.0.0/iostat.c.pom	2006-11-20 10:35:35.000000000 +0100
+++ sysstat-7.0.0/iostat.c	2006-11-20 11:40:01.000000000 +0100
@@ -990,6 +990,28 @@
    }
 }
 
+/*                                                                                                                                                                                                    
+ ***************************************************************************                                                                                                                          
+ * Display NFS stats header                                                                                                                                                                           
+ ***************************************************************************                                                                                                                          
+ */                                                                                                                                                                                                   
+void write_nfs_stat_header(int flags, int *fctr)                                                                                                                                                      
+{                                                                                                                                                                                                     
+   printf("Device:               ");                                                                                                                                                                  
+   if (DISPLAY_KILOBYTES(flags)) {                                                                                                                                                                    
+      printf("    rkB_nor/s    wkB_nor/s    rkB_dir/s    wkB_dir/s    rkB_svr/s    wkB_svr/s\n");                                                                                                     
+      *fctr = 1024;                                                                                                                                                                                   
+   }                                                                                                                                                                                                  
+   else if (DISPLAY_MEGABYTES(flags)) {                                                                                                                                                               
+      printf("    rMB_nor/s    wMB_nor/s    rMB_dir/s    wMB_dir/s    rMB_svr/s    wMB_svr/s\n");                                                                                                     
+      *fctr = 1024 * 1024;                                                                                                                                                                            
+   }                                                                                                                                                                                                  
+   else {                                                                                                                                                                                             
+      printf("   rBlk_nor/s   wBlk_nor/s   rBlk_dir/s   wBlk_dir/s   rBlk_svr/s   wBlk_svr/s\n");                                                                                                     
+      *fctr = 512;                                                                                                                                                                                    
+   }                                                                                                                                                                                                  
+} 
+
 
 /*
  ***************************************************************************
@@ -1098,38 +1120,24 @@
    }
 }
 
-
-/*
- ***************************************************************************
- * Write basic stats, read from /proc/stat, /proc/{diskstats,partitions}
- * or from sysfs
- ***************************************************************************
- */
-void write_nfs_stat(int curr, unsigned long long itv, int flags, int fctr,
-                      struct io_hdr_nfs_stats *shhi, struct nfs_stats *ionfsi,
-                      struct nfs_stats *ionfsj)
-{
-   unsigned long long read_b_i, read_b_j, writt_b_i, writt_b_j;
-   /* NFS-mount directories statistic has values in bytes */
-   int f = 512*fctr;
-   printf("%-22s", shhi->name);
-   if (strlen(shhi->name) > 20)
-      printf("\n                      ");
-      
-   /* print stats from /proc/self/mountstats */
-   read_b_i = ionfsi->normal_read_bytes + ionfsi->direct_read_bytes + ionfsi->server_read_bytes;
-   writt_b_i = ionfsi->normal_written_bytes + ionfsi->direct_written_bytes + ionfsi->server_written_bytes;
-   read_b_j = ionfsj->normal_read_bytes + ionfsj->direct_read_bytes + ionfsj->server_read_bytes;
-   writt_b_j = ionfsj->normal_written_bytes + ionfsj->direct_written_bytes + ionfsj->server_written_bytes;
-
-   printf(" %12.2f %12.2f %10llu %10llu\n",
-        S_VALUE(read_b_j, read_b_i, itv)/f,
-        S_VALUE(writt_b_j, writt_b_i, itv)/f,
-        (unsigned long long) (read_b_i - read_b_j)/ f,
-        (unsigned long long) (writt_b_i - writt_b_j)/ f);
-
-}
-
+/*                                                                                                                                                                                                    
+ ***************************************************************************                                                                                                                          
+ * Write NFS stats read from /proc/self/mountstats                                                                                                                                                    
+ ***************************************************************************                                                                                                                          
+ */                                                                                                                                                                                                   
+void write_nfs_stat(int curr, unsigned long long itv, int flags, int fctr,                                                                                    
+	            struct io_hdr_nfs_stats *shhi, struct nfs_stats *ioni,
+                    struct nfs_stats *ionj)                                                                                                                                                        
+{                                                                                                                                                                                                     
+   printf("%-22s %12.2f %12.2f %12.2f %12.2f %12.2f %12.2f\n",                                                                                                                                        
+	     shhi->name,                                                                                                                                                                                  
+             S_VALUE(ionj->normal_read_bytes, ioni->normal_read_bytes, itv) / fctr,                                                                                                                          
+             S_VALUE(ionj->normal_written_bytes, ioni->normal_written_bytes, itv) / fctr,                                                                                                                          
+             S_VALUE(ionj->direct_read_bytes, ioni->direct_read_bytes, itv) / fctr,                                                                                                                          
+             S_VALUE(ionj->direct_written_bytes, ioni->direct_written_bytes, itv) / fctr,                                                                                                                          
+             S_VALUE(ionj->server_read_bytes, ioni->server_read_bytes, itv) / fctr,                                                                                                                          
+             S_VALUE(ionj->server_written_bytes, ioni->server_written_bytes, itv) / fctr);                                                                                                                         
+}     
                                                   
 /*
  ***************************************************************************
@@ -1201,14 +1209,12 @@
 
       /* Display stats header */
       write_stat_header(flags, &fctr);
-
       if (DISPLAY_EXTENDED(flags) &&
-	  (HAS_OLD_KERNEL(flags) || HAS_PLAIN_KERNEL24(flags) || DISPLAY_EXTENDED(flags))) {
+	  (HAS_OLD_KERNEL(flags) || HAS_PLAIN_KERNEL24(flags))) {
 	 /* No extended stats with old 2.2-2.4 kernels */
 	 printf("\n");
 	 return 1;
       }
-
       for (i = 0; i < iodev_nr; i++, shi++) {
 	 if (shi->used) {
     
@@ -1250,6 +1256,12 @@
 	       write_basic_stat(curr, itv, flags, fctr, shi, ioi, ioj);
 	 }
       }
+      printf("\n");  
+   }
+   if (DISPLAY_NFS(flags)) {
+     
+      /* Display NFS stats header */                                                                                                                                                                  
+      write_nfs_stat_header(flags, &fctr);   
 
       for (i = 0; i< ionfs_nr; i++, shhi++) {
          if (shhi->used) {       


Index: sysstat.spec
===================================================================
RCS file: /cvs/dist/rpms/sysstat/FC-6/sysstat.spec,v
retrieving revision 1.44
retrieving revision 1.45
diff -u -r1.44 -r1.45
--- sysstat.spec	31 Oct 2006 10:28:17 -0000	1.44
+++ sysstat.spec	21 Nov 2006 15:42:48 -0000	1.45
@@ -1,6 +1,6 @@
 Name: sysstat
 Version: 7.0.0
-Release: 2%{?dist}
+Release: 3%{?dist}
 Summary: The sar and iostat system monitoring commands.
 License: GPL
 Group: Applications/System
@@ -14,6 +14,7 @@
 Patch6: sysstat-5.0.5-append-msg.patch
 Patch7: sysstat-6.0.2-sysconf.patch
 Patch8: sysstat-7.0.0-nfs.patch
+Patch9: sysstat-7.0.0-nfs2.patch
 
 BuildRoot: %{_tmppath}/%{name}-%{version}-root
 
@@ -34,6 +35,7 @@
 %patch6 -p1 -b .append-msg
 %patch7 -p1 -b .sysconf
 %patch8 -p1 -b .nfs
+%patch9 -p1 -b .nfs2
 
 %build
 # FIXME: I need to fix the upstream Makefile to use LIBDIR et al. properly and
@@ -113,6 +115,9 @@
 /var/log/sa
 
 %changelog
+* Tue Nov 21 2006 Ivana Varekova <varekova at redhat.com> - 7.0.0-3
+- update NFS mount statistic patch 
+
 * Mon Oct 31 2006 Ivana Varekova <varekova at redhat.com> - 7.0.0-2
 - rebuild
 




More information about the fedora-cvs-commits mailing list