|
From: Mohit T. <moh...@gm...> - 2006-10-18 02:10:47
|
Hello, I am new to Valgrind and had two questions regarding the functioning of Valgrind. (I am using VG 3.1.1.) 1. I compared the runtimes of nulgrind with that of reduced memcheck, that performs no instrumentation and has its MC_(instrument) function simply return bb_in, and noticed that there is a significant difference in their running times. For gcc, with a lgred data input, the timing is 134s for nulgrind and 170s for reduced emcheck. Why could that be? Shouldn't their performance be similar? 2. I wished to find out how the peformance of an instrumented program degrades depending upon the number of instructions that get inserted by the *_(instrument) function. Is there a way I can find out how many IRs and x86 instructions got added in? Thanks a lot, Mohit |
|
From: Nicholas N. <nj...@cs...> - 2006-10-18 02:36:18
|
On Tue, 17 Oct 2006, Mohit Tiwari wrote: > 1. I compared the runtimes of nulgrind with that of reduced memcheck, that > performs no instrumentation and has its MC_(instrument) function simply > return bb_in, > and noticed that there is a significant difference in their running times. > For gcc, with a lgred data input, the timing is 134s for nulgrind and 170s > for reduced emcheck. Why could that be? Shouldn't their performance be > similar? Memcheck also replaces malloc, free and related functions with its own version. That will make a difference, especially on an allocation-heavy program like gcc. I expect the difference would be smaller on Fortran benchmarks, for example. Also, Memcheck's event handlers (for new_mem_*, die_mem_*, etc) will still be running, eg. for when system calls execute. You'll need to disable them too. > 2. I wished to find out how the peformance of an instrumented program > degrades depending upon the number of instructions that get inserted by the > *_(instrument) function. Is there a way I can find out how many IRs and x86 > instructions got added in? Try the --help-debug flag, and look at the output. --trace-flags shows you the IR at every stage. It doesn't count it though, you'll have to add code to do that yourself. Nick |