|
From: Farah S. G. <far...@gm...> - 2013-03-11 10:27:31
|
Hello Everyone, 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. 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.. ??? |
|
From: Josef W. <Jos...@gm...> - 2013-03-11 13:27:04
|
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 > Val...@li... > https://lists.sourceforge.net/lists/listinfo/valgrind-users > |
|
From: Qtest <vit...@gm...> - 2013-03-28 19:43:47
|
*1.* I need to find out the (dynamic) (assembly) instructions and count
against my C program. The output I expect is similar to the following
mov 200
pop 130
jne 48
I tried valgrind --tool=callgrind --cache-sim=yes --dump-instr=yes <my
program name> and viewed it using Kcahcegrind. I did find the instruction
types but count info was no where. I would like to filter the output to
discard the instructions which are due to system libraries etc.
*2. * I need to find out the address and the size of memory allocated
using malloc in some specific functions and parts of my program. I did
valgrind heap profiling but it gives the whole heap size. Any suggestion ?
* 3.* I want to know which memory locations are accessed by a function of
my program. In other words I need to find out the memory access pattern of
my program. Will counting Loads help? if yes then how can I count Loads ?
--
View this message in context: http://valgrind.10908.n7.nabble.com/Instruction-types-in-valgrind-tp44512p44748.html
Sent from the Valgrind - Users mailing list archive at Nabble.com.
|