How could we profile a c program in order to obtain detailed information related to its executed instructions (Dynamic Instructions)? I'm looking for a tool with which I can use it to obtain information per dynamic instruction, for example
The 1st Instruction is executed 10 times
The 2nd Instruction is executed 5 times
The 3rd Instruction is executed 7 times and so on.
Moreover, taking into account arithmetic instructions, is it possible to determine the results that those instructions produce for each time they are being executed (the partial results produced by a dynamic instruction at an arbitrary clock cycle)?
By doing so, we can state that instruction 1 is going to execute 10 times and the results it produces are the same as across these 10 times. Therefore, we can ignore 9 dynamic instructions of instruction 1, and only consider one instance.
I Still haven't found what I'm looking for!