]> granicus.if.org Git - sysstat/commitdiff
Added rendering of FC stats.
authorSteve Kay <stevekay@gmail.com>
Tue, 7 Apr 2015 21:11:16 +0000 (14:11 -0700)
committerSteve Kay <stevekay@gmail.com>
Tue, 7 Apr 2015 21:11:16 +0000 (14:11 -0700)
rndr_stats.c
rndr_stats.h

index 18bd6ce0e84da17f466c8d84d7dbad7dce68777a..3de2c264ba0e6e24ee916f6a6a8a255c972f1b03 100644 (file)
@@ -2917,3 +2917,54 @@ __print_funct_t render_filesystem_stats(struct activity *a, int isdb, char *pre,
                       NULL);
        }
 }
+
+/*
+ ***************************************************************************
+ * Display Fibre Channel HBA statistics in selected format.
+ *
+ * IN:
+ * @a          Activity structure with statistics.
+ * @isdb       Flag, true if db printing, false if ppc printing.
+ * @pre                Prefix string for output entries
+ * @curr       Index in array for current sample statistics.
+ * @itv                Interval of time in jiffies.
+ ***************************************************************************
+ */
+__print_funct_t render_hba_stats(struct activity *a, int isdb, char *pre,
+                                       int curr, unsigned long long itv)
+{
+       int i;
+       struct stats_fc *sfcc, *sfcp;
+
+       for (i = 0; i < a->nr; i++) {
+               sfcc = (struct stats_fc *) ((char *) a->buf[curr] + i * a->msize);
+               sfcp = (struct stats_fc *) ((char *) a->buf[!curr] + i * a->msize);
+
+               render(isdb, pre, PT_NOFLAG ,
+                      "%s\thba_rxf/s",
+                      "%s",
+                      cons(sv, sfcc->hba_name, NOVAL),
+                      NOVAL,
+                      S_VALUE(sfcp->f_rxframes, sfcc->f_rxframes, itv),
+                      NULL);
+               render(isdb, pre, PT_NOFLAG,
+                      "%s\thba_txf/s", NULL,
+                      cons(sv, sfcc->hba_name, NULL),
+                      NOVAL,
+                      S_VALUE(sfcp->f_txframes, sfcc->f_txframes, itv),
+                      NULL);
+               render(isdb, pre, PT_NOFLAG,
+                      "%s\thba_rxw/s", NULL,
+                      cons(sv, sfcc->hba_name, NULL),
+                      NOVAL,
+                      S_VALUE(sfcp->f_rxwords, sfcc->f_rxwords, itv),
+                      NULL);
+               render(isdb, pre,
+                      (DISPLAY_HORIZONTALLY(flags) ? PT_NOFLAG : PT_NEWLIN),
+                      "%s\thba_txw/s", NULL,
+                      cons(sv, sfcc->hba_name, NULL),
+                      NOVAL,
+                      S_VALUE(sfcp->f_txwords, sfcc->f_txwords, itv),
+                      NULL);
+       }
+}
index 3f331b9353a4f6934a4157614b649fd63dd05441..74b44731fe3b73a477df9c84ac1388424a562024 100644 (file)
@@ -120,5 +120,7 @@ extern __print_funct_t render_pwr_usb_stats
        (struct activity *, int, char *, int, unsigned long long);
 extern __print_funct_t render_filesystem_stats
        (struct activity *, int, char *, int, unsigned long long);
+extern __print_funct_t render_hba_stats
+       (struct activity *, int, char *, int, unsigned long long);
 
 #endif /* _RNDR_STATS_H */