|Determining instruction mix firstname.lastname@example.org (1995-02-06)|
|Re: Determining instruction mix email@example.com (1995-02-07)|
|Re: Determining instruction mix firstname.lastname@example.org (1995-02-07)|
|Re: Determining instruction mix email@example.com (1995-02-08)|
|Re: Determining instruction mix firstname.lastname@example.org (1995-02-09)|
|Re: Determining instruction mix email@example.com (1995-02-09)|
|From:||firstname.lastname@example.org (Bob Roos)|
|Organization:||Smith College, Northampton, MA, USA|
|Date:||Thu, 9 Feb 1995 11:42:21 GMT|
Rikus Combrinck <email@example.com> 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)
tcov - construct test coverage analysis and statement-by-
tcov [ -a ] [ -n ] srcfile...
This command is available on Sun-3 and Sun-4 systems only.
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).
-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
-n Display table of the line numbers of the n most fre-
quently executed statements and their execution counts.
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?
Return to the
Search the comp.compilers archives again.