|
From: Jun Y. <jy_...@ya...> - 2006-06-01 00:00:11
|
Hi, I'm new to valgrind. Can anyone tell me how to do time profiling such as what percentage of CPU is spend on what functions? Seems to me cache and heap profiling is not for this task. Thanks, Jun Yuan |
|
From: Nicholas N. <nj...@cs...> - 2006-06-01 02:52:04
|
On Wed, 31 May 2006, Jun Yuan wrote: > I'm new to valgrind. Can anyone tell me how to do time > profiling such as what percentage of CPU is spend on > what functions? Seems to me cache and heap profiling > is not for this task. Use gprof or something like it. Valgrind doesn't do time-based measurements. Nick |
|
From: Jun Y. <jy_...@ya...> - 2006-06-01 05:30:31
|
Thanks Nick, -Jun --- Nicholas Nethercote <nj...@cs...> wrote: > On Wed, 31 May 2006, Jun Yuan wrote: > > > I'm new to valgrind. Can anyone tell me how to do > time > > profiling such as what percentage of CPU is spend > on > > what functions? Seems to me cache and heap > profiling > > is not for this task. > > Use gprof or something like it. Valgrind doesn't do > time-based > measurements. > > Nick > > > ------------------------------------------------------- > All the advantages of Linux Managed Hosting--Without > the Cost and Risk! > Fully trained technicians. The highest number of Red > Hat certifications in > the hosting industry. Fanatical Support. Click to > learn more > http://sel.as-us.falkag.net/sel?cmd=lnk&kid=107521&bid=248729&dat=121642 > _______________________________________________ > Valgrind-users mailing list > Val...@li... > https://lists.sourceforge.net/lists/listinfo/valgrind-users > |
|
From: <Woe...@on...> - 2006-06-01 09:11:07
|
On Thursday 01 June 2006 04:51, Nicholas Nethercote wrote: > On Wed, 31 May 2006, Jun Yuan wrote: > > I'm new to valgrind. Can anyone tell me how to do time > > profiling such as what percentage of CPU is spend on > > what functions? Seems to me cache and heap profiling > > is not for this task. > > Use gprof or something like it. Valgrind doesn't do time-based > measurements. what about the valgrind tool callgrind? Cheers, Andr=E9 |
|
From: T. S. N. <tse...@ya...> - 2006-06-01 11:48:16
|
Try out oprofiler.
- Senthil.
--- André Wöbbeking <Woe...@on...> wrote:
> On Thursday 01 June 2006 04:51, Nicholas Nethercote
> wrote:
> > On Wed, 31 May 2006, Jun Yuan wrote:
> > > I'm new to valgrind. Can anyone tell me how to
> do time
> > > profiling such as what percentage of CPU is
> spend on
> > > what functions? Seems to me cache and heap
> profiling
> > > is not for this task.
> >
> > Use gprof or something like it. Valgrind doesn't
> do time-based
> > measurements.
>
> what about the valgrind tool callgrind?
>
>
> Cheers,
> André
>
>
>
-------------------------------------------------------
> All the advantages of Linux Managed Hosting--Without
> the Cost and Risk!
> Fully trained technicians. The highest number of Red
> Hat certifications in
> the hosting industry. Fanatical Support. Click to
> learn more
>
http://sel.as-us.falkag.net/sel?cmd=lnk&kid7521&bid$8729&dat1642
> _______________________________________________
> Valgrind-users mailing list
> Val...@li...
>
https://lists.sourceforge.net/lists/listinfo/valgrind-users
>
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
|
|
From: Josef W. <Jos...@in...> - 2006-06-01 12:09:16
|
On Thursday 01 June 2006 11:10, Andr=E9 W=F6bbeking wrote: > On Thursday 01 June 2006 04:51, Nicholas Nethercote wrote: > > On Wed, 31 May 2006, Jun Yuan wrote: > > > I'm new to valgrind. Can anyone tell me how to do time > > > profiling such as what percentage of CPU is spend on > > > what functions? Seems to me cache and heap profiling > > > is not for this task. > > > > Use gprof or something like it. Valgrind doesn't do time-based > > measurements. >=20 > what about the valgrind tool callgrind? Cachegrind/Callgrind can not give you timing data matching any real machine, as this would need cycle-accurate simulation of the whole CPU implementation, which is hardly feasable. Anyhow, such a simulation would have slowdowns in the millions, and therefore it is not practible. However, you can come up with some time estimation with the counters which are produced by cachegrind/callgrind as is given as default CEst (Cycle Estimation) formula in KCachegrind. This estimation has some simple assumptions: * Any instruction has 1 cycle latency * Any L1 miss has a 10 cycle latency * Any L2 miss (ie. main memory access) has a 100 cycle latency * The latencies add up (ie. there is no overlap/latency hiding, and everything works synchronous) * Only user level takes up time These are quite strict assumptions; neverless, if I/O or the system is not relevant for the execution time of some application, the estimation works astonishing well. Yet, it is good to adjust the coefficients (10 and 100) in the formula to match real cache latencies of your machine, by using some benchmark (like calibrator, see http://monetdb.cwi.nl/Calibrator/). Still, it makes no sense to make code changes purely based on VGs profiling tools. Tools like GProf/oprofile/VTune should be used also. Sometimes, just stopping the execution time with eg. "time" is even enough to check any improvement. That said, it very much depends on your application. Often, the programmer is simply not aware of the function executions triggered by a mouse click; especially if an application uses a large number of shared libraries she doesn't know about. Here, callgrind/KCachegrind is very instructive and often leads to insights that allow optimizations which would not come to mind without the detailed call count and graph info (even without the cache simulator). Josef |
|
From: Julian S. <js...@ac...> - 2006-06-01 12:20:48
|
> However, you can come up with some time estimation with the counters > which are produced by cachegrind/callgrind as is given as default CEst > (Cycle Estimation) formula in KCachegrind. Just to reiterate what Josef says -- although neither callgrind nor cachegrind measure execution time, you may be able to learn a great deal about the costs in your code by using them. Our own profiling of Valgrind using both tools has found various performance problems which would have been close to impossible to find by any other means. J |