From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24207 invoked by alias); 9 Jan 2009 02:32:22 -0000 Received: (qmail 24200 invoked by uid 22791); 9 Jan 2009 02:32:22 -0000 X-SWARE-Spam-Status: No, hits=-1.8 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_93,UNPARSEABLE_RELAY X-Spam-Check-By: sourceware.org Received: from rcsinet12.oracle.com (HELO rgminet12.oracle.com) (148.87.113.124) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 09 Jan 2009 02:32:15 +0000 Received: from rgminet15.oracle.com (rcsinet15.oracle.com [148.87.113.117]) by rgminet12.oracle.com (Switch-3.3.1/Switch-3.3.1) with ESMTP id n092VaIm010239 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Fri, 9 Jan 2009 02:31:38 GMT Received: from acsmt705.oracle.com (acsmt705.oracle.com [141.146.40.83]) by rgminet15.oracle.com (Switch-3.3.1/Switch-3.3.1) with ESMTP id n092Vqrn018626; Fri, 9 Jan 2009 02:31:54 GMT Received: from dhcp-beijing-cdc-10-182-120-164.cn.oracle.com (/10.182.120.164) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Fri, 09 Jan 2009 02:31:52 +0000 Message-ID: <4966B66B.5070301@oracle.com> Date: Fri, 09 Jan 2009 02:32:00 -0000 From: Wenji Huang Reply-To: wenji.huang@oracle.com User-Agent: Thunderbird 2.0.0.12 (X11/20080213) MIME-Version: 1.0 To: "Frank Ch. Eigler" CC: systemTAP Subject: Re: Too larger number in badkprobe test on 32 bits machine. References: <49631A6E.20305@oracle.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-IsSubscribed: yes Mailing-List: contact systemtap-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Post: List-Help: , Sender: systemtap-owner@sourceware.org X-SW-Source: 2009-q1/txt/msg00071.txt.bz2 Frank Ch. Eigler wrote: > Wenji Huang writes: > >> [...] >> kernel.statement(-1).absolute {} probe timer.s(1) { exit() }' >> [...] >> /tmp/staplt6ZIz/stap_84012a21d1a75884e8298817a3e8ad51_390.c:235: >> warning: integer constant is too large for 'unsigned long' type >> /tmp/staplt6ZIz/stap_84012a21d1a75884e8298817a3e8ad51_390.c:235: >> warning: large integer implicitly truncated to unsigned type >> make[1]: *** >> [...] >> Seems "-1" is interpreted as 64-bit number and not appropriate for 32 >> bits machine. Change to other number or update translate.cxx to >> perform explicitly truncation ? > > Yeah, translate.cxx could do it - the trick is finding a series of > casts that quietly truncates the value. (Changing the test case to > some other number like 0 would only paper over the problem.) > > - FChE > Seems the following patch can solve the problem. diff --git a/tapsets.cxx b/tapsets.cxx index 20bea45..abc0fae 100644 --- a/tapsets.cxx +++ b/tapsets.cxx @@ -5039,7 +5039,7 @@ dwarf_derived_probe_group::emit_module_decls (systemtap_session& s) assert (p->maxactive_val >= 0 && p->maxactive_val <= USHRT_MAX); s.op->line() << " .maxactive_val=" << p->maxactive_val << ","; } - s.op->line() << " .address=0x" << hex << p->addr << dec << "UL,"; + s.op->line() << " .address=(unsigned long)0x" << hex << p->addr << dec << "ULL,"; s.op->line() << " .module=\"" << p->module << "\","; s.op->line() << " .section=\"" << p->section << "\","; s.op->line() << " .pp=" << lex_cast_qstring (*p->sole_location()) << ","; Did some tests on x86 and x86_64. The good result is achieved. Probe kernel.statement(0x123456789) will be truncated into kernel.statement(0x12345678) on 32 bits machine. $ uname -mr 2.6.26 i686 $ sudo stap -g -w -e 'probe kernel.statement(-1).absolute {}probe timer.s(1) { exit() }' WARNING: probe kernel.statement(-1).absolute registration error (rc -22) Regards, Wenji