Bug 5947 - make systemtap 0.6.2/0.131 work on F8 2.6.21.7-2.fc8xen
Summary: make systemtap 0.6.2/0.131 work on F8 2.6.21.7-2.fc8xen
Status: RESOLVED FIXED
Alias: None
Product: systemtap
Classification: Unclassified
Component: runtime (show other bugs)
Version: unspecified
: P2 normal
Target Milestone: ---
Assignee: Eugene Teo
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-03-17 03:27 UTC by Eugene Teo
Modified: 2008-11-28 16:27 UTC (History)
1 user (show)

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


Attachments
stap -ve 'probe begin { printf("hello world\n") }' -v &>log.txt (1.15 KB, text/plain)
2008-03-17 03:28 UTC, Eugene Teo
Details
stap -DSTAPCONF_INODE_PRIVATE -ve 'probe begin { printf("hello world\n") }' -v &>log2.txt (1.09 KB, text/plain)
2008-03-17 03:29 UTC, Eugene Teo
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Eugene Teo 2008-03-17 03:27:05 UTC
There were numerous warnings treated as errors when using systemtap and kernel
of the following versions:

fluffy: ~/code/systemtap$ stap -V
SystemTap translator/driver (version 0.6.2/0.131 built 2008-03-16)
Copyright (C) 2005-2008 Red Hat, Inc. and others
This is free software; see the source for copying conditions.
fluffy: ~/code/systemtap$ uname -rm
2.6.21.7-2.fc8xen x86_64

The following commands were executed:
stap -ve 'probe begin { printf("hello world\n") }' -v &>log.txt
stap -DSTAPCONF_INODE_PRIVATE -ve 'probe begin { printf("hello world\n") }' -v
&>log2.txt

The errors are saved in log.txt and log2.txt.

Thanks,
Eugene
Comment 1 Eugene Teo 2008-03-17 03:28:33 UTC
Created attachment 2329 [details]
stap -ve 'probe begin { printf("hello world\n") }' -v &>log.txt
Comment 2 Eugene Teo 2008-03-17 03:29:09 UTC
Created attachment 2330 [details]
stap -DSTAPCONF_INODE_PRIVATE -ve 'probe begin { printf("hello world\n") }' -v &>log2.txt
Comment 3 Frank Ch. Eigler 2008-03-17 13:40:56 UTC
The operative gcc warning is "warning: pointer of type 'void *' used in
arithmetic", which is a consequence of -Wpointer-arith.  I don't know
why this warning is turned on in your build.

Regardless, our own code should not calculate with uncast void*'s, which
appears to be gnu-c-ism, but rather cast to char*'s first.
Comment 4 Eugene Teo 2008-03-17 14:00:26 UTC
Looks like -Wpointer-arith is from /lib/modules/2.6.21.7-2.fc8xen/build/Makefile:

 315 CFLAGS          := -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs \
 316                    -fno-strict-aliasing -fno-common \
 317                    -Werror-implicit-function-declaration -Wpointer-arith

Removing -Wpointer-arith, and running scripts, will trigger the following error:

stap_872252efaf2a43c17f3b0b219f69fcf2_15559: Unknown symbol tsc_khz
Comment 5 Eugene Teo 2008-03-17 14:14:04 UTC
$ uname -rm
2.6.21.7-2.fc8xen x86_64

tsc_khz is not exported.

$ cat runtime/autoconf-tsc-khz.c 
#include <linux/version.h>
#include <asm/tsc.h>

#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,23)) && defined(__i386__) <---
removing the arch test will work. x64 is not tested, and so it assumes that
tsc_khz is exported when it's not.
Comment 6 Eugene Teo 2008-03-17 15:08:06 UTC
runtime/autoconf* change committed:
http://sources.redhat.com/ml/systemtap-cvs/2008-q1/msg00202.html

-Wpointer-arith in kernel-xen reported:
https://bugzilla.redhat.com/show_bug.cgi?id=437807

Thanks,
Eugene
Comment 7 Frank Ch. Eigler 2008-11-28 16:27:34 UTC
The systemtap runtime now builds with -Wpointer-arith;
the kernel's own include/linux/relay.h file doesn't, but
that's beyond our control.