> > Consider we have function FOO and BAR. (and for simplicity FOO calls BAR)
> > We want to instrument everything in FOO and not instrument BAR.
> >
> > We enter FOO for the first time and instrument it's first superblock.
> > Than we enter BAR and do not instrument it.
> > Than we exit BAR and we are in FOO again, and we need to instrument a
> > new portion of FOO, which is not the first in FOO.
> > So, 'check if a given instruction is the first of a function according
> > to debug information' is not sufficient. Do I miss something?
>
> You can always request the function any instruction is part of at
> instrumentation time. The check whether it is the first is about catching
> the function entry event.

I can see that you would want to instrument some functions and not
others, eg, FOO but not BAR.  But why do you care about knowing 
if some block is the entry point for a function or not?

So there's probably some function you can call in the tool-visible
interface to m_debuginfo (that is, in include/pub_tool_debuginfo.h)
to find out the name of a function containing a given code address.
VG_(get_fnname), it looks like.  I assume you will ask for the containing
function name and then not instrument it according to some criteria.
Right?

Uh, that's a bit dangerous because the JIT will create superblocks 
which go across function calls.  Eg if BAR calls XYZZY then there 
can be a block starting in BAR and ending in XYZZY, and if you
say that BAR is not to be instrumented, then you also miss
instrumentation for the part of the block in XYZZY.  No problem, you
just need to disable superblock formation.  Put this in the post_clo_init
function:

  VG_(clo_vex_control).guest_chase_thresh = 0;

btw, Josef, I see you also have

  VG_(clo_vex_control).iropt_unroll_thresh = 0;

why is that?  does the loop unroller confuse Callgrind's profile somehow?

J

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Valgrind-developers mailing list
Valgrind-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/valgrind-developers

Reply via email to