public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
From: Juan Carlos Franzoy <jfranzoy@yahoo.com.ar>
To: gcc-help@gcc.gnu.org
Subject: -pg profiling instrumentation question
Date: Wed, 19 Dec 2007 13:22:00 -0000	[thread overview]
Message-ID: <516934.57528.qm@web32702.mail.mud.yahoo.com> (raw)

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/

                 reply	other threads:[~2007-12-19 13:22 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=516934.57528.qm@web32702.mail.mud.yahoo.com \
    --to=jfranzoy@yahoo.com.ar \
    --cc=gcc-help@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).