From: William C. <wc...@nc...> - 2013-07-07 20:16:52
|
On 07/07/2013 12:48 PM, sarani wrote: > > Currently I have started using the Oprofile tool but I have certain doubts of > using this tool as per my requirement. Using the Oprofile tool I want to > analyse > the branching in the square and multiply algorithm. In the square and > multiply > algorithm there are a number of if else statements. Is there any way such > that > the oprofile tool will deliver such an output based on a particular input, > so that > by looking at the output we can conclude that whether those if else > statements are > taken or they are not taken. More specifically I want to analyse that if a > certain > branch is taken or not taken just by looking at the output of a profiling > tool. > Can you please help me that in what way shall I use Oprofile to get desired > output. > Hi, OProfile does statistical sampling. This is great for showing code hotspots, but for many processors this is inexact and may not give the precise information you are looking for. If you can recompile the code, you could use the code coverage options in gcc and do something like: http://people.redhat.com/wcohen/testcoverage.txt Alternatively if you are not concerned about speed, you might take a look at using Valgrind's cachegrind and cg_annotate: http://valgrind.org/docs/manual/cg-manual.html -Will |