|
From: Kuba O. <ku...@co...> - 2005-09-07 08:23:37
|
Hi, I'd like to know time spent in methods like sleep() etc. Basically I'd like to profile whole run of program including time when the program is actually not spending any CPU cycles. Is there any switch or something to valgrind/callgrind? Do I need any other tool instead of valgrind? Thanks, Kuba |
|
From: Tom H. <to...@co...> - 2005-09-07 08:35:23
|
In message <431...@co...>
Kuba Ouhrabka <ku...@co...> wrote:
> I'd like to know time spent in methods like sleep() etc. Basically I'd
> like to profile whole run of program including time when the program
> is actually not spending any CPU cycles. Is there any switch or
> something to valgrind/callgrind? Do I need any other tool instead of
> valgrind?
Well by definition you can't do profiling of wall clock time using
valgrind as it seriously distorts the real time taken to run code
so all you can really get is CPU time estimates (derived from
instruction and/or cycle count data).
If you want to profile wall clock times you need something that is
non-invasive - at a high level that means running under times or if
you want to know about part of your program then building in code
to call times() at relevant points is the best bet.
To see how long is spent in system calls consider strace with
the -T option.
Tom
--
Tom Hughes (to...@co...)
http://www.compton.nu/
|
> I'd like to know time spent in methods like sleep() etc. Basically I'd > like to profile whole run of program including time when the program is > actually not spending any CPU cycles. The --wallclock mode of tsprof does this. http://BitWagon.com/tsprof/tsprof.html -- |