public inbox for systemtap@sourceware.org
 help / color / mirror / Atom feed
* [Bug kprobes/23186] New: struct flowi4 not found in kernel<net/flow.h> on kernel 3.10.0-862.2.3.el7.x86_64
@ 2018-05-15 19:27 cmedved at cloudamize dot com
  2018-05-21 17:26 ` [Bug kprobes/23186] " dsmith at redhat dot com
  0 siblings, 1 reply; 2+ messages in thread
From: cmedved at cloudamize dot com @ 2018-05-15 19:27 UTC (permalink / raw)
  To: systemtap

https://sourceware.org/bugzilla/show_bug.cgi?id=23186

            Bug ID: 23186
           Summary: struct flowi4 not found in kernel<net/flow.h> on
                    kernel 3.10.0-862.2.3.el7.x86_64
           Product: systemtap
           Version: unspecified
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: kprobes
          Assignee: systemtap at sourceware dot org
          Reporter: cmedved at cloudamize dot com
  Target Milestone: ---

Created attachment 11018
  --> https://sourceware.org/bugzilla/attachment.cgi?id=11018&action=edit
Sample script and error log.

SystemTap Version: 3.2/0.170, rpm 3.2-4.el7
Kernel: Linux stap-rhel7 3.10.0-862.2.3.el7.x86_64 #1 SMP Mon Apr 30 12:37:51
EDT 2018 x86_64 x86_64 x86_64 GNU/Linux

I'm trying to monitor udp_send_skb via dwarfless kprobes (kprobe.function). For
RHEL7 3.10.0-862 kernels, SystemTap fails to build my script with the error
"struct flowi4 not found in kernel<net/flow.h>". I would usually suspect
modifications in the kernel, but that does not appear to be the case.
/usr/src/kernels/3.10.0-862.2.3.el7.x86_64/include/net/flow.h contains the
definition of struct flowi4.

The script works fine when cross-compiling for any RHEL7 3.10.0-693 kernel
(among many others). A diff of include/net/flow.h between the two kernel
versions shows no differences.

Exact error from -vvv output:

semantic error: while processing probe kprobe.function("udp_send_skb")
   thrown from: elaborate.cxx:5751
semantic error: type definition 'struct flowi4' not found in
'kernel<net/flow.h>': operator '@cast' at test.stp:3:21
   thrown from: elaborate.cxx:6380
        source:     saddr = ip_ntop(@cast(fl4,"struct
flowi4","kernel<net/flow.h>")->saddr)
                                    ^

Attached is a sample script showing the issue, the -vvv log, and
/usr/src/kernels/3.10.0-862.2.3.el7.x86_64/include/net/flow.h, just in case.

Also, in case it's necessary, definition for udp_send_skb is here:
https://github.com/torvalds/linux/blob/v3.10/net/ipv4/udp.c#L743

Versions:
[root@stap-rhel7 ~]# rpm -qa --qf %{name}-%{version}-%{release}.%{arch}\\n |
egrep 'systemtap|elfutils|kernel|gcc' | sort
devtoolset-4-gcc-5.3.1-6.1.el7.x86_64
elfutils-default-yama-scope-0.170-4.el7.noarch
elfutils-libelf-0.170-4.el7.x86_64
elfutils-libs-0.170-4.el7.x86_64
gcc-4.8.5-28.el7_5.1.x86_64
kernel-3.10.0-693.el7.x86_64
kernel-3.10.0-862.2.3.el7.x86_64
kernel-debug-devel-3.10.0-862.2.3.el7.x86_64
kernel-devel-3.10.0-862.2.3.el7.x86_64
kernel-headers-3.10.0-862.2.3.el7.x86_64
kernel-tools-3.10.0-862.2.3.el7.x86_64
kernel-tools-libs-3.10.0-862.2.3.el7.x86_64
libgcc-4.8.5-28.el7_5.1.x86_64
systemtap-3.2-4.el7.x86_64
systemtap-client-3.2-4.el7.x86_64
systemtap-devel-3.2-4.el7.x86_64
systemtap-runtime-3.2-4.el7.x86_64

-- 
You are receiving this mail because:
You are the assignee for the bug.

^ permalink raw reply	[flat|nested] 2+ messages in thread

* [Bug kprobes/23186] struct flowi4 not found in kernel<net/flow.h> on kernel 3.10.0-862.2.3.el7.x86_64
  2018-05-15 19:27 [Bug kprobes/23186] New: struct flowi4 not found in kernel<net/flow.h> on kernel 3.10.0-862.2.3.el7.x86_64 cmedved at cloudamize dot com
@ 2018-05-21 17:26 ` dsmith at redhat dot com
  0 siblings, 0 replies; 2+ messages in thread
From: dsmith at redhat dot com @ 2018-05-21 17:26 UTC (permalink / raw)
  To: systemtap

https://sourceware.org/bugzilla/show_bug.cgi?id=23186

David Smith <dsmith at redhat dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
                 CC|                            |dsmith at redhat dot com
         Resolution|---                         |WORKSFORME

--- Comment #1 from David Smith <dsmith at redhat dot com> ---
This is really a problem with net/flow.h. It doesn't include <linux/kernel.h>
and <linux/bug.h>, even though it uses items from those headers. So, to fix
this, you need to change your script from:

====
probe kprobe.function("udp_send_skb") {
    fl4 = pointer_arg(2)
    saddr = ip_ntop(@cast(fl4,"struct flowi4","kernel<net/flow.h>")->saddr)
        printf("%s\n",saddr)
}
====

to:

====
probe kprobe.function("udp_send_skb") {
    fl4 = pointer_arg(2)
    saddr =
ip_ntop(@cast(fl4,"flowi4","kernel<linux/kernel.h><linux/bug.h><net/flow.h>")->saddr)
        printf("%s\n",saddr)
}
====

-- 
You are receiving this mail because:
You are the assignee for the bug.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2018-05-21 17:26 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-05-15 19:27 [Bug kprobes/23186] New: struct flowi4 not found in kernel<net/flow.h> on kernel 3.10.0-862.2.3.el7.x86_64 cmedved at cloudamize dot com
2018-05-21 17:26 ` [Bug kprobes/23186] " dsmith at redhat dot com

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).