On Thursday 18 November 2010, edA-qa mort-ora-y wrote:
> On 11/18/2010 02:59 PM, Josef Weidendorfer wrote:
> > With instrumentation on, you still can decide not to aggregate events in 
> > given
> > threads by switching the collection state on/off with 
> > CALLGRIND_TOGGLE_COLLECT.
> > The collection state is thread specific.
> 
> Okay great, that clarifies a lot for me. I just use --collect-atstart=no
> and then use CALLGRIND_TOGGLE_COLLECT where needed.
> 
> Is specifying --toggle-collect=function the same as putting a toggle at
> the entry and exit of that function?

Yes.

> > The big difference between instrumentation and collection state is the 
> > following:
> > if instrumentation is switched off, the state of the cache is not updated. 
> > Thus,
> > after switching instrumentation state on, callgrind starts with a freshly 
> > initialized
> > cache, ie. you will get a lot of cold misses. This would not happen in 
> > reality, as
> 
> How are the misses calculated into the costs of the functions?

If the simulator returns a miss for a given access, this will be counted if 
collection
is on. Callgrind only counts primitive event, there is no calculation.
Only KCachegrind later does calculation of derived event counts, but that is 
just a
simple formula.

> Will it 
> make a substantial difference?  In the code I'm profiling I'd imagine
> under normal use it should be nearing 0% cache misses.
> 
> > The option to switch instrumentation mode is only useful for "fast 
> > forwarding" over
> > uninteresting, large parts of the code, where you want all threads to 
> > progress fast.
> 
> The basic reason why I wanted to do this was because I have a couple
> threads that aren't of interest but consume the vast majority of CPU
> cycles. So when I run valgrind I'll get something like 150M events, only
> about 10M of which are of interest.  I was trying to get it to go faster.
 
Ok. But even if these other threads do a lot of stuff not interesting to you,
they will change the cache state, ie. evict data used by the thread interesting 
to you.
So they are important.

Josef


------------------------------------------------------------------------------
Beautiful is writing same markup. Internet Explorer 9 supports
standards for HTML5, CSS3, SVG 1.1,  ECMAScript5, and DOM L2 & L3.
Spend less time writing and  rewriting code and more time creating great
experiences on the web. Be a part of the beta today
http://p.sf.net/sfu/msIE9-sfdev2dev
_______________________________________________
Valgrind-users mailing list
Valgrind-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/valgrind-users

Reply via email to