public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* gcov - time spent on each line
@ 2009-09-22 14:41 Thomas Robitaille
  2009-09-23 16:32 ` Holger Blasum
  0 siblings, 1 reply; 2+ messages in thread
From: Thomas Robitaille @ 2009-09-22 14:41 UTC (permalink / raw)
  To: gcc-help


Hi,

I'm trying to use gcov to figure out which lines a program is spending most
of it's time calling. The default output is to show the number of calls for
each line, but is there a way to instead output the time spent on each line?
If not, are there alternative tools that can be used to find this out?

Thanks,

Thomas
-- 
View this message in context: http://www.nabble.com/gcov---time-spent-on-each-line-tp25530765p25530765.html
Sent from the gcc - Help mailing list archive at Nabble.com.

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: gcov - time spent on each line
  2009-09-22 14:41 gcov - time spent on each line Thomas Robitaille
@ 2009-09-23 16:32 ` Holger Blasum
  0 siblings, 0 replies; 2+ messages in thread
From: Holger Blasum @ 2009-09-23 16:32 UTC (permalink / raw)
  To: Thomas Robitaille; +Cc: gcc-help

Hi Thomas,

On Tue, Sep 22, 2009 at 07:34:02AM -0700, Thomas Robitaille wrote:
> I'm trying to use gcov to figure out which lines a program is spending most
> of it's time calling. The default output is to show the number of calls for
> each line, but is there a way to instead output the time spent on each line?

There is (presently) no way to determine the time spent on each 
line with gcov (gcov even does not go below the granularity of basic blocks 
(http://en.wikipedia.org/wiki/Basic_block) which in typical programs
more often than not span more than one line). 

> If not, are there alternative tools that can be used to find this out?

Two alternatives: (1) disassemble your compiled output (objdump), use your
architecture's manual to assign weights to the assembly instruction
(e.g. "1" for increment operation, "4" for a jump operation, but this 
depends on architecture) and count the CPU cycles.
(2) actually measure timings by directly measuring CPU actions (possibly
depending on architecture, e.g. for example (disclaimer: speaking out 
of personal memory only - no implied endorsement!) a vendor based here 
in Germany for Nexus could be http://www.lauterbach.com/nexus.html, 
in the US a vendor could be http://www.bullseye.com/ for the
protocol see http://en.wikipedia.org/wiki/Nexus_(standard) )

Cheers,

-- 
Holger Blasum (SYSGO AG)

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2009-09-23 16:32 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-09-22 14:41 gcov - time spent on each line Thomas Robitaille
2009-09-23 16:32 ` Holger Blasum

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).