|
From: Chris E. <chr...@gm...> - 2006-12-21 02:12:05
|
Hello, I'm using valgrind for a project but before I started writing my own tool I wanted to understand lackey as an example. Something I can't figure out for certain is, in the output from lackey, is the "total IRstatements executed" representative of the IR code before or after instrumentation? In lackey all that ever seem to be added to basic blocks during instrumentation are dirty function calls, but if you run lackey with a detailed count option and add up the different load, store, ALU, and branch (exit?) statements executed, you still get a number far smaller than the "total IRstmnts executed." Is there something I'm missing? Thanks, - Chris Eberz |
|
From: Nicholas N. <nj...@cs...> - 2006-12-21 03:34:43
|
On Wed, 20 Dec 2006, Chris Eberz wrote: > I'm using valgrind for a project but before I started writing my own > tool I wanted to understand lackey as an example. Something I can't > figure out for certain is, in the output from lackey, is the "total > IRstatements executed" representative of the IR code before or after > instrumentation? > > In lackey all that ever seem to be added to basic blocks during > instrumentation are dirty function calls, but if you run lackey with a > detailed count option and add up the different load, store, ALU, and > branch (exit?) statements executed, you still get a number far smaller > than the "total IRstmnts executed." Is there something I'm missing? Each machine instruction gets translated into one or more IRStmts. If you want to instrument at the instruction level, you need to pay attention to the IMark statements to work out which IRStmts belong to which machine instruction. Make sure you're developing with an up-to-date copy of the trunk from the Subversion repository -- the documentation in VEX/pub/libvex_ir.h recently was greatly improved. Also, use the flags --trace-flags=11000000 --trace-notbelow=0 to see the IR produced from the machine code, and then how that is optimised into the form seen by tools. Nick |