home *** CD-ROM | disk | FTP | other *** search
-
-
-
- NAME
- prof - a program for profiling .COM & .EXE programs.
-
- SYNOPSIS
- prof [ options ] cmd [ args ]
-
- DESCRIPTION
- Prof is a program that collects information about where a
- program spends most of its time executing, and a few other
- things. It is not dependent of a specifiec compiler or
- language, but requires a standard mapfile to be any useful.
- Assembler programs work fine, but not with mixed near/far
- calls if you use the `-m' switch. The results of the profile
- are not affected by the time it takes to load the profiled
- program from disk.
-
- OPTIONS
- -2 Assume near function calls; that is, the program to be
- profiled should have been compiled under the Tiny,
- Small or Compact memory models. Near function calls are
- assumed by default.
- This switch is meaningful only in combination with the
- `-m' switch.
-
- -4 Assume far function calls, i.e. Medium, Large or Huge
- memory models. Otherwise as for `-2'.
-
- -Ad Set the sampling precision to d, where d is a digit
- between 1 and 9 inclusive. 1 means maximum precision,
- 9 means minimum. If d is not specified, a precision of
- 1 is set by default. If this switch is not specified
- at all, a sampling precision slightly worse than 9 is
- applied.
- Note that the sampling is not performed more *often*
- when a higher precision is used; the sampler is rather
- wasting more time in a delay loop (i.e. the clock freq-
- uency is not adjusted). The happy effect of this is
- that it works on the 8086/8088, the boring effect is
- that the profiled command might run *very* slowly.
- This switch is maningful only in combination with `-f'
- or `-l'.
-
- -Mx Use mapfile `x' instead of the default name, which is
- diverged from the command name by appending ``map''.
-
- -a Sort the output by address.
-
- -c Count the number of calls to each function.
-
- -d Count the number of calls to each DOS function
- (int 21h), and subfunctions where that is applicable.
- You won't get symbolic names, though. Does not require
- a mapfile.
-
- -f Estimate the relative time spent in each function and
- DOS/BIOS areas. This is the default operation of the
- profiler. May produce strange output if there are a lot
- of static (or private) functions in the program. This
- applies certainly to the runtime library.
- Does not require a mapfile to report DOS/BIOS areas
- versus the code executed in the command itself.
-
- -i Interactive turn profiling on and off by use of the
- key combinations Alt+ (on) and Alt- (off). Profiling
- is off at startup.
-
- -j As `-i', but profiling is on at startup.
-
- -k Count the number of times each line executes.
-
- -l Estimate the relative time spent executing each line
- in the program. Every sample that doesn't match a line
- is labeled ``Runtime library'' in the output.
-
- -mx Track down all calls to function `x' and report where
- they came from. This may *really* produce funny results
- if there are a lot of static functions. C programmers:
- remember to prepend the underscore!
-
- -n Sort the output by name. Not applicable when profiling
- line numbers or counting DOS calls.
-
- -ox Use output file `x' instead of the default name, which
- is diverged from the command name by appending ``prf''.
-
- -q Sort the output by frequency. This is the default.
-
- -s Swap the names collected from the mapfile to disk upon
- execution of the command. This to free up some core.
-
- -v Verbose. Report memory usage and exit status of
- profiled command.
-
- -w Some compilers produce strange line number information
- in the mapfile. This includes different line numbers
- with the same address, and the same line number/address
- pair repeated. In each of these cases the duplicate
- information is discarded. `-w' means to give a warning
- each time this happens.
-
- -z List also items that had zero frequency. Not applicable
- to DOS calls.
-
- cmd The command to be profiled, may be a .COM or an .EXE
- program. Full path name must be supplied.
-
- args Arguments to profiled command.
-
- The switches `-c', `-d', `-f', `-k', `-l' and `-m' are
- mutually exclusive, as are also `-a', `-n' and `-q'.
-
- LIMITS
- The current version has a maximum limit of 5458 functions or
- lines. The line maximum is too restrictive, so this might be
- classified as a bug.
-
- BUGS
- The results of the `-c' switch may vary slightly from run to
- run (they are too high), especially for functions that are
- called a lot of times. Why this happens is beyond my under-
- standing, but the variations are so small (0.01%) that the
- effect should be zero. The same appears for the `-k' switch.
-
- The profiler might hang when a high sampling precision is
- used. This *should* never happen, but anyway it does.
-
- ACKNOWLEDGEMENTS
- This program is a major rewrite of Bjorn Larsson's profiler,
- which i downloaded from somewhere some day. The original
- version was only able to profile functions (`-f' switch).
-