Bugzilla will be upgraded to version 5.0 on a still to be determined date in the near future. The original upgrade date has been delayed.
Bug 1506230 - nettop.stp does not collect receive data on kernel-3.10.0-514.el7 and higher
nettop.stp does not collect receive data on kernel-3.10.0-514.el7 and higher
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: systemtap (Show other bugs)
7.4
x86_64 Linux
unspecified Severity medium
: rc
: ---
Assigned To: Frank Ch. Eigler
Martin Cermak
Vladimír Slávik
:
Depends On:
Blocks: 1459581 1522983
  Show dependency treegraph
 
Reported: 2017-10-25 09:06 EDT by Lukas Herbolt
Modified: 2018-04-10 12:33 EDT (History)
11 users (show)

See Also:
Fixed In Version: systemtap-3.2-3.el7
Doc Type: If docs needed, set a value
Doc Text:
see https://bugzilla.redhat.com/show_bug.cgi?id=1473722
Story Points: ---
Clone Of:
: 1546179 (view as bug list)
Environment:
Last Closed: 2018-04-10 12:32:40 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
netif_receive_skb.stp (248 bytes, text/plain)
2017-10-25 09:06 EDT, Lukas Herbolt
no flags Details
netif_receive_skb_internal.stp (264 bytes, text/plain)
2017-10-25 09:07 EDT, Lukas Herbolt
no flags Details
systemtap fix for the issue (877 bytes, application/mbox)
2017-10-25 09:07 EDT, Lukas Herbolt
no flags Details


External Trackers
Tracker ID Priority Status Summary Last Updated
Red Hat Product Errata RHEA-2018:0906 None None None 2018-04-10 12:33 EDT

  None (edit)
Description Lukas Herbolt 2017-10-25 09:06:36 EDT
Created attachment 1343237 [details]
netif_receive_skb.stp

Description of problem:
Running an example script netttop.stp from
/usr/share/systemtap/examples/network/nettop.stp does not collect any RECV_PK or 
RECV_KB.

# stap /usr/share/systemtap/examples/network/nettop.stp

 PID   UID DEV     XMIT_PK RECV_PK XMIT_KB RECV_KB COMMAND        
 2058     0 eth0      20026       0    1419       0 sshd           
    0     0 eth0       4068       0     263       0 swapper/0      
 2061     0 eth0        234       0      15       0 scp            


Version-Release number of selected component (if applicable):
This is happening since: kernel-3.10.0-514.el7
Actually looking into code it seems to be this commit:

RH commit: 988b8276bc4cf6cd653a9633ecdc4514e2ab7f44 
Upstream:  ae78dbfa40c629f79c72ab93525508ef49e798b6

There is a change in the netif_receive_skb() which is now calling netif_receive_skb_internal()

The systemtap script uses probe 'netdev.receive' which is defined as:
probe netdev.receive =
        kernel.function("netif_receive_skb")

in /usr/share/systemtap/tapset/linux/networking.stp. 
I was running live crash on the latest kernel:

crash> sys | grep REL 
     RELEASE: 3.10.0-693.5.2.el7.x86_64
crash> dis netif_receive_skb | head -5
0xffffffff81587290 <netif_receive_skb>:	callq  0xffffffff816b6df0 <ftrace_regs_caller>
0xffffffff81587295 <netif_receive_skb+5>:	push   %rbp
0xffffffff81587296 <netif_receive_skb+6>:	mov    %rsp,%rbp
0xffffffff81587299 <netif_receive_skb+9>:	push   %r12
0xffffffff8158729b <netif_receive_skb+11>:	mov    %rdi,%r12

Despite of I can see the stap module is bind there, I am getting no output.
The stap script is really easy one and is attached as:
 - netif_receive_skb.stp

Using the slightly modified version of it, hooked to the netif_receive_skb_internal
works as charm. Stap attached as well as netif_receive_skb_internal.stp. 

How reproducible:
just running stap /usr/share/systemtap/tapset/linux/networking.stp on one of the 
kernels 7.3+ 


Actual results:
no data collected on RECV_PKT or RECV_KB


Expected results:
data collected on RECV_PKT or RECV_KB

Additional info:
Attaching patch which will actually fix the issue from systemtap point of view.
But I am more interested why the probe does not work as I can see it is hooked in the disassembly.
Comment 2 Lukas Herbolt 2017-10-25 09:07 EDT
Created attachment 1343238 [details]
netif_receive_skb_internal.stp
Comment 3 Lukas Herbolt 2017-10-25 09:07 EDT
Created attachment 1343239 [details]
systemtap fix for the issue
Comment 4 David Smith 2017-10-25 16:50:07 EDT
(In reply to Lukas Herbolt from comment #0)
> Created attachment 1343237 [details]
> netif_receive_skb.stp
> 
> Description of problem:
> Running an example script netttop.stp from
> /usr/share/systemtap/examples/network/nettop.stp does not collect any
> RECV_PK or 
> RECV_KB.
> 
> # stap /usr/share/systemtap/examples/network/nettop.stp
> 
>  PID   UID DEV     XMIT_PK RECV_PK XMIT_KB RECV_KB COMMAND        
>  2058     0 eth0      20026       0    1419       0 sshd           
>     0     0 eth0       4068       0     263       0 swapper/0      
>  2061     0 eth0        234       0      15       0 scp            
> 
> 
> Version-Release number of selected component (if applicable):
> This is happening since: kernel-3.10.0-514.el7
> Actually looking into code it seems to be this commit:
> 
> RH commit: 988b8276bc4cf6cd653a9633ecdc4514e2ab7f44 
> Upstream:  ae78dbfa40c629f79c72ab93525508ef49e798b6
> 
> There is a change in the netif_receive_skb() which is now calling
> netif_receive_skb_internal()

Excellent debugging work here. Those commits do appear to be the problem.

... stuff deleted ...

> Additional info:
> Attaching patch which will actually fix the issue from systemtap point of
> view.
> But I am more interested why the probe does not work as I can see it is
> hooked in the disassembly.

The netdev.receive probe hooks netif_receive_skb(). Before those commits, all the traffic received by the kernel went through netif_receive_skb(). After those commits you referenced, that is no longer the case. So, even though that probe is placed at that function, the function is no longer called as much (probably only by drivers in a loadable module).

I checked in your patch upstream as commit 94b3978aa:

https://sourceware.org/git/gitweb.cgi?p=systemtap.git;a=commit;h=94b3978aa1d01f09b29dbc2d61e1a2bddec313df

This patch will need to be backported.
Comment 5 Frank Ch. Eigler 2017-11-28 21:00:19 EST
*** Bug 1518462 has been marked as a duplicate of this bug. ***
Comment 13 errata-xmlrpc 2018-04-10 12:32:40 EDT
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHEA-2018:0906

Note You need to log in before you can comment on or make changes to this bug.