From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19288 invoked by alias); 9 Dec 2009 15:56:53 -0000 Received: (qmail 19281 invoked by uid 22791); 9 Dec 2009 15:56:52 -0000 X-SWARE-Spam-Status: No, hits=-2.5 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 09 Dec 2009 15:56:49 +0000 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id nB9FuaRM031107 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Wed, 9 Dec 2009 10:56:36 -0500 Received: from [127.0.0.1] (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id nB9FuYoj019520; Wed, 9 Dec 2009 10:56:35 -0500 Subject: Re: [PATCH 6/8] Use proper types for do_div From: Mark Wielaard To: Anton Vorontsov Cc: systemtap@sourceware.org, linuxppc-dev@ozlabs.org In-Reply-To: <20091127223347.GF21805@oksana.dev.rtsoft.ru> References: <20091127223251.GA17065@oksana.dev.rtsoft.ru> <20091127223347.GF21805@oksana.dev.rtsoft.ru> Content-Type: text/plain; charset="UTF-8" Date: Wed, 09 Dec 2009 15:56:00 -0000 Message-Id: <1260374194.31018.11.camel@springer.wildebeest.org> Mime-Version: 1.0 Content-Transfer-Encoding: 7bit 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-q4/txt/msg00856.txt.bz2 Hi Anton, On Sat, 2009-11-28 at 01:33 +0300, Anton Vorontsov wrote: > do_div accepts unsigned 64-bit integer type for dividend, signed types > would cause do_div's typecheck fail: > > stat-common.c: In function 'needed_space': > stat-common.c:50: error: comparison of distinct pointer types lacks a cast > ...same errors in time.c and tapset-timers.cxx's generated code... > > A fix for time.c is special, on ppc32 cycles_t is 32-bit, so technically > we don't need do_div, but since the whole _stp_gettimeofday_ns() operates > on 64-bit types we'd better be safe and use uint64_t for the math. > > Signed-off-by: Anton Vorontsov > --- > runtime/stat-common.c | 8 ++++---- > runtime/time.c | 3 ++- > tapset-timers.cxx | 2 +- > 3 files changed, 7 insertions(+), 6 deletions(-) I don't immediately see anything wrong with the code. But on x86_64 this does cause some regression test failures in testsuite/systemtap.maps. In particular the following tests now fail (they all pass with this one patch reverted): Running /home/mark/src/systemtap/testsuite/systemtap.maps/elision.exp ... FAIL: elision-1 FAIL: elision0 FAIL: elision1 FAIL: elision2 FAIL: elision3 Running /home/mark/src/systemtap/testsuite/systemtap.maps/ix.exp ... FAIL: systemtap.maps/ix.stp Running /home/mark/src/systemtap/testsuite/systemtap.maps/linear_large_neg.exp ... FAIL: systemtap.maps/linear_large_neg.stp Running /home/mark/src/systemtap/testsuite/systemtap.maps/linear_overunder.exp ... FAIL: systemtap.maps/linear_overunder.stp Running /home/mark/src/systemtap/testsuite/systemtap.maps/linear_under.exp ... FAIL: systemtap.maps/linear_under.stp Running /home/mark/src/systemtap/testsuite/systemtap.maps/log.exp ... FAIL: systemtap.maps/log.stp Running /home/mark/src/systemtap/testsuite/systemtap.maps/log_edge.exp ... FAIL: systemtap.maps/log_edge.stp Could you have a look? Thanks, Mark