* -pg profiling instrumentation question
@ 2007-12-19 13:22 Juan Carlos Franzoy
0 siblings, 0 replies; only message in thread
From: Juan Carlos Franzoy @ 2007-12-19 13:22 UTC (permalink / raw)
To: gcc-help
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/
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2007-12-19 13:22 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-12-19 13:22 -pg profiling instrumentation question Juan Carlos Franzoy
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).