ARM-software / gator

Sources for Arm Streamline's gator daemon, part of Arm Mobile Studio suite of performance analysis tools
https://www.arm.com/products/development-tools/graphics/arm-mobile-studio
133 stars 70 forks source link

Net events always 0, net_wake_up_timer doesn't expire #12

Closed wdobbe closed 1 year ago

wdobbe commented 5 years ago

I'm using Streamline 5.12.2 (last version of DS-5) with corresponding gator version 6.71. Target is powered by an i.MX6quad (4 x CortexA9). Kernel 4.9.88.

All counters in Streamline work fine, except the 'Network: Receive' and 'Network: Transmit' counters in the 'Linux' section. They are always at 0 even though there is network traffic.

I had a look at the gator.ko module with the DS-5 kernel debugger and notice that the net_wake_up_timer timer in file gator_events_net.c never seems to expire and as a result get_network_stats is never called (except once from gator_events_net_start).

When I call the get_network_stats function directly from gator_events_net_read (see diff below) the network rx/tx counters in Streamline come back to life.

Why is the timer necessary? Is it not allowed to call functions that can sleep from gator_events_net_read ?

thanks, Winfried

diff --git a/driver/gator_events_net.c b/driver/gator_events_net.c
index 79afc5f..294cc56 100644
--- a/driver/gator_events_net.c
+++ b/driver/gator_events_net.c
@@ -116,7 +116,7 @@ static int gator_events_net_read(int **buffer, bool sched_switch)
     if (!netrx_enabled && !nettx_enabled)
         return 0;

-    mod_timer(&net_wake_up_timer, jiffies + 1);
+    get_network_stats(NULL);

     calculate_delta(&rx_delta, &tx_delta);
wdobbe commented 4 years ago

Another possible problem:

In function gator_events_net_read a counter update is sent to the streamline GUI only if the following condition is true: if (netrx_enabled && last_rx_delta != rx_delta)

I don't see the need for the 'last_rx_delta != rx_delta' part.

I checked by transferring a 16.7 MB file to my target via scp. With the original code Streamline reports only 12.9 MB has been transferred. If I remove the ' last_rx_delta != rx_delta' part then Streamline reports that 16.7 MB has been transferred.

Same of course for the tx_delta update.

bengaineyarm commented 1 year ago

gator.ko was deprecated and removed some time ago.