|
From: Zhao Q. <qin...@gm...> - 2009-09-16 16:43:01
|
> Date: Mon, 14 Sep 2009 14:07:32 +0200 > From: Josef Weidendorfer <Jos...@gm...> > Subject: Re: [Valgrind-users] Using Valgrind for profiling > To: val...@li... > Message-ID: <200...@gm...> > Content-Type: text/plain; charset="utf-8" > > Hi, > > On Friday 11 September 2009, Juan Carlos Martinez Santos wrote: > > I am new using Valgrind, so I wonder if I can use Valgrind to count the > > total number cycles needed to execute a custom program. I saw examples > for > > cache memory, but I did not see any for global performance. > > You can calculate a very rough estimation of cycles used from the event > counts of the cache simulator. Such a formula is provided by > KCachegrind, a GUI visualization tool of cachegrind/callgrind profile data. > The formula used there can be adjusted to match your machine. > For a better estimation, it would be good to integrate branch prediction > events (available with cachegrind, not integrated into callgrind up to now) > and other more fine granular counters of the kind of instructions executed > (floating point instructions, locks, ...). > If you are only interested in the total cycle of the custom program, why not use performance counter directly? In my opinion, Valgrind is more suitable for detailed information other than statistic data collection. Qin |