From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19109 invoked by alias); 31 Dec 2006 05:49:55 -0000 Received: (qmail 19100 invoked by uid 22791); 31 Dec 2006 05:49:55 -0000 X-Spam-Check-By: sourceware.org Received: from nevyn.them.org (HELO nevyn.them.org) (66.93.172.17) by sourceware.org (qpsmtpd/0.31.1) with ESMTP; Sun, 31 Dec 2006 05:49:50 +0000 Received: from drow by nevyn.them.org with local (Exim 4.63) (envelope-from ) id 1H0tZr-0001He-0H; Sun, 31 Dec 2006 00:49:47 -0500 Date: Sun, 31 Dec 2006 05:49:00 -0000 From: Daniel Jacobowitz To: Nick Roberts Cc: Eli Zaretskii , gdb-patches@sourceware.org Subject: Re: [PATCH] MI: new timing command Message-ID: <20061231054946.GA4873@nevyn.them.org> Mail-Followup-To: Nick Roberts , Eli Zaretskii , gdb-patches@sourceware.org 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> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <17815.18190.987950.612053@kahikatea.snap.net.nz> User-Agent: Mutt/1.5.13 (2006-08-11) 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: 2006-12/txt/msg00390.txt.bz2 On Sun, Dec 31, 2006 at 06:13:50PM +1300, Nick Roberts wrote: > > The autoconf manual has information about this sort of thing. I see > > that libiberty guards it, sometimes with HAVE_GETRUSAGE and other times > > with that and HAVE_SYS_RESOURCE_H. > > > > Will libiberty's get_run_time suffice for whatever you were doing, > > Nick? > > The manual says: > > -- Replacement: long get_run_time (void) > Returns the time used so far, in microseconds. If possible, this > is the time used by this process, else it is the elapsed time > since the process started. > > Without looking at the code, I would guess it's just a wrapper for getrusage > and it uses something like gettimeofday for elapsed time when it can't find > it. I think if user time isn't available it's best just to make > -enable-timings fail, so I'll use Eli's suggestion. In that case you can copy the necessary guards from that file. However, it does more than just getrusage - it also supports platforms with times() but without getrusage, which IIRC includes Windows, so it might be better to use it. I was wondering if we should make this a normal GDB setting, and use5C "-gdb-set mi profiling on" to enable it. There's already a maint setting to do the same thing for the CLI. -- Daniel Jacobowitz CodeSourcery