unsigned long long itv)
{
int i, j, j0, found;
- struct stats_fchost *sfcc, *sfcp;
+ struct stats_fchost *sfcc, *sfcp, sfczero;
int sep = FALSE;
if (!IS_SELECTED(a->options) || (a->nr[curr] <= 0))
goto close_json_markup;
+ memset(&sfczero, 0, sizeof(struct stats_fchost));
+
json_markup_network(tab, OPEN_JSON_MARKUP);
tab++;
while (j != j0);
}
- if (!found)
- continue;
+ if (!found) {
+ /* This is a newly registered host */
+ sfcp = &sfczero;
+ }
if (sep)
printf(",\n");
{
#ifdef HAVE_PCP
int i, j, j0, found;
- struct stats_fchost *sfcc, *sfcp;
+ struct stats_fchost *sfcc, *sfcp, sfczero;
char buf[64];
+ memset(&sfczero, 0, sizeof(struct stats_fchost));
+
for (i = 0; i < a->nr[curr]; i++) {
found = FALSE;
while (j != j0);
}
- if (!found)
- continue;
+ if (!found) {
+ /* This is a newly registered host */
+ sfcp = &sfczero;
+ }
snprintf(buf, sizeof(buf), "%f",
S_VALUE(sfcp->f_rxframes, sfcc->f_rxframes, itv));
unsigned long long itv)
{
int i, j, j0, found;
- struct stats_fchost *sfcc, *sfcp;
+ struct stats_fchost *sfcc, *sfcp, sfczero;
+
+ memset(&sfczero, 0, sizeof(struct stats_fchost));
if (dish) {
print_hdr_line(timestamp[!curr], a, FIRST, -1, 9);
}
}
- if (!found)
- continue;
+ if (!found) {
+ /* This is a newly registered host */
+ sfcp = &sfczero;
+ }
printf("%-11s", timestamp[curr]);
cprintf_f(NO_UNIT, 4, 9, 2,
__print_funct_t raw_print_fchost_stats(struct activity *a, char *timestr, int curr)
{
int i, j, j0, found;
- struct stats_fchost *sfcc, *sfcp;
+ struct stats_fchost *sfcc, *sfcp, sfczero;
+
+ memset(&sfczero, 0, sizeof(struct stats_fchost));
for (i = 0; i < a->nr[curr]; i++) {
while (j != j0);
}
- if (!found)
- continue;
+ if (!found) {
+ /* This is a newly registered host. Previous stats are zero */
+ sfcp = &sfczero;
+ if (DISPLAY_DEBUG_MODE(flags)) {
+ printf(" [NEW]");
+ }
+ }
printf("%s; %s; %s;", timestr, pfield(a->hdr_line, FIRST), sfcc->fchost_name);
printf(" %s", pfield(NULL, 0));
unsigned long rx_frames, tx_frames, rx_words, tx_words;
/* Each host, if present, will have its own hostX entry within SYSFS_FCHOST */
- if ((dir = opendir(SYSFS_FCHOST)) == NULL)
+ if ((dir = __opendir(SYSFS_FCHOST)) == NULL)
return 0; /* No FC hosts */
/*
* Read each of the counters via sysfs, where they are
* returned as hex values (e.g. 0x72400).
*/
- while ((drd = readdir(dir)) != NULL) {
+ while ((drd = __readdir(dir)) != NULL) {
rx_frames = tx_frames = rx_words = tx_words = 0;
if (!strncmp(drd->d_name, "host", 4)) {
}
}
- closedir(dir);
+ __closedir(dir);
return fch_read;
}
int curr, unsigned long long itv)
{
int i, j, j0, found;
- struct stats_fchost *sfcc, *sfcp;
+ struct stats_fchost *sfcc, *sfcp, sfczero;
+
+ memset(&sfczero, 0, sizeof(struct stats_fchost));
for (i = 0; i < a->nr[curr]; i++) {
while (j != j0);
}
- if (!found)
- continue;
+ if (!found) {
+ /* This is a newly registered host */
+ sfcp = &sfczero;
+ }
render(isdb, pre, PT_NOFLAG ,
"%s\tfch_rxf/s",
__print_funct_t svg_print_fchost_stats(struct activity *a, int curr, int action, struct svg_parm *svg_p,
unsigned long long itv, struct record_header *record_hdr)
{
- struct stats_fchost *sfcc, *sfcp;
+ struct stats_fchost *sfcc, *sfcp, sfczero;
int group[] = {2, 2};
int g_type[] = {SVG_LINE_GRAPH, SVG_LINE_GRAPH};
char *title[] = {"Fibre Channel HBA statistics (1)", "Fibre Channel HBA statistics (2)"};
}
if (action & F_MAIN) {
+ memset(&sfczero, 0, sizeof(struct stats_fchost));
restart = svg_p->restart;
/*
* Mark previously registered interfaces as now
while (j != j0);
}
- if (!found)
- continue;
+ if (!found) {
+ /* This is a newly registered host */
+ sfcp = &sfczero;
+ }
/*
* If current interface was marked as previously unregistered,
unsigned long long itv)
{
int i, j, j0, found;
- struct stats_fchost *sfcc, *sfcp;
+ struct stats_fchost *sfcc, *sfcp, sfczero;
if (!IS_SELECTED(a->options) || (a->nr[curr] <= 0))
goto close_xml_markup;
+ memset(&sfczero, 0, sizeof(struct stats_fchost));
+
xml_markup_network(tab, OPEN_XML_MARKUP);
tab++;
while (j != j0);
}
- if (!found)
- continue;
+ if (!found) {
+ /* This is a newly registered host */
+ sfcp = &sfczero;
+ }
xprintf(tab, "<fchost name=\"%s\" "
"fch_rxf=\"%.2f\" "