Related articles |
---|
Determining instruction mix s9154221@mella.ee.up.ac.za (1995-02-06) |
Re: Determining instruction mix nandu@cs.clemson.edu (1995-02-07) |
Re: Determining instruction mix gardner@pink-panther.cs.uiuc.edu (1995-02-07) |
Re: Determining instruction mix mueller@nu.cs.fsu.edu (1995-02-08) |
Re: Determining instruction mix pardo@cs.washington.edu (1995-02-09) |
Re: Determining instruction mix roos@grendel.csc.smith.edu (1995-02-09) |
Newsgroups: | comp.compilers |
From: | roos@grendel.csc.smith.edu (Bob Roos) |
Keywords: | architecture,testing |
Organization: | Smith College, Northampton, MA, USA |
References: | 95-02-068 |
Date: | Thu, 9 Feb 1995 11:42:21 GMT |
Rikus Combrinck <s9154221@mella.ee.up.ac.za> wrote:
>I'm looking for software that can determine the dynamic
>instructions mix of a programme, i.e. the number of times that
>certain instructions are executed during execution of the
>program. I'm am especially interested in a version that could
>do this on a multiprocessor machine (like the SUN SPARCStation 1000).
>
>[Somewhere I was a paper about a system that does this by instrumenting
>basic blocks so it makes one count per block rather than per instruction,
>then post-proccesses to get the instruction counts. -John]
I've been looking for profilers on our system to use for illustrating
"real" program behavior in my undergraduate algorithms class. I've settled
on "tcov", which sounds like the basic block program referred to above.
=======================================================================
Sun Release 4.1 Last change: 18 February 1988 1
TCOV(1) USER COMMANDS TCOV(1)
NAME
tcov - construct test coverage analysis and statement-by-
statement profile
SYNOPSIS
tcov [ -a ] [ -n ] srcfile...
AVAILABILITY
This command is available on Sun-3 and Sun-4 systems only.
DESCRIPTION
tcov produces a test coverage analysis and statement-by-
statement profile of a C or FORTRAN program. When a program
in a file named file.c or file.f is compiled with the -a
option, a corresponding file.d file is created. Each time
the program is executed, test coverage information is accu-
mulated in file.d.
tcov takes source files as arguments. It reads the
corresponding file.d file and produces an annotated listing
of the program with coverage data in file.tcov. Each
straight-line segment of code (or each line if the -a option
to tcov is specified) is prefixed with the number of times
it has been executed; lines which have not been executed are
prefixed with #####.
Note: the profile produced includes only the number of times
each statement was executed, not execution times; to obtain
times for routines use gprof(1) or prof(1).
OPTIONS
-a Display an execution count for each statement; if -a is
not specified, an execution count is displayed only for
the first statement of each straight-line segment of
code.
-n Display table of the line numbers of the n most fre-
quently executed statements and their execution counts.
EXAMPLES
The command:
example% cc -a -o prog prog.c
compiles with the -a option - produces prog.d
The command: example% prog
executes the program `-' accumulates data in prog.d
The command: example% tcov prog.c
produces an annotated listing in file prog.tcov
======================================================================
Now MY question. I can't get this to work with Gnu C, only our old K&R
"cc". Has anyone successfully used the "-a" option with gcc?
Bob Roos
roos@cs.smith.edu
--
Return to the
comp.compilers page.
Search the
comp.compilers archives again.