Bug 6967 - systemtap broken on s390x, compilation error
Summary: systemtap broken on s390x, compilation error
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: 2008-10-20 13:52 UTC by Petr Muller
Modified: 2008-10-29 00:53 UTC (History)
0 users

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


Attachments
test module (245 bytes, text/plain)
2008-10-22 00:22 UTC, Jim Keniston
Details
Makefile for building test module (180 bytes, text/plain)
2008-10-22 00:28 UTC, Jim Keniston
Details
proposed fix (519 bytes, patch)
2008-10-24 19:07 UTC, Jim Keniston
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Petr Muller 2008-10-20 13:52:34 UTC
After this commit:

commit 52333a6929a036ba787593eb42acab81d11d91b1
Author: Jim Keniston <jkenisto@us.ibm.com>
Date:   Fri Oct 17 14:43:40 2008 -0700

    PR6923: Make on_each_cpu() autoconf test work on old kernels.

Things became severely broken on s390x, with 2.6.18-92.el5 / 2.6.18-118.el5 
kernel.  (RHEL5.2 kernels). The list of testsuite regressions is too long 
here :)

Stap burns down with this error:
# /usr/local/bin/stap ../testsuite/systemtap.base/ctime.stp -vv
SystemTap translator/driver (version 0.7.1/0.137 git branch (no branch), commit 
52333a69)
Copyright (C) 2005-2008 Red Hat, Inc. and others
This is free software; see the source for copying conditions.
Session arch: s390x release: 2.6.18-118.el5
Created temporary directory "/tmp/stapMye1Be"
Searched '/usr/local/share/systemtap/tapset/s390x/*.stp', found 1
Searched '/usr/local/share/systemtap/tapset/*.stp', found 43
Pass 1: parsed user script and 44 library script(s) in 460usr/10sys/1220real ms.
Pass 2: analyzed script: 1 probe(s), 2 function(s), 0 embed(s), 0 global(s) in 
10usr/0sys/8real ms.
Pass 3: translated to C into "/tmp/stapMye1Be/
stap_3a0a4fb7429a0207fe92ebdef2ddb987_4416.c" in 20usr/200sys/574real ms.
Running make -C "/lib/modules/2.6.18-118.el5/build" M="/tmp/stapMye1Be" modules 
>/dev/null
In file included from /usr/local/share/systemtap/runtime/transport/
transport.c:20,
                 from /usr/local/share/systemtap/runtime/print.c:17,
                 from /usr/local/share/systemtap/runtime/runtime.h:84,
                 from /tmp/stapMye1Be/
stap_3a0a4fb7429a0207fe92ebdef2ddb987_4416.c:41:
/usr/local/share/systemtap/runtime/time.c: In function \u2018_stp_init_time
\u2019:
/usr/local/share/systemtap/runtime/time.c:243: error: too few arguments to 
function \u2018on_each_cpu\u2019
make[1]: *** [/tmp/stapMye1Be/stap_3a0a4fb7429a0207fe92ebdef2ddb987_4416.o] 
Error 1
make: *** [_module_/tmp/stapMye1Be] Error 2
Pass 4: compiled C into "stap_3a0a4fb7429a0207fe92ebdef2ddb987_4416.ko" in 
1500usr/290sys/3739real ms.
Pass 4: compilation failed.  Try again with more '-v' (verbose) options.
Running rm -rf /tmp/stapMye1Be
Comment 1 Jim Keniston 2008-10-20 18:23:21 UTC
I think the problem is that asm-s390/irqflags.h calls typecheck() (unlike the
other asm/irqflags.h files).  typecheck() is defined in linux/kernel.h.  Could
you try the following fix?

In runtime/autoconf-oneachcpu-retry.c, change
#include <linux/stddef.h>
to
#include <linux/kernel.h>

Thanks.
Comment 2 Petr Muller 2008-10-21 12:55:46 UTC
Tried to make this change, rebuild and test again - seen the same error
Comment 3 Jim Keniston 2008-10-22 00:22:49 UTC
Created attachment 3013 [details]
test module

Given the to-be-attached Makefile, does this module build cleanly?  If not,
what are the error messages?
Comment 4 Jim Keniston 2008-10-22 00:28:52 UTC
Created attachment 3014 [details]
Makefile for building test module

Given this Makefile and m6967.c, please run
$ make > log 2>&1
and post the log file.	That should help us understand why
runtime/autoconf-oneachcpu-retry.c isn't compiling successfully.
Comment 5 Petr Muller 2008-10-22 10:07:07 UTC
That compiles cleanly. However, I've modified the Makefile generated by 
systemtap do do not throw away the stap_check_build output, and I saw the 
following error:

In file included from include/linux/
irqflags.h:46,                                                                                    
                 from /usr/local/share/systemtap/runtime/autoconf-oneachcpu-
retry.c:2:                                                
include/asm/irqflags.h: In function 
‘raw_irqs_disabled_flags’:                                                                        
include/asm/irqflags.h:49: error: ‘__FLAG_SHIFT’ undeclared (first use in this 
function)

And indeed, if I do a hack and directly include <asm/system.h> (where 
__FLAGS_SHIFT is defined) to runtime/autoconf-oneachcpu-retry.c, things start 
to work, and systemtap starts to work correctly.
Comment 6 Jim Keniston 2008-10-24 19:07:05 UTC
Created attachment 3023 [details]
proposed fix

Here's a patch that's intended to address the behaviors described so far.  It
seems to work on i386 and x86_64.
Comment 7 Frank Ch. Eigler 2008-10-29 00:53:30 UTC
commit 68c7faf
tested on rhel5 s390x|ia64|x86_64|x86 and fedora9 x86_64