(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,8 +2148,13 @@ 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")) {
if (ifstat->rx_packets == 0) {
ifstat->rx_packets = value; 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,8 +2180,13 @@ 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")) {
if (ifstat->tx_bytes == 0) {
ifstat->tx_bytes = value; 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,16 +2194,26 @@ 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")) {
if (ifstat->tx_packets == 0) {
ifstat->tx_packets = value; 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;
} }
break; break;
case 'r': case 'r':
if (strEQ(ptr, "rbytes")) { if (strEQ(ptr, "rbytes")) {
if (ifstat->rx_bytes == 0) {
ifstat->rx_bytes = value; 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;
} }