Commit Graph

84 Commits

Author SHA1 Message Date
Philippe Charnier
af2637db52 rework old-style functions prototypes
reduce WARNS=6 output
2013-02-14 08:16:03 +00:00
Grzegorz Bernacki
255f31647e Fix resolving symbol names on ARM.
On ARM, binutils are adding '$a' symbols in the symbol table for
every function (in addition to normal symbol). When gprof(1) looks
up symbol name, it often reads '$a' instead of proper function name,
because it find it first. With this fix, when read symbol name
begins with '$' and previous symbol has the same address, it will
use previous symbol name (which is proper function name).

Obtained from:	Semihalf
2012-05-25 06:48:42 +00:00
Glen Barber
2fccbf04cc General mdoc(7) and typo fixes.
PR:		167696
Submitted by:	Nobuyuki Koganemaru (kogane!jp.freebsd.org)
MFC after:	3 days
2012-05-10 02:07:00 +00:00
Dimitry Andric
7853817de3 More fixes for correct printf length modifiers usr.bin/gprof.
MFC after:	1 week
2011-12-17 14:51:24 +00:00
Dimitry Andric
d16752d1ae In usr.bin/gprof/aout.c, use the correct printf length modifier for a
uint32_t.

MFC after:	1 week
2011-12-17 14:37:41 +00:00
Joel Dahl
da52b4caaf Remove the advertising clause from UCB copyrighted files in usr.bin. This
is in accordance with the information provided at
ftp://ftp.cs.berkeley.edu/pub/4bsd/README.Impt.License.Change

Also add $FreeBSD$ to a few files to keep svn happy.

Discussed with:	imp, rwatson
2010-12-11 08:32:16 +00:00
Ulrich Spörlein
cded07a878 Move most of the remaining USD/PSD/SMM papers into share/doc 2010-12-04 10:11:20 +00:00
Ed Schouten
b7946da96b Build usr.bin/ with WARNS=6 by default.
Also add some missing $FreeBSD$ to keep svn happy.
2010-01-02 10:27:05 +00:00
Ed Schouten
b3c73ef101 Add missing #include for string routines. 2010-01-02 10:12:12 +00:00
David E. O'Brien
03ce187564 If running with "-K" really do not information about symbols from the a.out
argument.  Before this fix, after searching the currently-running kernel,
we would still search the a.out argument - completely override the in-kernel
list, essentially defeating the K flag's purpose.

PR:		47387
Submitted by:	Ryan Beasley <ryanb@goddamnbastard.org>
2009-01-12 21:49:42 +00:00
Tom Rhodes
0d186272b4 Remove reference to unimplemented "-c" option.
PR:		119338
2008-12-25 08:48:08 +00:00
David E. O'Brien
47490ee583 Add gprof MIPS MD header and enable building gprof.
Obtained from:	Juniper Networks
2008-09-02 15:35:47 +00:00
Warner Losh
268f9be78d Add mips support. 2008-04-04 21:33:41 +00:00
Ruslan Ermilov
2d05c776ef Remove alpha-specific stuff. 2006-08-23 12:12:56 +00:00
Peter Grehan
2315266944 clone i386.h for powerpc 2005-12-29 04:23:54 +00:00
Bruce Evans
762116ae25 Catch up with increasing the resolution suitable for high-res kernel
profiling from microseconds to nanoseconds in 1996.  Picoseconds are
already needed.

Describe the choice of units for the per-call times in detail.
2005-10-07 11:58:46 +00:00
Bruce Evans
0b146898f0 Improve printing of self times in the flat profile for functions that
appear to be never called:

(1) If a function is never called according to its call count but it
    must have been called because its child time is nonzero, then print
    it in the flat profile.  Previously, if its call count was zero
    then we only printed it in the flat profile if its self time was
    nonzero.

(2) If a function has a zero call count but has a nonzero self or child
    time, then print its total self time in the self time per call
    column as a percentage of the total (self + child) time.  It is
    not possible to print the times per call in this case because the
    call count is zero.  Previously, this was handled by leaving both
    per-call columns blank.  The self time is printed in another column
    but there was no way to recover the total time.

(1) partially fixes the case of the "never called" function main() and
prepares for (2) to apply to main() and other functions.  Profiling
of main() was lost in the conversion from a.out to ELF, so main()'s
call count has always been zero for many years; then in the common
case where main() is a tiny function, it gets no profiling ticks, so
main() was completely lost in the flat profile.

(2) improves mainly cases like kernel threads.  Most kernel threads
appear to be never called because they are always started before
userland can run to turn on profiling.  As for main(), the fact that
they are called is not very interesting and their callers are
uninteresting, but their relative self time is interesting since they
are long-running.

Almost always printing percentages in the per-call columns would be
more useful than almost always printing 0.0ms.  0.1ms is now a long
time, so only very large functions take that long per call.  The accuracy
per call can approach 1-10 nsec provided programs are run for about
100000 times as long as is necessary to get this accuracy with high
resolution kernel profiling.
2005-10-07 10:59:41 +00:00
Ruslan Ermilov
0227791b40 Expand *n't contractions. 2005-02-13 22:25:33 +00:00
Brian Feldman
58f45f543a Make sure to return 0 from kernel_getnfile() since if there were an
error, it would exit() (and it needs to return a value).
2004-10-05 23:49:27 +00:00
Stefan Farfeleder
bd6da6a530 Use a proper prototype for hertz(). 2004-10-03 18:22:35 +00:00
Stefan Farfeleder
70c3c978b9 Fix a few cases that relied on 'implicit int' (constraint violation in C99). 2004-07-11 17:37:33 +00:00
Ruslan Ermilov
557b7fa148 Deal with double whitespace. 2004-07-03 00:24:45 +00:00
Ruslan Ermilov
759dce33f8 Fix after rev. 1.24 changes: bump document date, and remove -c
from SYNOPSIS.
2004-07-02 22:24:53 +00:00
Ruslan Ermilov
6a3e8b0adc Mechanically kill hard sentence breaks. 2004-07-02 22:22:35 +00:00
Stefan Farfeleder
8eece1e6eb Retire support for gprof's -c option. All our currently supported
architectures only provide a dummy implementation.

Silence on:	current@
2004-06-20 11:05:25 +00:00
Stefan Farfeleder
8b061e144e Include <string.h> for prototypes of various string functions.
Approved by:	das (mentor)
2004-05-24 12:44:00 +00:00
Stefan Farfeleder
40905e9049 Include <netinet/in.h> for ntoh*() and hton*() prototypes.
Approved by:	das (mentor)
2004-05-24 11:59:17 +00:00
Peter Wemm
f7dd47a8d1 Build/install gprof on amd64 as well, after repocopying the MD bits.
Not that it has anything to process yet, but that comes next.
2004-05-18 18:05:19 +00:00
Bruce Evans
6ff9ebfdc9 Fixed total disorder of MD includes.
Disorder buffer overflowed by:	arm commit
2004-05-14 21:05:35 +00:00
Olivier Houchard
361af5b54b Some arm bits for gprof. 2004-05-14 13:44:04 +00:00
Tim J. Robbins
e4b4ed071b Remove MD bits for unsupported architectures. 2003-10-30 12:21:31 +00:00
Tom Rhodes
fc6318e4e5 Remove 2 more unused doc Makefiles. 2003-02-04 18:26:08 +00:00
Peter Grehan
bdaf0d3b7d Add powerpc.h. Still missing powerpc.[ch] in gprof, but this gets
the MI stuff out of the way.

Approved: re (rwatson)
2002-12-10 02:22:01 +00:00
Ruslan Ermilov
8abea92cd2 mdoc(7) police: back out unproved changes in previous revision;
descriptions in the FILES section should be full sentences, as
demonstrated in mdoc(7) and /usr/share/examples/mdoc/.

Approved by:	re
2002-11-26 11:22:59 +00:00
Philippe Charnier
97fa9b7739 Remove done() which was just exit() so use of warn()/err() can be made. Abort
on allocation failure instead of displaying a warning and deferencing NULL
pointer after. Spelling. Add prototypes. Add list of option in synopsis section
of man page, -d is not referenced because available as a compile option. It
should be made a runtime option btw.
2002-10-16 13:50:09 +00:00
David E. O'Brien
e026a48c34 Consistently use FBSDID 2002-06-30 05:25:07 +00:00
Garrett Wollman
0fb7a0beb0 Fix preprocessor directive syntax (text after #endif).
The style of this program is still atrocious (not fixed).
2002-05-30 21:18:01 +00:00
Alfred Perlstein
e043516d4d Check for defined(__i386__) instead of just defined(i386) since the compiler
will be updated to only define(__i386__) for ANSI cleanliness.
2002-05-30 07:00:42 +00:00
Philippe Charnier
e8937ba009 Use `The .Nm utility' 2002-04-20 12:18:28 +00:00
Mike Barcroft
0ec63e60db Include <stdint.h> for definition of intmax_t and/or uintmax_t. 2002-03-25 05:23:45 +00:00
Jake Burkholder
9f5bcb6350 Make this build on sparc64. 2002-03-10 01:25:47 +00:00
Bruce Evans
275ffbc6e6 Support runtime specification of the history counter type by whatever
generated the gmon data.  The support is currently limited to what is
easy to implement and/or needed:

    signedess: signed or insigned
    size: 8, 16, 32 or 64 bits
    format: a binary integer in gprof's format (gprof is not a cross-tool).

High-resolution kernel profiling uses signed 64-bit counters.  Normal
kernel profiling and user profiling use unsigned 16-bit counters but
should use 32-bit ones.
2002-03-06 11:25:58 +00:00
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
Bruce Evans
312a529b81 Added missing copyright. Obtain one and a vendor id from gprof.c. aout.c
was split off from gprof.c in rev.1.7 of the latter.  elf.c is mostly new,
but the old copyright sort of applies to it and is better than none.

Use __FBSDID() for the FreeBSD id.
2002-02-21 12:03:06 +00:00
Bruce Evans
07ac83f0b0 Fixed a missing variable declaration so that gprof compiles with -DDEBUG. 2002-02-21 10:34:52 +00:00
Bruce Evans
4cd016e8fd Moved the definition of the machine-independent macro UNITS_TO_CODE
from <number of machines> machine-dependent headers to the one
non-header here it is used so that it is easier to fix.  This macro
just divides the machine-dependent offset OFFSET_OF_CODE by the
machine-independent scale factor sizeof(UNIT), as required for bug
for bug compatibility with the scaling of pc's in gprof.c.  UNIT is
the type of a profiling counter, and its size has nothing to do with
the correct scale factor except both are usually 2.
2002-02-21 07:12:57 +00:00
Ruslan Ermilov
2bdd8946cb Oops, forgot to remove the `beforeinstall' block. 2001-12-17 16:04:40 +00:00
Ruslan Ermilov
ccaec6d133 Install files via FILES. 2001-12-17 16:02:15 +00:00
Ruslan Ermilov
681c4d3c61 mdoc(7) police: kill whitespace at EOL. 2001-11-20 15:49:18 +00:00