From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14302 invoked by alias); 27 Jan 2007 22:12:56 -0000 Received: (qmail 14294 invoked by uid 22791); 27 Jan 2007 22:12:55 -0000 X-Spam-Check-By: sourceware.org Received: from viper.snap.net.nz (HELO viper.snap.net.nz) (202.37.101.8) by sourceware.org (qpsmtpd/0.31) with ESMTP; Sat, 27 Jan 2007 22:12:48 +0000 Received: from kahikatea.snap.net.nz (164.61.255.123.dynamic.snap.net.nz [123.255.61.164]) by viper.snap.net.nz (Postfix) with ESMTP id 0A0CF3D82C9; Sun, 28 Jan 2007 11:12:46 +1300 (NZDT) Received: by kahikatea.snap.net.nz (Postfix, from userid 500) id A509F4F71E; Sun, 28 Jan 2007 11:12:47 +1300 (NZDT) From: Nick Roberts MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <17851.52828.565167.635524@kahikatea.snap.net.nz> Date: Sat, 27 Jan 2007 22:12:00 -0000 To: Eli Zaretskii Cc: gdb-patches@sources.redhat.com Subject: Re: [PATCH] MI: new timing command In-Reply-To: References: <17814.10139.269708.848818@kahikatea.snap.net.nz> <17814.58031.865155.682869@kahikatea.snap.net.nz> <20061231042547.GA3236@nevyn.them.org> <17815.18190.987950.612053@kahikatea.snap.net.nz> <20061231054946.GA4873@nevyn.them.org> <17815.27092.497145.908734@kahikatea.snap.net.nz> <20061231151527.GC16449@nevyn.them.org> <200612311524.kBVFObud010411@brahms.sibelius.xs4all.nl> <200612311609.kBVG9Fgh022431@brahms.sibelius.xs4all.nl> <17816.34925.514170.51734@farnswood.snap.net.nz> <17817.34304.221915.628057@kahikatea.snap.net.nz> <17836.26941.915573.399839@kahikatea.snap.net.nz> <17842.33386.836316.276127@kahikatea.snap.net.nz> X-Mailer: VM 7.19 under Emacs 22.0.93.2 X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2007-01/txt/msg00558.txt.bz2 > > + usec = get_run_time (); > > + tv->wallclock.tv_sec = usec/1000000; > > + tv->wallclock.utv_sec = usec - 1000000*tv->wallclock.tv_sec; > > + tv->rusage.ru_utime.tv_sec = 0; > > + tv->rusage.ru_utime.tv_usec = 0; > > + tv->rusage.ru_stime.tv_sec = 0; > > + tv->rusage.ru_stime.tv_usec = 0; > > + #endif > > + } > > Also note that this line: > > > + tv->wallclock.utv_sec = usec - 1000000*tv->wallclock.tv_sec; > > has a typo: it uses utv_sec instead of tv_usec. I don't think so as get_run_time returns the time in microseconds e.g usec = 1234567 tv->wallclock.tv_sec = 1234567/1000000 = 1 tv->wallclock.utv_sec = 1234567 - 1000000 = 234567 -- Nick http://www.inet.net.nz/~nickrob