From owner-freebsd-current@FreeBSD.ORG Thu Jul 5 03:30:00 2007 Return-Path: X-Original-To: current@freebsd.org Delivered-To: freebsd-current@FreeBSD.ORG Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id D903116A46B for ; Thu, 5 Jul 2007 03:30:00 +0000 (UTC) (envelope-from youshi10@u.washington.edu) Received: from mxout7.cac.washington.edu (mxout7.cac.washington.edu [140.142.32.178]) by mx1.freebsd.org (Postfix) with ESMTP id B881A13C459 for ; Thu, 5 Jul 2007 03:30:00 +0000 (UTC) (envelope-from youshi10@u.washington.edu) Received: from smtp.washington.edu (smtp.washington.edu [140.142.33.7] (may be forged)) by mxout7.cac.washington.edu (8.13.7+UW06.06/8.13.7+UW07.06) with ESMTP id l653U0EX005838 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Wed, 4 Jul 2007 20:30:00 -0700 X-Auth-Received: from [192.168.10.45] (c-24-10-12-194.hsd1.ca.comcast.net [24.10.12.194]) (authenticated authid=youshi10) by smtp.washington.edu (8.13.7+UW06.06/8.13.7+UW07.03) with ESMTP id l653TxvI014750 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT) for ; Wed, 4 Jul 2007 20:30:00 -0700 Message-ID: <468C65BD.6050007@u.washington.edu> Date: Wed, 04 Jul 2007 20:30:05 -0700 From: Garrett Cooper User-Agent: Thunderbird 2.0.0.4 (Windows/20070604) MIME-Version: 1.0 To: current@freebsd.org Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-PMX-Version: 5.3.2.304607, Antispam-Engine: 2.5.1.298604, Antispam-Data: 2007.7.4.200854 X-Uwash-Spam: Gauge=IIIIIII, Probability=7%, Report='__CT 0, __CTE 0, __CT_TEXT_PLAIN 0, __HAS_MSGID 0, __MIME_TEXT_ONLY 0, __MIME_VERSION 0, __SANE_MSGID 0, __USER_AGENT 0' Cc: Subject: Can't profile automatically on x86/amd64 (after gcc 3.4.6 -> 4.2 upgrade?) X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Jul 2007 03:30:00 -0000 I don't know why but it appears that I can't automatically profile programs compiled with -pg. I've tried compensating by using clock_gettime(2), but I believe my energies can be better focused elsewhere instead of entering in a slew of printf(2) statements, by using gprof(1). When I try and use -pg under x86, the compiled program segfaults and when I try and backtrace the binary it segfaults and there appears to be an infinite recursion problem, then it dies at a point when it can't access the memory address: Program received signal SIGSEGV, Segmentation fault. 0x080506b4 in ?? () (gdb) bt #0 0x080506b4 in ?? () #1 0x33cb8a00 in ?? () #2 0x33d3a951 in ?? () #3 0xbfbfeb38 in ?? () #4 0x33c91530 in ?? () #5 0x00000007 in ?? () #6 0x33cb71c0 in ?? () #7 0xbfbfeacc in ?? () // etc ... #1350 0x90feeb80 in ?? () #1351 0xbfbfed28 in ?? () #1352 0x00000001 in ?? () #1353 0xbfbfed30 in ?? () #1354 0x00000013 in ?? () Error accessing memory address 0xbfc00000: Bad address. When I try and do the same under amd64, gprof(1) says "bad format" (an error attributed to bfd(1) not being able to decypher the bin info of the .gmon file). -Garrett