Bug 18944 - the ioblock.stp tapset fails to compile on RHEL7
Summary: the ioblock.stp tapset fails to compile on RHEL7
Status: RESOLVED FIXED
Alias: None
Product: systemtap
Classification: Unclassified
Component: runtime (show other bugs)
Version: unspecified
: P2 normal
Target Milestone: ---
Assignee: Unassigned
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-09-09 20:35 UTC by David Smith
Modified: 2015-09-14 15:39 UTC (History)
0 users

See Also:
Host:
Target:
Build:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description David Smith 2015-09-09 20:35:41 UTC
On rhel7 (3.10.0-305.el7.x86_64), the buildok testsuite gets 3 failures from the ioblock tapset:

FAIL: buildok/ioblock-all-probes.stp
FAIL: buildok/ioblock-detailed.stp
FAIL: buildok/ioblock-embedded.stp

The errors are all the same:

====
Running ../../src/testsuite/buildok/ioblock-all-probes.stp
starting ../../src/testsuite/buildok/ioblock-all-probes.stp
spawn1 stap -wp4 ../../src/testsuite/buildok/ioblock-all-probes.stp
spawn stap -wp4 ../../src/testsuite/buildok/ioblock-all-probes.stp^M
/tmp/stap5pFzCi/stap_1a6f9b48025b6d740d13db61b520d558_2603_src.c:38:0: error: "REQ_WRITE" redefined [-Werror]^M
 #define REQ_WRITE               (1 << BIO_RW)^M
 ^^M
In file included from include/linux/fs.h:29:0,^M
                 from include/linux/ftrace.h:18,^M
                 from include/linux/kprobes.h:42,^M
                 from /usr/local/share/systemtap/runtime/linux/runtime.h:21,^M
                 from /usr/local/share/systemtap/runtime/runtime.h:24,^M
                 from /tmp/stap5pFzCi/stap_1a6f9b48025b6d740d13db61b520d558_2603_src.c:25:^M
include/linux/blk_types.h:212:0: note: this is the location of the previous definition^M
 #define REQ_WRITE  (1ULL << __REQ_WRITE)^M
 ^^M
cc1: all warnings being treated as errors^M
make[4]: *** [/tmp/stap5pFzCi/stap_1a6f9b48025b6d740d13db61b520d558_2603_src.o] Error 1^M
make[3]: *** [_module_/tmp/stap5pFzCi] Error 2^M
WARNING: kbuild exited with status: 2^M
Pass 4: compilation failed.  [man error::pass4]^M
====

What's odd here is that the ioblock tapset has code to deal with this:

====
%{
#include <linux/bio.h>
#include <linux/genhd.h>
#ifdef STAPCONF_BLK_TYPES
#include <linux/blk_types.h>
#else
#define REQ_WRITE               (1 << BIO_RW)
#endif
%}
====

STAPCONF_BLK_TYPES is supposed to get defined by one of our "autoconf" like tests when linux/blk_types.h is present and usable in the kernel source.

However, when this autoconf test is run, we get this error:

====
In file included from /usr/local/share/systemtap/runtime/linux/autoconf-blk-types.c:1:0:
include/linux/blk_types.h:113:2: error: expected specifier-qualifier-list before ‘RH_KABI_REPLACE’
  RH_KABI_REPLACE(void *rh_reserved1, struct bio_aux *bio_aux)
  ^
====

So, blk_types.h is present, but uses a Red Hat-only macro that comes from /usr/src/kernel/KVER/include/linux/rh_kabi.h. In a more perfect work blk_types.h would have included this file itself.

We'll need to rework the runtime/linux/autoconf-blk-types.c file to handle this.
Comment 1 David Smith 2015-09-14 15:39:00 UTC
Fixed in commit 6b53092.