(SIGAR-144) prefer 64-bit counter versions of rx/tx bytes + packets

This commit is contained in:
Doug MacEachern 2009-07-02 12:20:11 -07:00
parent 46427ad949
commit 0e0d7ea1f7
1 changed files with 24 additions and 4 deletions

View File

@ -2148,7 +2148,12 @@ static void ifstat_kstat_common(sigar_net_interface_stat_t *ifstat,
break; break;
case 'i': case 'i':
if (strEQ(ptr, "ipackets")) { if (strEQ(ptr, "ipackets")) {
ifstat->rx_packets = value; if (ifstat->rx_packets == 0) {
ifstat->rx_packets = value;
}
}
else if (strEQ(ptr, "ipackets64")) {
ifstat->rx_packets = data[i].value.ui64;
} }
else if (strEQ(ptr, "ierrors")) { else if (strEQ(ptr, "ierrors")) {
ifstat->rx_errors = value; ifstat->rx_errors = value;
@ -2175,7 +2180,12 @@ static void ifstat_kstat_common(sigar_net_interface_stat_t *ifstat,
break; break;
case 'o': case 'o':
if (strEQ(ptr, "obytes")) { if (strEQ(ptr, "obytes")) {
ifstat->tx_bytes = value; if (ifstat->tx_bytes == 0) {
ifstat->tx_bytes = value;
}
}
else if (strEQ(ptr, "obytes64")) {
ifstat->tx_bytes = data[i].value.ui64;
} }
else if (strEQ(ptr, "oerrors")) { else if (strEQ(ptr, "oerrors")) {
ifstat->tx_errors = value; ifstat->tx_errors = value;
@ -2184,7 +2194,12 @@ static void ifstat_kstat_common(sigar_net_interface_stat_t *ifstat,
ifstat->tx_overruns = value; ifstat->tx_overruns = value;
} }
else if (strEQ(ptr, "opackets")) { else if (strEQ(ptr, "opackets")) {
ifstat->tx_packets = value; if (ifstat->tx_packets == 0) {
ifstat->tx_packets = value;
}
}
else if (strEQ(ptr, "opackets64")) {
ifstat->tx_packets = data[i].value.ui64;
} }
else if (strEQ(ptr, "toolong_errors")) { else if (strEQ(ptr, "toolong_errors")) {
ifstat->tx_overruns = value; ifstat->tx_overruns = value;
@ -2192,7 +2207,12 @@ static void ifstat_kstat_common(sigar_net_interface_stat_t *ifstat,
break; break;
case 'r': case 'r':
if (strEQ(ptr, "rbytes")) { if (strEQ(ptr, "rbytes")) {
ifstat->rx_bytes = value; if (ifstat->rx_bytes == 0) {
ifstat->rx_bytes = value;
}
}
else if (strEQ(ptr, "rbytes64")) {
ifstat->rx_bytes = data[i].value.ui64;
} }
else if (strEQ(ptr, "rx_overflow")) { else if (strEQ(ptr, "rx_overflow")) {
ifstat->rx_overruns = value; ifstat->rx_overruns = value;