Date: Mon, 31 Jul 2000 13:08:16 +0200 From: Bjorn Tornqvist <bjorn@tornqvist.net> To: freebsd-hackers@freebsd.org Subject: Howto profile my code? Message-ID: <39855E20.37377FF5@tornqvist.net>
next in thread | raw e-mail | index | archive | help
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<char, string_char_traits<char>, __default_alloc_template<true, 0> >)': 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<char, string_char_traits<char>, __default_alloc_template<true, 0> >)': 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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?39855E20.37377FF5>