History log of /freebsd-current/usr.bin/gprof/printgprof.c
Revision Date Author Comments
# 5e3934b1 24-Nov-2023 Warner Losh <imp@FreeBSD.org>

usr.bin: Automated cleanup of cdefs and other formatting

Apply the following automated changes to try to eliminate
no-longer-needed sys/cdefs.h includes as well as now-empty
blank lines in a row.

Remove /^#if.*\n#endif.*\n#include\s+<sys/cdefs.h>.*\n/
Remove /\n+#include\s+<sys/cdefs.h>.*\n+#if.*\n#endif.*\n+/
Remove /\n+#if.*\n#endif.*\n+/
Remove /^#if.*\n#endif.*\n/
Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/types.h>/
Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/param.h>/
Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/capsicum.h>/

Sponsored by: Netflix


# bdcbfde3 23-Nov-2023 Warner Losh <imp@FreeBSD.org>

usr.bin: Remove ancient SCCS tags.

Remove ancient SCCS tags from the tree, automated scripting, with two
minor fixup to keep things compiling. All the common forms in the tree
were removed with a perl script.

Sponsored by: Netflix


# 1d386b48 16-Aug-2023 Warner Losh <imp@FreeBSD.org>

Remove $FreeBSD$: one-line .c pattern

Remove /^[\s*]*__FBSDID\("\$FreeBSD\$"\);?\s*\n/


# 8a16b7a1 20-Nov-2017 Pedro F. Giffuni <pfg@FreeBSD.org>

General further adoption of SPDX licensing ID tags.

Mainly focus on files that use BSD 3-Clause license.

The Software Package Data Exchange (SPDX) group provides a specification
to make it easier for automated tools to detect and summarize well known
opensource licenses. We are gradually adopting the specification, noting
that the tags are considered only advisory and do not, in any way,
superceed or replace the license texts.

Special thanks to Wind River for providing access to "The Duke of
Highlander" tool: an older (2014) run over FreeBSD tree was useful as a
starting point.


# fbbd9655 28-Feb-2017 Warner Losh <imp@FreeBSD.org>

Renumber copyright clause 4

Renumber cluase 4 to 3, per what everybody else did when BSD granted
them permission to remove clause 3. My insistance on keeping the same
numbering for legal reasons is too pedantic, so give up on that point.

Submitted by: Jan Schaumann <jschauma@stevens.edu>
Pull Request: https://github.com/freebsd/freebsd/pull/96


# af2637db 14-Feb-2013 Philippe Charnier <charnier@FreeBSD.org>

rework old-style functions prototypes
reduce WARNS=6 output


# da52b4ca 11-Dec-2010 Joel Dahl <joel@FreeBSD.org>

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


# a7d5f7eb 19-Oct-2010 Jamie Gritton <jamie@FreeBSD.org>

A new jail(8) with a configuration file, to replace the work currently done
by /etc/rc.d/jail.


# fe0506d7 09-Mar-2010 Marcel Moolenaar <marcel@FreeBSD.org>

Create the altix project branch. The altix project will add support
for the SGI Altix 350 to FreeBSD/ia64. The hardware used for porting
is a two-module system, consisting of a base compute module and a
CPU expansion module. SGI's NUMAFlex architecture can be an excellent
platform to test CPU affinity and NUMA-aware features in FreeBSD.


# d7f03759 19-Oct-2008 Ulf Lilleengen <lulf@FreeBSD.org>

- Import the HEAD csup code which is the basis for the cvsmode work.


# 0b146898 07-Oct-2005 Bruce Evans <bde@FreeBSD.org>

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.


# 8b061e14 23-May-2004 Stefan Farfeleder <stefanf@FreeBSD.org>

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

Approved by: das (mentor)


# 97fa9b77 16-Oct-2002 Philippe Charnier <charnier@FreeBSD.org>

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.


# e026a48c 29-Jun-2002 David E. O'Brien <obrien@FreeBSD.org>

Consistently use FBSDID


# 0fb7a0be 30-May-2002 Garrett Wollman <wollman@FreeBSD.org>

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


# 8109a9af 06-Mar-2002 Bruce Evans <bde@FreeBSD.org>

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.


# 8d57b8d3 20-Feb-2002 Bruce Evans <bde@FreeBSD.org>

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.


# c3aac50f 27-Aug-1999 Peter Wemm <peter@FreeBSD.org>

$Id$ -> $FreeBSD$


# b34f7deb 10-Jul-1997 Philippe Charnier <charnier@FreeBSD.org>

Use err(3).


# d4aa2372 07-Jun-1996 Bruce Evans <bde@FreeBSD.org>

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.


# 7799f52a 30-May-1995 Rodney W. Grimes <rgrimes@FreeBSD.org>

Remove trailing whitespace.


# ff18d378 05-Sep-1994 Bruce Evans <bde@FreeBSD.org>

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.


# 9b50d902 26-May-1994 Rodney W. Grimes <rgrimes@FreeBSD.org>

BSD 4.4 Lite Usr.bin Sources