Commit Graph

8 Commits

Author SHA1 Message Date
Bruce Evans
8109a9af1f Fixed some misspellings of 2 as sizeof(UNIT) so that they won't break
things when sizeof(UNIT) becomes a runtime parameter.  The relevant 2
is the one in profil(2)'s scaling of pc's to bucket numbers:

	   bucket = (pc - offset) / 2 * profil_scale / 65536

gprof(1) must duplicate this scaling, bug for bug compatibly, so it
must first do an integer division by 2 although this mainly makes
scales larger than 65536 useless.  sizeof(UNIT) was already wrong in
gprof4, but there were no problems because the fake profil scale is a
multiple of 2.

There are also some rounding bugs in the scaling, but these are only
problems if profil(2) is used directly to create unusual (and not
useful) scales.
2002-03-06 09:47:36 +00:00
Bruce Evans
8d57b8d3d2 Fixed printf format errors. In printgprof.c, also convert the scale
without possibly losing lots of precision, and print the scale using
%g instead of %d in case it is non-integral.  %g might not be the best
format for this.
2002-02-21 12:07:21 +00:00
Peter Wemm
c3aac50f28 $Id$ -> $FreeBSD$ 1999-08-28 01:08:13 +00:00
Philippe Charnier
b34f7debd8 Use err(3). 1997-07-10 06:45:02 +00:00
Bruce Evans
d4aa237228 Print times/call in ns if hz >= 10e7. hz will be this large for high
resolution profiling on Pentiums.  On a 100MHz Pentium, the resolution
is at best 10 ns and actually a few hundred ns, but units of 10's or
100's of ns would be inconvenient and the current units of 1 us are a
bit too coarse.
1996-06-08 12:29:57 +00:00
Rodney W. Grimes
7799f52a32 Remove trailing whitespace. 1995-05-30 06:41:30 +00:00
Bruce Evans
ff18d3781d New flag -u to suppress functions whose name does not begin with an
underscore.  Use it to avoid seeing badsw when profiling the kernel.

Print times more accurately (e.g. usec in %8.0f format instead of
msec in %8.2f format for averages) if hz >= 10000.  This should have
no effect now since profhz is only 1024.
1994-09-05 16:14:54 +00:00
Rodney W. Grimes
9b50d90275 BSD 4.4 Lite Usr.bin Sources 1994-05-27 12:33:43 +00:00