public inbox for systemtap@sourceware.org
 help / color / mirror / Atom feed
* tapset/aux_syscalls.stp is broken on powerpc and s390x
@ 2009-03-06 14:23 Mahesh Jagannath Salgaonkar
  0 siblings, 0 replies; only message in thread
From: Mahesh Jagannath Salgaonkar @ 2009-03-06 14:23 UTC (permalink / raw)
  To: systemtap

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.



^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2009-03-06 10:40 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-03-06 14:23 tapset/aux_syscalls.stp is broken on powerpc and s390x Mahesh Jagannath Salgaonkar

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).