Newsgroup: comp.sys.ibm.pc


Article 12807 of comp.sys.ibm.pc:
Path: icdoc!ukc!mcvax!uunet!husc6!mailrus!cwjcc!hal!ncoast!dds%CC.IC.AC.UK@CUNYVM.CUNY.EDU
>From: dds%CC.IC.AC.UK@CUNYVM.CUNY.EDU (Diomidis D Spinellis)
Newsgroups: comp.sys.ibm.pc,comp.lang.c
Subject: Announcement for the C profiler for MS-DOS
Message-ID: <8811251717.aa05550@mvax.cc.ic.ac.uk>
Date: 26 Nov 88 23:27:15 GMT
Sender: allbery@ncoast.UUCP
Reply-To: dds%CC.IC.AC.UK@CUNYVM.CUNY.EDU (Diomidis D Spinellis)
Lines: 37
Content-Length: 2074
I have posted the source code for a C profiler to comp.sources.misc.
This is the README file of the distribution.

Included here is the source for an execution profiling system that can be
used with the Microsoft C or the Microsoft Quick C compiler. It can be
used, to give the time percentage, a program spends in different functions.
It is an indispensible tool when trying to optimise a program. It has been
tested with MSC Version 5.00. In order to use it the appropriate [slmc]prof.obj
module has to be linked together with the rest of the program. The first
letter of the module indicates the memory model in use. The user should
execute the function call prof_start( argv[0] ) for MS-DOS 3.00+ or
prof_start( "progpath.map" ) for versions before 3.00 in order to start
profiling. When the program finishes the profiler automatically produces a
prof.out file that contains the names of all public symbols and the number of
hits for each one.

The program profprt reads the prof.out file (or another file if specified) and
produces a list of hits and percentages for the functions for which hits were
recorder. If given a -h option it also produces a histogram of the relative
timings.

A small test program is included to check the profiler functioning. It
generally found the profiler results to be within 1% of the theoretical
expected results on an 8MHz PC.

The profiler is all written in C utilising the ability to create interrupt
handlers in C. It finds the addresses of the functions from the linker
map file. Therefore the program to be profiled must be linked with the -Fm
option of cl or the /MAP option of the linker. In addition the user has to
keep in mind that functions declared as static are not included in the map
file, will not be profiled and should plan accordingly. One should also pay
attention to quantisation errors and errors due to incerrectly specified
boundaries. Portions of the code that are executed with interrupts dissabled
will not be profiled.

--
Diomidis D Spinellis        dds@cc.ic.ac.uk




Newsgroup comp.sys.ibm.pc contents
Newsgroup list
Diomidis Spinellis home page

Creative Commons License Unless otherwise expressly stated, all original material on this page created by Diomidis Spinellis is licensed under a Creative Commons Attribution-Share Alike 3.0 Greece License.