From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6998 invoked by alias); 19 Dec 2007 13:22:21 -0000 Received: (qmail 6986 invoked by uid 22791); 19 Dec 2007 13:22:20 -0000 X-Spam-Check-By: sourceware.org Received: from web32702.mail.mud.yahoo.com (HELO web32702.mail.mud.yahoo.com) (68.142.207.246) by sourceware.org (qpsmtpd/0.31) with SMTP; Wed, 19 Dec 2007 13:20:21 +0000 Received: (qmail 58675 invoked by uid 60001); 19 Dec 2007 13:20:19 -0000 X-YMail-OSG: 1F1RHGwVM1klfPrMC_zau23U1eavWKz1GsReDMndD0W1_zJAT8WIEAiDFkkRDKLfcFFD4AUEpM_WoZUMCwab_iRZ4p_Qy79IT7Cte_RHcNyjWLp5xl6pbKF99gQloA-- Received: from [200.32.90.66] by web32702.mail.mud.yahoo.com via HTTP; Wed, 19 Dec 2007 10:20:19 ART Date: Wed, 19 Dec 2007 13:22:00 -0000 From: Juan Carlos Franzoy Subject: -pg profiling instrumentation question To: gcc-help@gcc.gnu.org MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Message-ID: <516934.57528.qm@web32702.mail.mud.yahoo.com> X-IsSubscribed: yes Mailing-List: contact gcc-help-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-help-owner@gcc.gnu.org X-SW-Source: 2007-12/txt/msg00340.txt.bz2 Hello. I am having problems profiling an application and was wondering if somebody there may help me. I think the problem is that one of our libraries break -pg instrumentation. I tried to make this post as short as possible. Forgive me if I did'nt make it. This library hide portabilities issues under a portable interface, allowing us to run in console mode, in daemon mode in unices or as a service in windows. As you may guess, it is a complex library that do a lot of things. I do not know which of these are hurting -pg. This pseudocode is a description of what I am doing. void a() {} void b() { for(int i=0; i < 10000; ++i) a(); } void f() {} void g() { for(int i=0; i < 10000; ++i) f(); } class MyModule() ... { public: ... void operator()() { ... // *2 for(int i=0; i < 10000; ++i) g(); return; } } myModule( .... ); int main() { ... // *1 for(int i=0; i < 10000; ++i) b(); mylib::registerModule(myModule); mylib::run(); // create a thread per module ... } The problem is that the profiling information contain time information for b() and a() but no for g() and f(). On the other hand the call count is the same. --- gprof output --- Flat profile: Each sample counts as 0.01 seconds. % self self total time seconds calls ms/call ms/call name 50.00 0.22 10000 0.02 0.04 a() 29.55 0.13 100000000 0.00 0.00 b() 20.45 0.09 1 90.00 90.00 _static_init 0.00 0.00 100000000 0.00 0.00 f() 0.00 0.00 10000 0.00 0.00 g() ... --- end of gprof output --- Note: I already try making a sigprocmask, pthread_mask to unblock SIGPROF in *1 and *2. I also verifíed that the signal handler of SIGPROF is the same in *1 and *2, it is a valid pointer, not SIG_DFL nor SIG_IGN. If somebody can help will make me happy. Thanks. ------------------------------------------------------------ Juan Carlos Franzoy Analista Programador Tel: +54-11-4780-2634 mailto:JCFranzoy@ats.com.ar http://www.ats.com.ar ------------------------------------------------------------ Los referentes más importantes en compra/ venta de autos se juntaron: Demotores y Yahoo! Ahora comprar o vender tu auto es más fácil. Vistá ar.autos.yahoo.com/