Am 11.03.2013 11:27, schrieb Farah Saab Gmail: > I am new to valgrind. I need your advice on something. I ran my c++ > project using valgrind (cachegrind tool). I got an output file of the > following format cachegrind.out.x > Then I used the kcachegrind tool to read this file. > I got the list of functions in my c++ project and they were listed in > decreasing order of instruction fetch count. For example the first > function on top was TComTrCount, and next to it under the "Self" column > was the number 2 733 651 498. > I assume this means that while running my C++ project, the function > TComTrCost alone had 2 733 651 498 instructions.
Yes. > My question is this: Can I know what these instructions are? For > example, can I know from these 2 733 651 498 instructions, how many are > additions, or multiplications, or read, or write, or shift, etc.. ??? Cachegrind does not collect statistics per instruction, but only related to source lines, using debug information from the compiler. Instead, you can use Callgrind with "--cache-sim=yes --dump-instr=yes". The later option enables KCachegrind to show annotated machine code, so you can see what instructions are executed (and how often). Alternatively with Cachegrind, for the functions you are interested in you could explicitly ask for debug information at the assembler level. Let the compiler produce assembler output instead of object code (with -S), and compile this with "as -g ...". Josef > > > > ------------------------------------------------------------------------------ > Symantec Endpoint Protection 12 positioned as A LEADER in The Forrester > Wave(TM): Endpoint Security, Q1 2013 and "remains a good choice" in the > endpoint security space. For insight on selecting the right partner to > tackle endpoint security challenges, access the full report. > http://p.sf.net/sfu/symantec-dev2dev > > > > _______________________________________________ > Valgrind-users mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/valgrind-users > ------------------------------------------------------------------------------ Symantec Endpoint Protection 12 positioned as A LEADER in The Forrester Wave(TM): Endpoint Security, Q1 2013 and "remains a good choice" in the endpoint security space. For insight on selecting the right partner to tackle endpoint security challenges, access the full report. http://p.sf.net/sfu/symantec-dev2dev _______________________________________________ Valgrind-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/valgrind-users
