From owner-freebsd-hackers Mon Jul 31 4: 8:25 2000 Delivered-To: freebsd-hackers@freebsd.org Received: from idet.rsn.hk-r.se (idet.rsn.hk-r.se [194.47.142.179]) by hub.freebsd.org (Postfix) with ESMTP id 1FA7437BC17 for ; Mon, 31 Jul 2000 04:08:21 -0700 (PDT) (envelope-from bjorn@tornqvist.net) Received: from tornqvist.net ([194.52.130.37]) by idet.rsn.hk-r.se (8.9.3/8.9.3) with ESMTP id NAA03935 for ; Mon, 31 Jul 2000 13:04:55 +0200 (CEST) (envelope-from bjorn@tornqvist.net) Message-ID: <39855E20.37377FF5@tornqvist.net> Date: Mon, 31 Jul 2000 13:08:16 +0200 From: Bjorn Tornqvist Organization: West Entertainment Solutions & Technologies AB X-Mailer: Mozilla 4.72 [en] (X11; I; Linux 2.2.12 i386) X-Accept-Language: en MIME-Version: 1.0 To: freebsd-hackers@freebsd.org Subject: Howto profile my code? Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Howdy! Anyone know a working method to get profiling to work? (i.e. seeing something like "method a::getValue() spent 12s Usertime, 3s Kerneltime" etc). I've tried with gcc -mprofiler-epilogue but got the following linker error: MessageCenter.o: In function `MessageCenter::OpenNewInput(basic_string, __default_alloc_template >)': MessageCenter.o(.text+0x954): undefined reference to `mexitcount' So, searching the headers (in machine/asmacros.h) I found some reference to GPROF so I tried to define it, but it still doesn't work. Actually: the complete argumentlist to gcc is this: c++ -ggdb -D_THREAD_SAFE -D_REENTRANT -Wall -pedantic -ansi -pipe -D_PTHREADS -DGPROF -mprofiler-epilogue -c MessageCenter.cpp c++ -ggdb -D_THREAD_SAFE -D_REENTRANT -Wall -pedantic -ansi -pipe -D_PTHREADS -DGPROF -mprofiler-epilogue MessageCenter.o -o runme -L/usr/local/lib -pthread MessageCenter.o: In function `MessageCenter::OpenNewInput(basic_string, __default_alloc_template >)': MessageCenter.o(.text+0x954): undefined reference to `mexitcount' (one error per method, of cource) What library should I link with? How do I use it? Documentation? TIA Bjorn btw: *sigh* I whish there was a common site like freebsddiary.org for us programmers - freebsdprogrammer.org would be fantastic). I just feel so stupid when I don't find any information after a couple of hours looking through searchengines, archives, the ports collection etc. Somehow freebsd-hackers@freebsd.org seem like the wrong place to ask (since I'm not hacking away at/inside freebsd itself. Please accept my apologies if this is the wrong forum for these questions. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message