aboutsummaryrefslogtreecommitdiff
path: root/driver/gator_events_net.c
diff options
context:
space:
mode:
authorDrew Richardson <drew.richardson@arm.com>2012-05-15 12:00:00 -0700
committerDrew Richardson <drew.richardson@arm.com>2014-12-19 15:27:22 -0800
commit3abe11d177c6c93fab66d04fd42d11452a0c508e (patch)
tree9ddc541993bd0859f27bf7468e44b5155e5a0494 /driver/gator_events_net.c
parent3de04f9cecf0d50e895f9fe0164ecbbbae997319 (diff)
downloadgator-3abe11d177c6c93fab66d04fd42d11452a0c508e.tar.gz
gator: Version 5.105.10
Signed-off-by: Drew Richardson <drew.richardson@arm.com>
Diffstat (limited to 'driver/gator_events_net.c')
-rw-r--r--driver/gator_events_net.c17
1 files changed, 15 insertions, 2 deletions
diff --git a/driver/gator_events_net.c b/driver/gator_events_net.c
index ef1623b..9298905 100644
--- a/driver/gator_events_net.c
+++ b/driver/gator_events_net.c
@@ -9,6 +9,7 @@
#include "gator.h"
#include <linux/netdevice.h>
+#include <linux/hardirq.h>
#define NETRX 0
#define NETTX 1
@@ -20,7 +21,7 @@ static ulong netrx_key;
static ulong nettx_key;
static int rx_total, tx_total;
static ulong netPrev[TOTALNET];
-static int netGet[TOTALNET * 2];
+static int netGet[TOTALNET * 4];
static void get_network_stats(struct work_struct *wsptr) {
int rx = 0, tx = 0;
@@ -102,19 +103,31 @@ static int gator_events_net_read(int **buffer)
if (smp_processor_id() != 0)
return 0;
- schedule_work(&wq_get_stats);
+ if (!netrx_enabled && !nettx_enabled)
+ return 0;
+
+ if (in_interrupt()){
+ schedule_work(&wq_get_stats);
+ } else {
+ get_network_stats(NULL);
+ }
+
calculate_delta(&rx_delta, &tx_delta);
len = 0;
if (netrx_enabled && last_rx_delta != rx_delta) {
last_rx_delta = rx_delta;
netGet[len++] = netrx_key;
+ netGet[len++] = 0; // indicates to Streamline that rx_delta bytes were transmitted now, not since the last message
+ netGet[len++] = netrx_key;
netGet[len++] = rx_delta;
}
if (nettx_enabled && last_tx_delta != tx_delta) {
last_tx_delta = tx_delta;
netGet[len++] = nettx_key;
+ netGet[len++] = 0; // indicates to Streamline that tx_delta bytes were transmitted now, not since the last message
+ netGet[len++] = nettx_key;
netGet[len++] = tx_delta;
}