From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Ky7XF-0007FF-12 for qemu-devel@nongnu.org; Thu, 06 Nov 2008 11:16:41 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Ky7XE-0007F2-NN for qemu-devel@nongnu.org; Thu, 06 Nov 2008 11:16:40 -0500 Received: from [199.232.76.173] (port=50048 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Ky7XE-0007Ez-Dh for qemu-devel@nongnu.org; Thu, 06 Nov 2008 11:16:40 -0500 Received: from hall.aurel32.net ([88.191.82.174]:52810) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1Ky7XE-00009t-5n for qemu-devel@nongnu.org; Thu, 06 Nov 2008 11:16:40 -0500 Received: from p-jarno.univ-lyon1.fr ([134.214.4.132] helo=volta.aurel32.net) by hall.aurel32.net with esmtpsa (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.63) (envelope-from ) id 1Ky7XC-0001UJ-J0 for qemu-devel@nongnu.org; Thu, 06 Nov 2008 17:16:38 +0100 Received: from aurel32 by volta.aurel32.net with local (Exim 4.69) (envelope-from ) id 1Ky7X7-00029q-Bs for qemu-devel@nongnu.org; Thu, 06 Nov 2008 17:16:33 +0100 Date: Thu, 6 Nov 2008 17:16:33 +0100 From: Aurelien Jarno Subject: Re: [Qemu-devel] [PATCH] User qemu profiling Message-ID: <20081106161633.GD5083@volta.aurel32.net> References: <761ea48b0810290228i6ad068b1maa9cd4ea325ab691@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15 Content-Disposition: inline In-Reply-To: <761ea48b0810290228i6ad068b1maa9cd4ea325ab691@mail.gmail.com> Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org On Wed, Oct 29, 2008 at 10:28:14AM +0100, Laurent Desnogues wrote: > Hello, > > this patch: > > - Makefile.target: re-enable profiling for user qemu. It seems > profiling was (accidently?) removed by commit 3937 > > - syscall.c: > * add an include to get _mcleanup prototype > * add a call to _mcleanup for exit_group in a way > similar to what is done for exit > > BTW, I wonder why -p is preferred over -pg for profiling. > > Thanks, > > Laurent Applied, thanks > Index: Makefile.target > =================================================================== > --- Makefile.target (revision 5545) > +++ Makefile.target (working copy) > @@ -394,6 +394,12 @@ > endif > endif > > +# profiling code > +ifdef TARGET_GPROF > +LDFLAGS+=-p > +CFLAGS+=-p > +endif > + > OBJS= main.o syscall.o strace.o mmap.o signal.o path.o thunk.o \ > elfload.o linuxload.o uaccess.o > LIBS+= $(AIOLIBS) > Index: linux-user/syscall.c > =================================================================== > --- linux-user/syscall.c (revision 5566) > +++ linux-user/syscall.c (working copy) > @@ -54,6 +54,9 @@ > #include > #include > #include > +#ifdef HAVE_GPROF > +#include > +#endif > > #define termios host_termios > #define winsize host_winsize > @@ -4864,6 +4867,9 @@ > #ifdef __NR_exit_group > /* new thread calls */ > case TARGET_NR_exit_group: > +#ifdef HAVE_GPROF > + _mcleanup(); > +#endif > gdb_exit(cpu_env, arg1); > ret = get_errno(exit_group(arg1)); > break; -- .''`. Aurelien Jarno | GPG: 1024D/F1BCDB73 : :' : Debian developer | Electrical Engineer `. `' aurel32@debian.org | aurelien@aurel32.net `- people.debian.org/~aurel32 | www.aurel32.net