This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: object code execution statistics


On Tue, Apr 26, 2005 at 12:57:54PM +0400, Sergei Tovpeko wrote:
> Hello James,
> 
> Tuesday, April 26, 2005, 6:36:56 AM, you wrote:
> 
> JEW> Sergei Tovpeko wrote:
> >> Is there any util that would produce result containing the asm code
> >> execution staticstics ???
> 
> JEW> I assume you want assembly instruction execution counts.  You could
> JEW> produce this info from gcov with a bit of work, as gcov already gives
> JEW> you execution counts for basic blocks.  You just need to disassemble the
> JEW> code, apply the counts to the assembly instructions, and then print
> JEW> whatever statistics you want.  Probably not easy, but feasible.
> 
> JEW> Otherwise, there is nothing in gcc that will help you here.
> 
> Does it mean that GCOV have much more data (in its binary format)
> but don't treat them and out to user in human format?

It depends on what you want.  If you have inline assembly and want
to know how often it is executed, you could try the source-code annotation
feature of gcov, to get counts for each line.  Or you could use the
line-level information to try to figure out how often the assembly
is executed.  But that isn't easy.

The instrumentation that gcov relies on has to be inserted into the
code by gcc, and doesn't get inserted into assembly language.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]