/* Look for CIFS directory in data table */
for (i = 0; i < cifs_nr; i++) {
st_hdr_cifs_i = st_hdr_cifs + i;
- if (!strcmp(st_hdr_cifs_i->name, name)) {
+ if ((st_hdr_cifs_i->used == TRUE) &&
+ (!strcmp(st_hdr_cifs_i->name, name))) {
break;
}
}
-
+
if (i == cifs_nr) {
/*
* This is a new filesystem: Look for an unused entry to store it.
if (!st_hdr_cifs_i->used) {
/* Unused entry found... */
st_hdr_cifs_i->used = TRUE; /* Indicate it is now used */
+ st_hdr_cifs_i->active = TRUE;
strcpy(st_hdr_cifs_i->name, name);
- st_cifs_i = st_cifs[!curr] + i;
- memset(st_cifs_i, 0, CIFS_STATS_SIZE);
+ st_cifs_i = st_cifs[curr] + i;
+ *st_cifs_i = *((struct cifs_stats *) st_io);
break;
}
}
if (i == cifs_nr) {
+ /*
+ * It is a new CIFS directory
+ * but there is no free structure to store it.
+ */
+
/* All entries are used: The number has to be increased */
cifs_nr = cifs_nr + 5;
/* Set the new entries inactive */
for (j = 0; j < 5; j++) {
- st_hdr_cifs_i = st_hdr_cifs + j;
+ st_hdr_cifs_i = st_hdr_cifs + i + j;
st_hdr_cifs_i->used = FALSE;
+ st_hdr_cifs_i->active = FALSE;
}
/* Increase the size of st_hdr_ionfs buffer */
perror("malloc");
exit(4);
}
+ memset(st_cifs[j] + i, 0, 5 * CIFS_STATS_SIZE);
}
-
/* Now i shows the first unused entry of the new block */
st_hdr_cifs_i = st_hdr_cifs + i;
st_hdr_cifs_i->used = TRUE; /* Indicate it is now used */
+ st_hdr_cifs_i->active = TRUE;
strcpy(st_hdr_cifs_i->name, name);
- st_cifs_i = st_cifs[!curr] + i;
- memset(st_cifs_i, 0, CIFS_STATS_SIZE);
+ st_cifs_i = st_cifs[curr] + i;
+ *st_cifs_i = *st_io;
}
- }
- if (i < cifs_nr) {
+ } else {
st_hdr_cifs_i = st_hdr_cifs + i;
st_hdr_cifs_i->active = TRUE;
+ st_hdr_cifs_i->used = TRUE;
st_cifs_i = st_cifs[curr] + i;
*st_cifs_i = *st_io;
}
else {
printf("%-22s ", shi->name);
}
+
/* rB/s wB/s fo/s fc/s fd/s*/
printf("%12.2f %12.2f %9.2f %9.2f %12.2f %12.2f %12.2f \n",
S_VALUE(ionj->rd_bytes, ioni->rd_bytes, itv) / fctr,
if (count > 0) {
count--;
}
+
if (count) {
curr ^= 1;
pause();
/*
- * nfsiostat: report NFS I/O statistics
+ * nfsiostat: Report NFS I/O statistics
* Copyright (C) 2010 Red Hat, Inc. All Rights Reserved
* Written by Ivana Varekova <varekova@redhat.com>
*
if ((strstr(line, "mounted")) && (strstr(line, "on")) &&
(strstr(line, "with")) && (strstr(line, "fstype"))) {
- sscanf(strstr(line, "fstype") + 6, "%10s", type_name);
+ sscanf(strstr(line, "fstype") + 6, "%9s", type_name);
if ((!strncmp(type_name, "nfs", 3)) && (strncmp(type_name, "nfsd", 4))) {
nfs ++;
}
* @st_hdr_ionfs Pointer on structures describing an NFS filesystem.
***************************************************************************
*/
-void save_stats(char *name, int curr, void *st_io, int ionfs_nr,
- struct io_hdr_stats *st_hdr_ionfs)
+void save_stats(char *name, int curr, void *st_io)
{
int i, j;
struct io_hdr_stats *st_hdr_ionfs_i;
/* Look for NFS directory in data table */
for (i = 0; i < ionfs_nr; i++) {
st_hdr_ionfs_i = st_hdr_ionfs + i;
- if (!strcmp(st_hdr_ionfs_i->name, name)) {
+ if ((st_hdr_ionfs_i->used) &&
+ (!strcmp(st_hdr_ionfs_i->name, name))) {
break;
}
}
-
+
if (i == ionfs_nr) {
/*
* This is a new filesystem: Look for an unused entry to store it.
if (!st_hdr_ionfs_i->used) {
/* Unused entry found... */
st_hdr_ionfs_i->used = TRUE; /* Indicate it is now used */
+ st_hdr_ionfs_i->active = TRUE;
+
strcpy(st_hdr_ionfs_i->name, name);
- st_ionfs_i = st_ionfs[!curr] + i;
+ st_ionfs_i = st_ionfs[curr] + i;
memset(st_ionfs_i, 0, IO_NFS_STATS_SIZE);
+ *st_ionfs_i = *((struct io_nfs_stats *) st_io);
break;
}
}
/* Set the new entries inactive */
for (j = 0; j < 5; j++) {
- st_hdr_ionfs_i = st_hdr_ionfs + j;
+ st_hdr_ionfs_i = st_hdr_ionfs + i + j;
st_hdr_ionfs_i->used = FALSE;
+ st_hdr_ionfs_i->active = FALSE;
}
/* Increase the size of st_hdr_ionfs buffer */
perror("malloc");
exit(4);
}
+ memset(st_ionfs[j] + i, 0, 5 * IO_NFS_STATS_SIZE);
}
/* Now i shows the first unused entry of the new block */
st_hdr_ionfs_i = st_hdr_ionfs + i;
st_hdr_ionfs_i->used = TRUE; /* Indicate it is now used */
strcpy(st_hdr_ionfs_i->name, name);
- st_ionfs_i = st_ionfs[!curr] + i;
+ st_ionfs_i = st_ionfs[curr] + i;
memset(st_ionfs_i, 0, IO_NFS_STATS_SIZE);
}
- }
- if (i < ionfs_nr) {
+ } else {
st_hdr_ionfs_i = st_hdr_ionfs + i;
+ st_hdr_ionfs_i->used = TRUE;
st_hdr_ionfs_i->active = TRUE;
st_ionfs_i = st_ionfs[curr] + i;
*st_ionfs_i = *((struct io_nfs_stats *) st_io);
return;
sprintf(aux, "%%%ds",
- MAX_NAME_LEN < 200 ? MAX_NAME_LEN : 200);
+ MAX_NAME_LEN < 200 ? MAX_NAME_LEN-1 : 200);
while (fgets(line, 256, fp) != NULL) {
-
/* Read NFS directory name */
if (!strncmp(line, "device", 6)) {
sw = 0;
sscanf(line + 6, aux, nfs_name);
mount_part = strchr(line + 7, ' ');
if (mount_part != NULL) {
- sscanf(mount_part, "%10s %10s", mount, on);
+ sscanf(mount_part, "%9s %9s", mount, on);
if ((!strncmp(mount, "mounted", 7)) && (!strncmp(on, "on", 2))) {
sw = 1;
}
}
}
- sscanf(line, "%10s", prefix);
+ sscanf(line, "%9s", prefix);
if (sw && (!strncmp(prefix, "bytes:", 6))) {
/* Read the stats for the last NFS-mounted directory */
sscanf(strstr(line, "bytes:") + 6, "%llu %llu %llu %llu %llu %llu",
}
else if (!strncmp(operation, "WRITE:", 6)) {
snfs.nfs_wops = v1;
- save_stats(nfs_name, curr, &snfs, ionfs_nr, st_hdr_ionfs);
+
+ save_stats(nfs_name, curr, &snfs);
sw = 0;
}
}
uptime0[curr] = 0;
read_uptime(&(uptime0[curr]));
}
-
/* Read NFS directories stats */
read_nfs_stat(curr);
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: sysstat <at> orange.fr\n"
-"POT-Creation-Date: 2011-01-07 14:45+0100\n"
+"POT-Creation-Date: 2011-03-06 20:22+0100\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
msgid "sysstat version %s\n"
msgstr ""
-#: ioconf.c:490 rd_stats.c:72 rd_stats.c:2179 sa_common.c:1061 sadc.c:623
+#: ioconf.c:490 rd_stats.c:68 rd_stats.c:2003 sa_common.c:1061 sadc.c:623
#: sadc.c:632 sadc.c:692
#, c-format
msgid "Cannot open %s: %s\n"
"ALL } ] [ -V ]\n"
msgstr ""
-#: mpstat.c:535 pidstat.c:1819 sar.c:382
+#: mpstat.c:535 pidstat.c:1819 sar.c:380
msgid "Average:"
msgstr ""
"[ -p { <pid> [,...] | SELF | ALL } ] [ -T { TASK | CHILD | ALL } ]\n"
msgstr ""
-#: pidstat.c:199 sar.c:1017
+#: pidstat.c:199 sar.c:1015
#, c-format
msgid "Requested activities not available\n"
msgstr ""
-#: rd_stats.c:2225
+#: rd_stats.c:2049
#, c-format
msgid "Cannot handle so many processors!\n"
msgstr ""
msgid "\t[Unknown activity format]"
msgstr ""
-#: sar.c:106
+#: sar.c:105
#, c-format
msgid ""
"Options are:\n"
"[ -i <interval> ] [ -s [ <hh:mm:ss> ] ] [ -e [ <hh:mm:ss> ] ]\n"
msgstr ""
-#: sar.c:128
+#: sar.c:126
#, c-format
msgid "Main options and reports:\n"
msgstr ""
-#: sar.c:129
+#: sar.c:127
#, c-format
msgid "\t-b\tI/O and transfer rate statistics\n"
msgstr ""
-#: sar.c:130
+#: sar.c:128
#, c-format
msgid "\t-B\tPaging statistics\n"
msgstr ""
-#: sar.c:131
+#: sar.c:129
#, c-format
msgid "\t-d\tBlock device statistics\n"
msgstr ""
-#: sar.c:132
+#: sar.c:130
#, c-format
msgid "\t-H\tHugepages utilization statistics\n"
msgstr ""
-#: sar.c:133
+#: sar.c:131
#, c-format
msgid ""
"\t-I { <int> | SUM | ALL | XALL }\n"
"\t\tInterrupts statistics\n"
msgstr ""
-#: sar.c:135
+#: sar.c:133
#, c-format
msgid ""
"\t-m { <keyword> [,...] | ALL }\n"
"\t\tTEMP\tDevices temperature\n"
msgstr ""
-#: sar.c:143
+#: sar.c:141
#, c-format
msgid ""
"\t-n { <keyword> [,...] | ALL }\n"
"\t\tUDP6\tUDP traffic\t(v6)\n"
msgstr ""
-#: sar.c:164
+#: sar.c:162
#, c-format
msgid "\t-q\tQueue length and load average statistics\n"
msgstr ""
-#: sar.c:165
+#: sar.c:163
#, c-format
msgid "\t-r\tMemory utilization statistics\n"
msgstr ""
-#: sar.c:166
+#: sar.c:164
#, c-format
msgid "\t-R\tMemory statistics\n"
msgstr ""
-#: sar.c:167
+#: sar.c:165
#, c-format
msgid "\t-S\tSwap space utilization statistics\n"
msgstr ""
-#: sar.c:168
+#: sar.c:166
#, c-format
msgid ""
"\t-u [ ALL ]\n"
"\t\tCPU utilization statistics\n"
msgstr ""
-#: sar.c:170
+#: sar.c:168
#, c-format
msgid "\t-v\tKernel table statistics\n"
msgstr ""
-#: sar.c:171
+#: sar.c:169
#, c-format
msgid "\t-w\tTask creation and system switching statistics\n"
msgstr ""
-#: sar.c:172
+#: sar.c:170
#, c-format
msgid "\t-W\tSwapping statistics\n"
msgstr ""
-#: sar.c:173
+#: sar.c:171
#, c-format
msgid "\t-y\tTTY device statistics\n"
msgstr ""
-#: sar.c:216
+#: sar.c:214
#, c-format
msgid "End of data collecting unexpected\n"
msgstr ""
-#: sar.c:806
+#: sar.c:804
#, c-format
msgid "Invalid data format\n"
msgstr ""
-#: sar.c:810
+#: sar.c:808
#, c-format
msgid "Using a wrong data collector from a different sysstat version\n"
msgstr ""
-#: sar.c:834
+#: sar.c:832
#, c-format
msgid "Inconsistent input data\n"
msgstr ""
-#: sar.c:1264
+#: sar.c:1262
#, c-format
msgid "-f and -o options are mutually exclusive\n"
msgstr ""
-#: sar.c:1270
+#: sar.c:1268
#, c-format
msgid "Not reading from a system activity file (use -f option)\n"
msgstr ""
-#: sar.c:1397
+#: sar.c:1395
#, c-format
msgid "Cannot find the data collector (%s)\n"
msgstr ""