Skip to content
Snippets Groups Projects
Commit 7d8a15ad authored by Florian Pose's avatar Florian Pose
Browse files

64 bit frame statistics.

parent 184f068a
No related branches found
No related tags found
No related merge requests found
...@@ -310,12 +310,12 @@ void ec_device_send( ...@@ -310,12 +310,12 @@ void ec_device_send(
// frame statistics // frame statistics
if (unlikely(jiffies - device->stats_jiffies >= HZ)) { if (unlikely(jiffies - device->stats_jiffies >= HZ)) {
unsigned int i; unsigned int i;
unsigned int tx_frame_rate = u32 tx_frame_rate =
(device->tx_count - device->last_tx_count) * 1000; (u32) (device->tx_count - device->last_tx_count) * 1000;
unsigned int tx_byte_rate = u32 tx_byte_rate =
(device->tx_bytes - device->last_tx_bytes) * 1000; (device->tx_bytes - device->last_tx_bytes) * 1000;
int loss = device->tx_count - device->rx_count; u64 loss = device->tx_count - device->rx_count;
int loss_rate = (loss - device->last_loss) * 1000; s32 loss_rate = (s32) (loss - device->last_loss) * 1000;
for (i = 0; i < EC_RATE_COUNT; i++) { for (i = 0; i < EC_RATE_COUNT; i++) {
unsigned int n = rate_intervals[i]; unsigned int n = rate_intervals[i];
device->tx_frame_rates[i] = device->tx_frame_rates[i] =
......
...@@ -98,21 +98,19 @@ struct ec_device ...@@ -98,21 +98,19 @@ struct ec_device
unsigned long jiffies_poll; /**< jiffies of last poll */ unsigned long jiffies_poll; /**< jiffies of last poll */
// Frame statistics // Frame statistics
unsigned int tx_count; /**< Number of frames sent. */ u64 tx_count; /**< Number of frames sent. */
unsigned int rx_count; /**< Number of frames received. */ u64 last_tx_count; /**< Number of frames sent of last statistics cycle. */
unsigned int tx_bytes; /**< Number of frames sent. */ u64 rx_count; /**< Number of frames received. */
unsigned int tx_errors; /**< Number of transmit errors. */ u64 tx_bytes; /**< Number of frames sent. */
u64 last_tx_bytes; /**< Number of bytes sent of last statistics cycle. */
u64 tx_errors; /**< Number of transmit errors. */
u64 last_loss; /**< Tx/Rx difference of last statistics cycle. */
unsigned int tx_frame_rates[EC_RATE_COUNT]; /**< Transmit rates in unsigned int tx_frame_rates[EC_RATE_COUNT]; /**< Transmit rates in
frames/s for different frames/s for different
statistics cycle periods. */ statistics cycle periods. */
unsigned int tx_byte_rates[EC_RATE_COUNT]; /**< Transmit rates in byte/s unsigned int tx_byte_rates[EC_RATE_COUNT]; /**< Transmit rates in byte/s
for different statistics for different statistics
cycle periods. */ cycle periods. */
unsigned int last_tx_count; /**< Number of frames sent of last statistics
cycle. */
unsigned int last_tx_bytes; /**< Number of bytes sent of last statistics
cycle. */
int last_loss; /**< Tx/Rx difference of last statistics cycle. */
int loss_rates[EC_RATE_COUNT]; /**< Frame loss rates for different int loss_rates[EC_RATE_COUNT]; /**< Frame loss rates for different
statistics cycle periods. */ statistics cycle periods. */
unsigned long stats_jiffies; /**< Jiffies of last statistic cycle. */ unsigned long stats_jiffies; /**< Jiffies of last statistic cycle. */
......
...@@ -162,10 +162,10 @@ typedef struct { ...@@ -162,10 +162,10 @@ typedef struct {
uint8_t address[6]; uint8_t address[6];
uint8_t attached; uint8_t attached;
uint8_t link_state; uint8_t link_state;
uint32_t tx_count; uint64_t tx_count;
uint32_t rx_count; uint64_t rx_count;
uint32_t tx_bytes; uint64_t tx_bytes;
uint32_t tx_errors; uint64_t tx_errors;
uint32_t tx_frame_rates[EC_RATE_COUNT]; uint32_t tx_frame_rates[EC_RATE_COUNT];
uint32_t tx_byte_rates[EC_RATE_COUNT]; uint32_t tx_byte_rates[EC_RATE_COUNT];
int32_t loss_rates[EC_RATE_COUNT]; int32_t loss_rates[EC_RATE_COUNT];
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment