History log of /freebsd-10.0-release/usr.bin/gprof/
Revision Date Author Comments
(<<< Hide modified files)
(Show modified files >>>)
259065 07-Dec-2013 gjb

- Copy stable/10 (r259064) to releng/10.0 as part of the
10.0-RELEASE cycle.
- Update __FreeBSD_version [1]
- Set branch name to -RC1

[1] 10.0-CURRENT __FreeBSD_version value ended at '55', so
start releng/10.0 at '100' so the branch is started with
a value ending in zero.

Approved by: re (implicit)
Sponsored by: The FreeBSD Foundation

256281 10-Oct-2013 gjb

Copy head (r256279) to stable/10 as part of the 10.0-RELEASE cycle.

Approved by: re (implicit)
Sponsored by: The FreeBSD Foundation


246783 14-Feb-2013 charnier

rework old-style functions prototypes
reduce WARNS=6 output


235975 25-May-2012 gber

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


235211 10-May-2012 gjb

General mdoc(7) and typo fixes.

PR: 167696
Submitted by: Nobuyuki Koganemaru (kogane!jp.freebsd.org)
MFC after: 3 days


228629 17-Dec-2011 dim

More fixes for correct printf length modifiers usr.bin/gprof.

MFC after: 1 week


228628 17-Dec-2011 dim

In usr.bin/gprof/aout.c, use the correct printf length modifier for a
uint32_t.

MFC after: 1 week


216370 11-Dec-2010 joel

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


216178 04-Dec-2010 uqs

Move most of the remaining USD/PSD/SMM papers into share/doc


201386 02-Jan-2010 ed

Build usr.bin/ with WARNS=6 by default.

Also add some missing $FreeBSD$ to keep svn happy.


201383 02-Jan-2010 ed

Add missing #include for string routines.


187116 12-Jan-2009 obrien

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>


186487 25-Dec-2008 trhodes

Remove reference to unimplemented "-c" option.

PR: 119338


182681 02-Sep-2008 obrien

Add gprof MIPS MD header and enable building gprof.

Obtained from: Juniper Networks


177926 04-Apr-2008 imp

Add mips support.


161547 23-Aug-2006 ru

Remove alpha-specific stuff.


153819 29-Dec-2005 grehan

clone i386.h for powerpc


151057 07-Oct-2005 bde

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.


151055 07-Oct-2005 bde

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.


141846 13-Feb-2005 ru

Expand *n't contractions.


136175 05-Oct-2004 green

Make sure to return 0 from kernel_getnfile() since if there were an
error, it would exit() (and it needs to return a value).


136099 03-Oct-2004 stefanf

Use a proper prototype for hertz().


131990 11-Jul-2004 stefanf

Fix a few cases that relied on 'implicit int' (constraint violation in C99).


131507 03-Jul-2004 ru

Deal with double whitespace.


131493 02-Jul-2004 ru

Fix after rev. 1.24 changes: bump document date, and remove -c
from SYNOPSIS.


131491 02-Jul-2004 ru

Mechanically kill hard sentence breaks.


130776 20-Jun-2004 stefanf

Retire support for gprof's -c option. All our currently supported
architectures only provide a dummy implementation.

Silence on: current@


129657 24-May-2004 stefanf

Include <string.h> for prototypes of various string functions.

Approved by: das (mentor)


129652 24-May-2004 stefanf

Include <netinet/in.h> for ntoh*() and hton*() prototypes.

Approved by: das (mentor)


129398 18-May-2004 peter

Build/install gprof on amd64 as well, after repocopying the MD bits.
Not that it has anything to process yet, but that comes next.


129243 14-May-2004 bde

Fixed total disorder of MD includes.

Disorder buffer overflowed by: arm commit


129222 14-May-2004 cognet

Some arm bits for gprof.


121735 30-Oct-2003 tjr

Remove MD bits for unsupported architectures.


110343 04-Feb-2003 trhodes

Remove 2 more unused doc Makefiles.


107718 10-Dec-2002 grehan

Add powerpc.h. Still missing powerpc.[ch] in gprof, but this gets
the MI stuff out of the way.

Approved: re (rwatson)


107264 26-Nov-2002 ru

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


105243 16-Oct-2002 charnier

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.


99112 30-Jun-2002 obrien

Consistently use FBSDID


97631 30-May-2002 wollman

Fix preprocessor directive syntax (text after #endif).
The style of this program is still atrocious (not fixed).


97551 30-May-2002 alfred

Check for defined(__i386__) instead of just defined(i386) since the compiler
will be updated to only define(__i386__) for ANSI cleanliness.


95124 20-Apr-2002 charnier

Use `The .Nm utility'


93123 25-Mar-2002 mike

Include <stdint.h> for definition of intmax_t and/or uintmax_t.


91976 10-Mar-2002 jake

Make this build on sparc64.


91738 06-Mar-2002 bde

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.


91735 06-Mar-2002 bde

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.


91018 21-Feb-2002 bde

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.


91017 21-Feb-2002 bde

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.


91012 21-Feb-2002 bde

Fixed a missing variable declaration so that gprof compiles with -DDEBUG.


91010 21-Feb-2002 bde

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.


88065 17-Dec-2001 ru

Oops, forgot to remove the `beforeinstall' block.


88064 17-Dec-2001 ru

Install files via FILES.


86675 20-Nov-2001 ru

mdoc(7) police: kill whitespace at EOL.


85739 30-Oct-2001 green

Add -K support to gprof(1), which enables dynamic symbol resolution from
the currently-running kernel (and supercedes an executable file argument
given). With this change, properly-compiled KLD modules are now
able to be profiled.

Obtained from: NAI Labs CBOSS project
Funded by: DARPA


85353 23-Oct-2001 peter

Add ia64 support (stubs, just like i386, alpha)


81637 14-Aug-2001 schweikh

Add hint about how we name profiled libraries (append _p at the right place).

PR: 8061
Submitted by: Brandon Gillespie <brandon@ice.cold.org>
Reviewed by: joerg, ru
MFC after: 5 weeks


79755 15-Jul-2001 dd

Remove whitespace at EOL.


79535 10-Jul-2001 ru

mdoc(7) police: removed HISTORY info from the .Os call.


76224 02-May-2001 obrien

* include/elf.h has been repo copied to include/elf-hints.h, and it no
longer includes machine/elf.h.
* consumers of elf.h now use the minimalist elf header possible.

This change is motivated by Binutils 2.11.0 and too much clashing over
our base elf headers and the Binutils elf headers.


75531 15-Apr-2001 dd

Grammar police: "its", not "it's", is the possessive form of "it".


70197 19-Dec-2000 ru

Prepare for mdoc(7)NG.


68963 20-Nov-2000 ru

mdoc(7) police: use the new features of the Nm macro.


57670 01-Mar-2000 sheldonh

Remove single-space hard sentence breaks. These degrade the quality
of the typeset output, tend to make diffs harder to read and provide
bad examples for new-comers to mdoc.


50477 28-Aug-1999 peter

$Id$ -> $FreeBSD$


48839 16-Jul-1999 simokawa

Enable gprof on alpha.
* alpha.{c,h} are same as i386.{c,h}.
* Force address calculation to be done in long precision(64bit on alpha)
rather than double precision(52bit).


48792 12-Jul-1999 nik

Add $Id$, to make it simpler for members of the translation teams to
track.

The $Id$ line is normally at the bottom of the main comment block in the
man page, separated from the rest of the manpage by an empty comment,
like so;

.\" $Id$
.\"

If the immediately preceding comment is a @(#) format ID marker than the
the $Id$ will line up underneath it with no intervening blank lines.
Otherwise, an additional blank line is inserted.

Approved by: bde


48519 03-Jul-1999 dt

Don't ignore weak symbols.

EGCS assign weak symbols to inline functions it couldn't inline (e.g. virtual
inline functions), template functions, etc. Omitting them result in quite bogus
profile.

Weak symbols created by __weak_reference are not really problem.

Caught by: Ilya Segalovich <iseg@comptek.ru>


47420 23-May-1999 jmz

Construct the profile file name from the name of the executable. A program
compiled with -pg and run will generate a file <executable-filename>.gmon,
not gmon.out.

PR: bin/8426


38928 07-Sep-1998 jdp

Make profiling work for ELF. gprof now autodetects the format of
the executable file, so it will work for both a.out and ELF format
files. I have split the object format specific code into separate
source files. It's cleaner than it was before, but it's still
pretty crufty.

Don't cheat on your make world for this update. A lot of things
have to be rebuilt for it to work, including the compiler and all
of the profiled libraries.


38850 05-Sep-1998 jb

Change MACHINE to MACHINE_ARCH to support MACHINE=pc98.


38194 08-Aug-1998 jdp

Don't ignore symbols containing "$". C++ destructors and other
special functions have names containing dollar signs, and ignoring
them causes gprof to produce incorrect and sometimes bizarre results.
The comment in the original code said that dollar signs were excluded
because they are used in Pascal labels. That's not much of an
issue these days.


27414 15-Jul-1997 charnier

Revert to original style.


27379 13-Jul-1997 bde

32-bit counters aren't large enough for 100+MHz clocks. Use 64-bit
counters. `4' in GPROF4 and gprof4 now means 8. gprof4 needs to be
recompiled to match the kernel.


27327 11-Jul-1997 charnier

Fix typo I introduced during last commit.


27313 10-Jul-1997 charnier

Use err(3).


21748 15-Jan-1997 wosch

Sort cross references.


18968 16-Oct-1996 bde

Use a (signed) int32_t counter instead of an `unsigned int' counter
for the GPROF4 case. This allows a simpler method to be used for
non-statistical profiling (it allows overhead adjustments to be
subtracted from one counter without harm if that counter goes
negative; otherwise the adjustment would have to be distributed).

32 bit counters were already too small for GPROF4 with a 200MHz
clock. int64_t counters should be used.


16227 08-Jun-1996 bde

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.


15082 07-Apr-1996 mpp

Correct some man page cross references and file location references.


15049 05-Apr-1996 joerg

Xref clocks(7).


14045 12-Feb-1996 mpp

Another round of man page cleanups.

Down to only about 100 items left to cleanup! :-)


13108 29-Dec-1995 bde

Implemented non-statistical kernel profiling. This is based on
looking at a high resolution clock for each of the following events:
function call, function return, interrupt entry, interrupt exit,
and interesting branches. The differences between the times of
these events are added at appropriate places in a ordinary histogram
(as if very fast statistical profiling sampled the pc at those
places) so that ordinary gprof can be used to analyze the times.

gmon.h:
Histogram counters need to be 4 bytes for microsecond resolutions.
They will need to be larger for the 586 clock.
The comments were vax-centric and wrong even on vaxes. Does anyone
disagree?

gprof4.c:
The standard gprof should support counters of all integral sizes
and the size of the counter should be in the gmon header. This
hack will do until then. (Use gprof4 -u to examine the results
of non-statistical profiling.)

config/*:
Non-statistical profiling is configured with `config -pp'.
`config -p' still gives ordinary profiling.

kgmon/*:
Non-statistical profiling is enabled with `kgmon -B'. `kgmon -b'
still enables ordinary profiling (and distables non-statistical
profiling) if non-statistical profiling is configured.


9701 25-Jul-1995 bde

Change `install' to `${INSTALL}' so that default install flags can be
specified in the top level Makefiles.


8874 30-May-1995 rgrimes

Remove trailing whitespace.


5190 22-Dec-1994 wollman

Added much-needed new options -[lL], to suppress printing of either the
call-graph or the flat profile, since often you only want one of them.


2513 05-Sep-1994 bde

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.


1591 27-May-1994 rgrimes

This commit was generated by cvs2svn to compensate for changes in r1590,
which included commits to RCS files with non-trunk default branches.


1590 27-May-1994 rgrimes

BSD 4.4 Lite Usr.bin Sources