From owner-freebsd-sparc64@FreeBSD.ORG Sun Feb 5 14:44:29 2006 Return-Path: X-Original-To: freebsd-sparc64@freebsd.org Delivered-To: freebsd-sparc64@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 0C86D16A420 for ; Sun, 5 Feb 2006 14:44:29 +0000 (GMT) (envelope-from toa@pop.agri.ch) Received: from exsmtp02.agrinet.ch (exsmtp02.agrinet.ch [81.221.252.201]) by mx1.FreeBSD.org (Postfix) with ESMTP id 4EC0B43D66 for ; Sun, 5 Feb 2006 14:44:23 +0000 (GMT) (envelope-from toa@pop.agri.ch) Received: from smtp.messaging.ch ([10.50.252.215]) by exsmtp02.agrinet.ch with Microsoft SMTPSVC(6.0.3790.211); Sun, 5 Feb 2006 15:44:22 +0100 Received: from [192.168.225.5] ([80.219.88.141]) by smtp.messaging.ch with id tqkh1T00232ylCo0000000 for freebsd-sparc64@freebsd.org; Sun, 05 Feb 2006 15:44:42 +0100 X-IMP: RBL SBL+XBL: 0.00, RBL SPAMCOP: 0.00, RBL SORBS: 0.10, RBL MAPS_ORDB: 0.00, URL RHS: 0.00, URL SURBL: 0.00 Message-ID: <43E60F45.4070004@pop.agri.ch> Date: Sun, 05 Feb 2006 15:44:21 +0100 From: Andreas Tobler User-Agent: Thunderbird 1.5 (Macintosh/20051201) MIME-Version: 1.0 To: Marius Strobl References: <43E3D228.6060801@pop.agri.ch> <20060205112432.A3868@newtrinity.zeist.de> <43E5D988.2070009@pop.agri.ch> <20060205122153.O68720@newtrinity.zeist.de> <43E5E70D.1090209@pop.agri.ch> <20060205132234.P68720@newtrinity.zeist.de> In-Reply-To: <20060205132234.P68720@newtrinity.zeist.de> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-OriginalArrivalTime: 05 Feb 2006 14:44:22.0415 (UTC) FILETIME=[A70879F0:01C62A62] Cc: freebsd-sparc64@freebsd.org Subject: Re: profiling with cc X-BeenThere: freebsd-sparc64@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Porting FreeBSD to the Sparc List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Feb 2006 14:44:29 -0000 Marius Strobl wrote: > On Sun, Feb 05, 2006 at 12:52:45PM +0100, Andreas Tobler wrote: >> Marius Strobl wrote: >> >>> I think all it takes is the MD _mcount() -> mcount() wrapper but I'm >>> not sure what it's actually supposed to do. >> Ok, thank you for the pointer. I try to read through the code and see if >> I can get something out of it. >> >> Build question, if I play around in this section, does it mean to >> rebuild the whole kernel/world everytime, or is it enough to just >> compile and install the modified parts ? >> > > AFAICT the wrapper has to go into the userland version of the MCOUNT > macro in and you'll have to re-compile and re- > install libc, specifically libc_p.a, in order to test it. Good. To my understanding, the wrapper should look similar like in sys/amd64/include/profile.h? #else /* !_KERNEL */ #define _MCOUNT_DECL \ static void _mcount(uintfptr_t frompc, uintfptr_t selfpc) __used; \ static void _mcount #ifdef __GNUCLIKE_ASM #define MCOUNT \ __asm(".global " _mcount);\ __asm(_mcount ":");\ __asm("add %o7, 8, %o1");\ __asm("1: call 2f; nop; 2:");\ __asm("add %o7," __mcount "-1b, %o2");\ __asm("ld [%o2], %o2");\ __asm("jmpl %o2, %g0");\ __asm("add %i7, 8, %o0"); #else /* !__GNUCLIKE_ASM */ #define MCOUNT \ void \ mcount() \ { \ } #endif /* __GNUCLIKE_ASM */ Or am I looking to far? The above asm code comes from NetBSD... Thanks, Andreas