This is the mail archive of the
systemtap@sourceware.org
mailing list for the systemtap project.
tapset/aux_syscalls.stp is broken on powerpc and s390x
- From: Mahesh Jagannath Salgaonkar <mahesh at linux dot vnet dot ibm dot com>
- To: systemtap at sourceware dot org
- Date: Fri, 06 Mar 2009 16:08:31 +0530
- Subject: tapset/aux_syscalls.stp is broken on powerpc and s390x
Hi,
While testing latest systemtap on powerpc(ppc64) and s390 I came across
the following errors:
---------------------------------------------------------------------------
[root@mjs22lp5 systemtap-latest-5Mar]# stap --vp 0001 --vp 0001
/home/mahesh/systemtap-latest-5Mar/testsuite/systemtap.syscall/sys.stp
Running make -C "/lib/modules/2.6.29-rc7/build" M="/tmp/stapH7yLnd"
modules >/dev/null
cc1: warnings being treated as errors
/tmp/stapH7yLnd/stap_74ac806dcc70200660b45363e8232dd4_440413.c: In
function ‘function__struct_sockaddr_u’:
/tmp/stapH7yLnd/stap_74ac806dcc70200660b45363e8232dd4_440413.c:21870:
warning: format ‘%lx’ expects type ‘long unsigned int’, but argument 9
has type ‘uint64_t’
make[1]: ***
[/tmp/stapH7yLnd/stap_74ac806dcc70200660b45363e8232dd4_440413.o] Error 1
make: *** [_module_/tmp/stapH7yLnd] Error 2
Pass 4: compiled C into
"stap_74ac806dcc70200660b45363e8232dd4_440413.ko" in
1520usr/610sys/2536real ms.
Pass 4: compilation failed. Try again with another '--vp 0001' option.
Running rm -rf /tmp/stapH7yLnd
[root@mjs22lp5 systemtap-latest-5Mar]#
---------------------------------------------------------------------------
Analysing the issue further I saw following code at
'tapset/aux_syscalls.stp:327' which is the cause of above error:
/* FIXME. This needs tested */
struct sockaddr_ll *sll = (struct sockaddr_ll *)buf;
#if defined(__powerpc__) || defined(__ia64__) || defined(__s390x__)
snprintf(str, strlen, "{AF_PACKET, proto=%d, ind=%d, hatype=%d,
pkttype=%d, halen=%d, addr=0x%lx}",
(int)sll->sll_protocol, sll->sll_ifindex, (int)sll->sll_hatype,
(int)sll->sll_pkttype,
(int)sll->sll_halen, *(uint64_t *)sll->sll_addr);
#else
snprintf(str, strlen, "{AF_PACKET, proto=%d, ind=%d, hatype=%d,
pkttype=%d, halen=%d, addr=0x%llx}",
(int)sll->sll_protocol, sll->sll_ifindex, (int)sll->sll_hatype,
(int)sll->sll_pkttype,
(int)sll->sll_halen, *(uint64_t *)sll->sll_addr);
#endif
The above piece of code either uses "addr=%lx" or "addr=%llx" for
printing 64bit value depending on system type. On powerpc and s390x the
code that uses "%lx" gets executed and fails with a warning. Where as,
the format "%llx" works fine on powerpc and s390x . Hence I was
wondering, do we really need #ifdef ? We can use "%llx" safely for all
system type.
Any comments.
Thanks,
-Mahesh.