diff options
author | Dale Rahn <drahn@cvs.openbsd.org> | 2004-05-17 21:54:57 +0000 |
---|---|---|
committer | Dale Rahn <drahn@cvs.openbsd.org> | 2004-05-17 21:54:57 +0000 |
commit | 631eeff208608ed7b44459bd6c8ae905bcd7e8b6 (patch) | |
tree | 7be124105a0929655708fbbc134f9c2e3189c3f3 /gnu/usr.bin/binutils/gprof | |
parent | a7c8e0ae4a4b349099d02bc9d56bcf1979c0f0c3 (diff) |
Resolve merge conflicts, adjust method of W^X handing (.sh files)
remove testsuites (not useable) remove mmalloc (not part of new binutils).
Diffstat (limited to 'gnu/usr.bin/binutils/gprof')
41 files changed, 2701 insertions, 1326 deletions
diff --git a/gnu/usr.bin/binutils/gprof/ChangeLog b/gnu/usr.bin/binutils/gprof/ChangeLog index 3e18cc6dd89..25845df602b 100644 --- a/gnu/usr.bin/binutils/gprof/ChangeLog +++ b/gnu/usr.bin/binutils/gprof/ChangeLog @@ -1,14 +1,429 @@ -2001-06-11 Alan Modra <amodra@bigpond.net.au> +2003-03-27 Chris Demetriou <cgd@broadcom.com> + + * gmon_io.c (enum gmon_ptr_size, enum gmon_ptr_signedness): New. + (gmon_get_ptr_size, gmon_get_ptr_signedness): New. + (gmon_io_read_vma, gmon_io_write_vma, gmon_read_raw_arc) + (gmon_write_raw_arc, gmon_out_read, gmon_out_write): Adjust to + use new functions and enums. + +2003-02-21 K Schutte <schutte@fel.tno.nl> + + * corefile.c (core_create_line_syms): Check for a NULL sentinel + value before using it. + +2002-12-02 Nick Clifton <nickc@redhat.com> + + * configure.in (LINGUAS): Add pt_BR. + * configure: Regenerate. + * po/pt_BR: New Brazillian Portugese translation. + +2002-11-30 Alan Modra <amodra@bigpond.net.au> + + * basic_blocks.c, basic_blocks.h, cg_arcs.c, cg_dfn.c, cg_print.c, + corefile.c, gmon_io.c, gprof.c, gprof.h, hist.c, mips.c, source.c, + source.h, sym_ids.c, sym_ids.h, symtab.h, tahoe.c, vax.c: Replace + boolean with bfd_boolean, true with TRUE, false with FALSE. + Formatting. + +2002-11-12 Nick Clifton <nickc@redhat.com> + + * configure.in (ALL_LINGUAS): Add da. + * configure: Regenerate. + * po/da.po: New Danish translation. + +2002-08-22 Nick Clifton <nickc@redhat.com> + + * gprof.c (main): Turn off default excluded functions in FLAT + profile. + +2002-08-21 John David Anglin <dave@hiauly1.hia.nrc.ca> + + * gmon_io.c (gmon_io_read_64, gmon_io_write_64): Define only if + BFD_HOST_U_64_BIT is defined. + (gmon_io_read_vma, gmon_io_write_vma): Add ifdefs. + +2002-07-30 Nick Clifton <nickc@redhat.com> + + * po/tr.po: Updated Turkish translation. + +2002-07-30 Nick Clifton <nickc@redhat.com> + + * alpha.c, cg_arcs.c, cg_dfn.c, gmon.h, gprof.c, gprof.h, hertz.c, + i386.c, mips.c, sparc.c, tahoe.c, utils.c, vax.c: Update Copyright + notice so that it applies even if the sources are modified. + +2002-07-29 Ulrich Drepper <drepper@redhat.com> + + * gprof.texi (Executing the Program): Add documentation on how to use + bbconv.pl. Patch by Eric Hanchrow. + +2002-07-25 Nick Clifton <nickc@redhat.com> + + * po/es.po: Updated Spanish translation. + * po/fr.po: Updated French translation. + +2002-07-24 Dave Brolley <brolley@redhat.com> + + * corefile.c (core_create_function_syms): Use the end of the section + containing the symbol to compute max_vma. + +2002-07-24 Nick Clifton <nickc@redhat.com> + + * po/sv.po: Updated Swedish translation. + * po/es.po: Updated Spanish translation. + +2002-07-23 Nick Clifton <nickc@redhat.com> + + * po/fr.po: Updated French translation. + * po/id.po: New Indonesian translation. + * configure.in (LINGUAS): Add id. + * configure: Regenerate. + +2002-05-02 Nick Clifton <nickc@cambridge.redhat.com> + + * po/Make-in (.po.gmo): Do not attempt to create a .gmo file if + the sources are read-only. + +2002-04-04 Alan Modra <amodra@bigpond.net.au> + + * dep-in.sed: Cope with absolute paths. + * Makefile.am (dep.sed): Subst TOPDIR. + Run "make dep-am". + * Makefile.in: Regenerate. + +2002-03-21 Alan Modra <amodra@bigpond.net.au> + + * Makefile.am: Run "make dep-am". + * Makefile.in: Regenerate. + +2002-03-18 Nick Clifton <nickc@cambridge.redhat.com> + + * po/fr.po: Updated version. + +2002-03-13 Nick Clifton <nickc@cambridge.redhat.com> + + * po/fr.po: Updated version. + +2002-03-07 Daniel Jacobowitz <drow@mvista.com> + + * gprof.texi: Wrap @menu in @ifnottex, not @ifinfo. + +2002-02-19 Frank Ch. Eigler <fche@redhat.com> + + * hist.c (hist_print): Rewrite log_scale calculation loop. + +2002-02-11 Alan Modra <amodra@bigpond.net.au> + + * Makefile.am: "make dep-am". + * Makefile.in: Regenerate. + +2002-02-10 Daniel Jacobowitz <drow@mvista.com> + + * gprof.c: Include "getopt.h" after other includes, so that + the proper macros are defined. + * gen-c-prog.awk: Emit a prototype for the generated function. + +2002-02-01 Alan Modra <amodra@bigpond.net.au> + + * configure.in (build_warnings): Add -Wstrict-prototypes + -Wmissing-prototypes. + * aclocal.m4: Regenerate. + * gconfig.in: Regenerate. + * configure: Regenerate. + * Makefile.am: Run "make dep-am". + * Makefile.in: Regenerate. + + * alpha.c (alpha_find_call): Warning fixes. + * mips.c (mips_find_call): Likewise. + * sparc.c (sparc_find_call): Likewise. + * basic_blocks.c: Warning fixes. Eliminate DEFUN. + * call_graph.c: Likewise. + * cg_arcs.c: Likewise. + * cg_dfn.cp: Likewise. + * gprof.c: Likewise. + * gprof.h: Likewise. + * hist.c: Likewise. + * search_list.c: Likewise. + * source.c: Likewise. + * source.h: Likewise. + * sym_ids.c: Likewise. + * symtab.c: Likewise. + * symtab.h: Likewise. + * utils.c: Likewise. + * cg_print.c: Likewise. + (struct function_map, symbol_map, symbol_map_count): Move + declaration to.. + * corefile: ..here. + * corefile.c: Warning fixes. Eliminate DEFUN. + (struct function_map): Remove declaration. + * gmon_io.c: Warning fixes. Eliminate DEFUN. + (gmon_io_read_64): Make static. + (gmon_io_write_64): Likewise. + (gmon_read_raw_arc): Likewise. + (gmon_write_raw_arc): Likewise. + (gmon_io_write_8): Don't pass char, pass int param. + * gmon_io.h (gmon_io_write_8): Likewise. + + * Makefile.am: Run "make dep-am" + * Makefile.in: Regenerate. + + * basic_blocks.c: Replace bool with boolean, TRUE with true and + FALSE with false throughout. + * basic_blocks.h: Likewise. + * cg_arcs.c: Likewise. + * cg_dfn.c: Likewise. + * cg_print.c: Likewise. + * corefile.c: Likewise. + * gmon_io.c: Likewise. + * gprof.c: Likewise. + * hist.c: Likewise. + * mips.c: Likewise. + * source.c: Likewise. + * source.h: Likewise. + * sym_ids.c: Likewise. + * sym_ids.h: Likewise. + * symtab.h: Likewise. + * tahoe.c: Likewise. + * vax.c: Likewise. + * gprof.h: Likewise. + (TRUE): Don't define. + (FALSE): Don't define. + +2002-01-31 Jason R Thorpe <thorpej@wasabisystems.com> + + * TODO: Remove "host architecture pointer size" item. + * acconfig.h: Remove. + * gconfig.in: Regenerate. + * configure.in: Remove check for gmon pointer size. + * configure: Regenerate. + * gmon.h (GMON_HDRSIZE_BSD44_32): Define. + (GMON_HDRSIZE_BSD44_64): Ditto. + (GMON_HDRSIZE_OLDBSD_32): Ditto. + (GMON_HDRSIZE_OLDBSD_64): Ditto. + (struct raw_phdr): Wrap in #if 0, keeping it for + documentation purposes only. + (struct old_raw_phdr): Likewise. + (struct raw_arc): Likewise. Change type/size of + "count" member to long match 4.4BSD. + * gmon_io: Update copyright years. + (gmon_io_read_64): New function. + (gmon_io_read_vma): Use bfd_arch_bits_per_address to + determine target pointer size. Use gmon_io_read_32 + and gmon_io_read_64. + (gmon_io_write_64): New function. + (gmon_io_write_vma): Use bfd_arch_bits_per_address to + determine target pointer size. Use gmon_io_write_32 + and gmon_io_write_64. + (get_vma): Remove. + (put_vma): Ditto. + (gmon_read_raw_arc): New function. + (gmon_write_raw_arc): New function. + (gmon_out_read): Do not use struct raw_phdr or + struct old_raw_phdr to read the gmon header. Use + gmon_read_raw_arc to read call graph records. + (gmon_out_write): Do not use struct raw_phdr or + struct old_raw_phdr to write the gmon header. Use + gmon_write_raw_arc to write call graph records. + * po/gprof.pot: Regenerate. + * Makefile.in: Regenerate. + +2002-01-31 Alan Modra <amodra@bigpond.net.au> + + * alpha.c (alpha_Instruction): Don't use. + (alpha_find_call): Avoid use of bitfields and casts between + pointers and integers of different sizes. Avoid endian problems + when cross-compiling. + * vax.c (vax_find_call): Likewise. + (struct modebyte): Don't use. + (vax_operandmode): Pass in an unsigned char *. + (vax_operandlength): Likewise. + (vax_reladdr): Rename to vax_offset and return relative offset + rather than address. + * i386.c (i386_find_call): Avoid casts between pointers and + integers of different sizes. + * sparc.c (sparc_find_call): Likewise. Avoid endian problems. + * tahoe.c (tahoe_find_call): Likewise. + (tahoe_reladdr): Rename to tahoe_offset and return relative offset + rather than address. + + * basic_blocks.h: Don't include headers here. + * call_graph.h: Likewise. + * cg_arcs.h: Likewise. + * cg_print.h: Likewise. + * corefile.h: Likewise. + * gmon_io.h: Likewise. + * gmon_out.h: Likewise. + * hertz.h: Likewise. + * hist.h: Likewise. + * source.h: Likewise. + * sym_ids.h: Likewise. + * symtab.h: Likewise. + * gprof.h: Don't include ansidecl.h, do include bfd.h. + (bool): Don't typedef. + * alpha.c: Adjust #include's for above header changes. + * basic_blocks.c: Likewise. + * call_graph.c: Likewise. + * cg_arcs.c: Likewise. + * cg_dfn.c: Likewise. + * cg_print.c: Likewise. + * corefile.c: Likewise. + * gmon_io.c: Likewise. + * gprof.c: Likewise. + * hertz.c: Likewise. + * hist.c: Likewise. + * i386.c: Likewise. + * mips.c: Likewise. + * sparc.c: Likewise. + * sym_ids.c: Likewise. + * symtab.c: Likewise. + * tahoe.c: Likewise. + * utils.c: Likewise. + * vax.c: Likewise. + + * po/POTFILES.in: Regenerate. + +2002-01-27 Daniel Jacobowitz <drow@mvista.com> + + * configure: Regenerated. + +2002-01-26 Richard Henderson <rth@redhat.com> + + * i386.c (i386_iscall): Static. + * tahoe.c (indirectchild, tahoe_operandmode): Static. + (tahoe_operandlength, tahoe_reladdr): Static. + * vax.c (indirectchild): Static. + +2002-01-26 Hans-Peter Nilsson <hp@bitrange.com> + + * Makefile.am (install): Depend on install-info. + * Makefile.in: Regenerate. + +2002-01-26 Jason Thorpe <thorpej@wasabisystems.com> + + * mips.c: New file. + * Makefile.am (sources): Add mips.c. + (mips.o): New rule. + * Makefile.in: Regenerate. + * corefile.c: Update copyright years. + (find_call): Call mips_find_call for bfd_arch_mips. + +2002-01-26 Nick Clifton <nickc@cambridge.redhat.com> + + * po/fr.po: Updated version. + +2002-01-25 Nick Clifton <nickc@cambridge.redhat.com> + + * po/es.po: Updated version. + +2002-01-17 Nick Clifton <nickc@cambridge.redhat.com> + + * po/gprof.pot: Regenerate. + +2002-01-07 Nick Clifton <nickc@cambridge.redhat.com> + + * po/es.po: New file: Spanish translation. + * configure.in (ALL_LINGUAS): Add es. + * configure: Regenerate. + +2002-01-03 Nick Clifton <nickc@cambridge.redhat.com> + + * gmon_io.c (gmon_out_read): Remove use of ngettext(). It is not + present under AIX. + +2002-01-02 Nick Clifton <nickc@cambridge.redhat.com> + + * cg_print.c (print_header): Fix spelling typo. + + * gmon_io.c (gmon_out_read): Fix formatting of text messages to + allow easier translation into other languages. + +2001-12-21 Nick Clifton <nickc@cambridge.redhat.com> + + * configure.in (ALL_LINGUAS): Add sv. + * configure: Regenerate. + * po/sv.po: Import from translation project web site. + +2001-12-03 Nick Clifton <nickc@cambridge.redhat.com> + + * configure.in (LINGUAS): Add tr. + * configure: Regenerate. + * po/tr.po: Import from translation project's web site. + +2001-11-02 Nick Clifton <nickc@cambridge.redhat.com> + + * configure.in (ALL_LINGUAS): Add 'fr'. + * configure: Regernate. + * po/fr.po: New file. + +2001-10-03 Alan Modra <amodra@bigpond.net.au> + + * configure: Regenerate. + +2001-10-02 Alan Modra <amodra@bigpond.net.au> + + * Makefile.am (Makefile): Depend on bfd/configure.in. + Run "make dep-am". + * Makefile.in: Regenerate. + +2001-09-18 Bruno Haible <haible@clisp.cons.org> + + * gprof.c (main): For gettext, also set the LC_CTYPE locate facet. + * sym_ids.c: Include "safe-ctype.h" instead of <ctype.h>. + (parse_spec): Use ISDIGIT instead of isdigit. + +2001-09-18 Alan Modra <amodra@bigpond.net.au> + + * sparc.c (sparc_find_call): Warning fix. + * alpha.c (alpha_find_call): Likewise. + +2001-08-09 Alan Modra <amodra@bigpond.net.au> + + * alpha.c: Add missing prototypes. + * sparc.c: Likewise. + * tahoe.c: Likewise. + * vax.c: Likewise. + * i386.c: Likewise. + (i386_iscall): Don't use DEFUN. + +2001-07-19 Nick Clifton <nickc@cambridge.redhat.com> + + * NOTES: Rename to README for consistency with other binutils. + +2001-06-18 H.J. Lu <hjl@gnu.org> + + * Makefile.am (diststuff): Add $(MANS). + (gprof.1): Remove the prefix `$(srcdir)/'. + * Makefile.in: Regenerated. + + * gprof.1: Removed. + +2001-06-12 Ben Elliston <bje@redhat.com> + + * gprof.texi (File Format): Profile data files are stored in + target byte order, not host byte order. + +2001-05-16 Alexandre Oliva <aoliva@redhat.com> - Merge from mainline. - 2001-05-16 Alexandre Oliva <aoliva@redhat.com> * gmon_io.c (gmon_io_read, gmon_io_write_vma, gmon_io_write_32, gmon_io_write_8, gmon_io_write): Adjust argument list for K&R C. - 2001-03-13 David Mosberger <davidm@hpl.hp.com> +2001-04-06 Stephane Carrez <Stephane.Carrez@worldnet.fr> + + * gprof.texi: Put @c man begin and @c man end indications + to generate man page using texi2pod and pod2man. Added SEEALSO, + SYNOPSIS, BUGS, FILES and DESCRIPTION from original gprof.1 + enclosed in @ifset man condition. + * Makefile.am (MANCONF, TEXI2POD, POD2MAN): New variable. + Generate gprof.1 from gprof.texi. + * gprof.1: Generate from gprof.texi. + * Makefile.in: Regenerate. + +2001-03-13 David Mosberger <davidm@hpl.hp.com> + * hist.c (hist_dimension): Declare as an array of 16 characters. (hist_read_rec): If SAMPLEDEBUG, print each histogram bin count. + * basic_blocks.c: Whitespace and formatting changes. * bb_exit_func.c: Ditto. * call_graph.c: Ditto. @@ -36,8 +451,10 @@ * tahoe.c: Ditto. * utils.c: Ditto. * vax.c: Ditto. + * gmon_out.h (gmon_hist_hdr): Delete. (gmon_cg_arc_record): Delete. + * gmon_io.c (put_vma): Declare "static". (get_vma): Ditto. (gmon_io_write): New function. @@ -54,6 +471,7 @@ (cg_write_arcs): Ditto. * hist.c (hist_read_rec): Ditto. (hist_write_hist): Ditto. + From Jes Sorensen <jes@linuxcare.com> * gmon_out.h: Use GMON_PTR_SIZE instead of sizeof(char*). * gmon.h: Ditto. @@ -64,7 +482,8 @@ * configure: Regenerate. * Makefile.in: Regenerate. - 2001-02-27 Alan Modra <alan@linuxcare.com.au> +2001-02-27 Alan Modra <alan@linuxcare.com.au> + * configure.in (BFD_VERSION): New. (AM_INIT_AUTOMAKE): Use $BFD_VERSION. * configure: Regenerate. @@ -72,23 +491,6 @@ * Makefile.am: Run "make dep-am" * Makefile.in: Regenerate. -2001-06-10 Philip Blundell <philb@gnu.org> - - * configure.in: Set version to 2.11.1. - * configure: Regenerate. - -2001-06-07 Alan Modra <amodra@bigpond.net.au> - - * Many files: Update copyright notices. - -2001-03-16 Philip Blundell <philb@gnu.org> - - * configure: Regenerate. - -2001-03-11 Philip Blundell <philb@gnu.org> - - * configure.in: Set version to 2.11. - 2001-01-27 Michael Sokolov <msokolov@ivan.Harhan.ORG> * basic_blocks.c: #include <unistd.h> only if it exists. @@ -241,7 +643,7 @@ [HAVE_SETITIMER]: If they define both HAVE_SETITIMER and HAVE_SYSCONF, try setitimer and fall back on sysconf. -Fri Apr 7 15:56:57 2000 Andrew Cagney <cagney@b1.cygnus.com> +2000-04-07 Andrew Cagney <cagney@b1.cygnus.com> * configure.in (WARN_CFLAGS): Set to -W -Wall by default. Add --enable-build-warnings option. @@ -330,7 +732,7 @@ Fri Apr 7 15:56:57 2000 Andrew Cagney <cagney@b1.cygnus.com> * Makefile.am ($(OBJECTS)): Add gmon.h. * Makefile.in: Rebuild. -Mon Jun 14 10:35:28 1999 Andreas Schwab <schwab@issan.cs.uni-dortmund.de> +1999-06-14 Andreas Schwab <schwab@issan.cs.uni-dortmund.de> * gprof.texi: Fix typo. @@ -382,12 +784,12 @@ Tue Feb 16 17:01:33 1999 Ian Lance Taylor <ian@cygnus.com> * Makefile.in: Rebuild. * gconfig.in: Rebuild. -Sun Dec 6 21:57:50 1998 Ian Lance Taylor <ian@cygnus.com> +1998-12-06 Ian Lance Taylor <ian@cygnus.com> * gprof.texi (Symspecs): Mention that you have to add any underscore yourself when naming a symbol. -Mon Nov 2 15:05:33 1998 Geoffrey Noer <noer@cygnus.com> +1998-11-02 Geoffrey Noer <noer@cygnus.com> * configure.in: detect cygwin* instead of cygwin32* * configure: regenerate @@ -1660,4 +2062,3 @@ Thu Jun 4 11:34:02 1992 Mark Eichin (eichin at cygnus.com) help in debugging the problem (with -DDEBUG) * gprof.c: symbol values are now real values, don't add the vma anymore. (done for solaris; should verify this on other platforms) - * ChangeLog: created. diff --git a/gnu/usr.bin/binutils/gprof/Makefile.am b/gnu/usr.bin/binutils/gprof/Makefile.am index 6321bdb2b7f..2fc446cf895 100644 --- a/gnu/usr.bin/binutils/gprof/Makefile.am +++ b/gnu/usr.bin/binutils/gprof/Makefile.am @@ -10,6 +10,9 @@ BASEDIR = $(srcdir)/.. BFDDIR = $(BASEDIR)/bfd INCDIR = $(BASEDIR)/include +WARN_CFLAGS = @WARN_CFLAGS@ +AM_CFLAGS = $(WARN_CFLAGS) + MKDEP = gcc -MM INCLUDES = -D_GNU_SOURCE -DDEBUG -I../bfd -I$(srcdir)/../include -I$(srcdir)/../bfd -I$(srcdir)/../intl -I../intl -I. -DLOCALEDIR="\"$(prefix)/share/locale\"" @@ -20,21 +23,20 @@ bin_PROGRAMS = gprof sources = basic_blocks.c call_graph.c cg_arcs.c cg_dfn.c \ cg_print.c corefile.c gmon_io.c gprof.c hertz.c hist.c source.c \ search_list.c symtab.c sym_ids.c utils.c \ - i386.c alpha.c vax.c tahoe.c sparc.c + i386.c alpha.c vax.c tahoe.c sparc.c mips.c gprof_SOURCES = $(sources) flat_bl.c bsd_callg_bl.c fsf_callg_bl.c -gprof_DEPENDENCIES = ../bfd/libbfd.la ../libiberty/libiberty.a $(INTLDEPS) -gprof_LDADD = ../bfd/libbfd.la ../libiberty/libiberty.a $(INTLLIBS) +gprof_DEPENDENCIES = ../bfd/libbfd.la $(INTLDEPS) +gprof_LDADD = ../bfd/libbfd.la -liberty $(INTLLIBS) noinst_HEADERS = \ basic_blocks.h call_graph.h cg_arcs.h cg_dfn.h cg_print.h \ corefile.h gmon.h gmon_io.h gmon_out.h gprof.h hertz.h hist.h \ search_list.h source.h sym_ids.h symtab.h utils.h -EXTRA_DIST = flat_bl.c bsd_callg_bl.c fsf_callg_bl.c bbconv.pl - BUILT_SOURCES = flat_bl.c bsd_callg_bl.c fsf_callg_bl.c +EXTRA_DIST = $(BUILT_SOURCES) bbconv.pl $(man_MANS) -diststuff: $(BUILT_SOURCES) info +diststuff: $(BUILT_SOURCES) info $(man_MANS) .m.c: awk -f $(srcdir)/gen-c-prog.awk > ./$*.c \ @@ -46,16 +48,45 @@ po/POTFILES.in: @MAINT@ Makefile for file in $(POTFILES); do echo $$file; done | sort > tmp \ && mv tmp $(srcdir)/po/POTFILES.in +MANCONF = -Dman + +TEXI2POD = perl $(srcdir)/../etc/texi2pod.pl + +POD2MAN = pod2man --center="GNU" --release="binutils-$(VERSION)" --section=1 + info_TEXINFOS = gprof.texi man_MANS = gprof.1 +# Build the man page from the texinfo file +# The sed command removes the no-adjust Nroff command so that +# the man output looks standard. +gprof.1: $(srcdir)/gprof.texi + touch $@ + -$(TEXI2POD) $(MANCONF) -Dgprof < $(srcdir)/gprof.texi > gprof.pod + -($(POD2MAN) gprof.pod | \ + sed -e '/^.if n .na/d' > $@.T$$$$ && \ + mv -f $@.T$$$$ $@) || \ + (rm -f $@.T$$$$ && exit 1) + rm -f gprof.pod + +Makefile: $(BFDDIR)/configure.in + +# We want install to imply install-info as per GNU standards, despite the +# cygnus option. +install: install-info + # Targets to rebuild dependencies in this Makefile. # Have to get rid of DEP1 here so that "$?" later includes all sources. DEP: dep.sed $(gprof_SOURCES) $(noinst_HEADERS) gconfig.h rm -f DEP1 $(MAKE) MKDEP="$(MKDEP)" DEP1 - sed -f dep.sed < DEP1 > $@ - echo '# IF YOU PUT ANYTHING HERE IT WILL GO AWAY' >> $@ + sed -f dep.sed < DEP1 > DEPA + echo '# IF YOU PUT ANYTHING HERE IT WILL GO AWAY' >> DEPA + if grep ' /' DEPA > /dev/null 2> /dev/null; then \ + echo 'make DEP failed!'; exit 1; \ + else \ + mv -f DEPA $@; \ + fi DEP1: $(gprof_SOURCES) echo '# DO NOT DELETE THIS LINE -- mkdep uses it.' > DEP2 @@ -69,7 +100,8 @@ dep.sed: dep-in.sed config.status -e 's!@INCDIR@!$(INCDIR)!' \ -e 's!@BFDDIR@!$(BFDDIR)!' \ -e 's!@SRCDIR@!$(srcdir)!' \ - -e "s!@OBJDIR@!$${objdir}!" + -e "s!@OBJDIR@!$${objdir}!" \ + -e 's!@TOPDIR@!'`echo $(srcdir) | sed -e s,/gprof$$,,`'!' dep: DEP sed -e '/^..DO NOT DELETE THIS LINE/,$$d' < Makefile > tmp-Makefile @@ -88,94 +120,118 @@ dep-am: DEP .PHONY: dep dep-in dep-am -CLEANFILES = dep.sed DEP DEP1 DEP2 +CLEANFILES = dep.sed DEP DEPA DEP1 DEP2 # DO NOT DELETE THIS LINE -- mkdep uses it. # DO NOT PUT ANYTHING AFTER THIS LINE, IT WILL GO AWAY. -basic_blocks.o: basic_blocks.c basic_blocks.h gprof.h \ - $(BFDDIR)/sysdep.h ../bfd/config.h $(INCDIR)/fopen-same.h \ - gconfig.h $(INCDIR)/bin-bugs.h source.h search_list.h \ - symtab.h ../bfd/bfd.h corefile.h gmon_io.h gmon.h gmon_out.h \ - $(INCDIR)/libiberty.h sym_ids.h -call_graph.o: call_graph.c cg_arcs.h gprof.h $(BFDDIR)/sysdep.h \ - ../bfd/config.h $(INCDIR)/fopen-same.h gconfig.h $(INCDIR)/bin-bugs.h \ - symtab.h ../bfd/bfd.h source.h search_list.h call_graph.h \ - corefile.h gmon_io.h gmon.h gmon_out.h sym_ids.h +basic_blocks.o: basic_blocks.c $(INCDIR)/libiberty.h \ + $(INCDIR)/ansidecl.h gprof.h $(BFDDIR)/sysdep.h ../bfd/config.h \ + $(INCDIR)/fopen-same.h $(INCDIR)/filenames.h ../bfd/bfd.h \ + $(INCDIR)/symcat.h gconfig.h $(INCDIR)/bin-bugs.h basic_blocks.h \ + corefile.h gmon_io.h gmon_out.h search_list.h source.h \ + symtab.h sym_ids.h +call_graph.o: call_graph.c gprof.h $(BFDDIR)/sysdep.h \ + $(INCDIR)/ansidecl.h ../bfd/config.h $(INCDIR)/fopen-same.h \ + $(INCDIR)/filenames.h ../bfd/bfd.h $(INCDIR)/symcat.h \ + gconfig.h $(INCDIR)/bin-bugs.h search_list.h source.h \ + symtab.h cg_arcs.h call_graph.h corefile.h gmon_io.h \ + gmon_out.h sym_ids.h cg_arcs.o: cg_arcs.c $(INCDIR)/libiberty.h $(INCDIR)/ansidecl.h \ gprof.h $(BFDDIR)/sysdep.h ../bfd/config.h $(INCDIR)/fopen-same.h \ - gconfig.h $(INCDIR)/bin-bugs.h call_graph.h symtab.h \ - ../bfd/bfd.h source.h search_list.h cg_arcs.h cg_dfn.h \ - cg_print.h utils.h sym_ids.h + $(INCDIR)/filenames.h ../bfd/bfd.h $(INCDIR)/symcat.h \ + gconfig.h $(INCDIR)/bin-bugs.h search_list.h source.h \ + symtab.h call_graph.h cg_arcs.h cg_dfn.h cg_print.h \ + utils.h sym_ids.h cg_dfn.o: cg_dfn.c $(INCDIR)/libiberty.h $(INCDIR)/ansidecl.h \ gprof.h $(BFDDIR)/sysdep.h ../bfd/config.h $(INCDIR)/fopen-same.h \ - gconfig.h $(INCDIR)/bin-bugs.h cg_arcs.h symtab.h ../bfd/bfd.h \ - source.h search_list.h cg_dfn.h utils.h + $(INCDIR)/filenames.h ../bfd/bfd.h $(INCDIR)/symcat.h \ + gconfig.h $(INCDIR)/bin-bugs.h search_list.h source.h \ + symtab.h cg_arcs.h cg_dfn.h utils.h cg_print.o: cg_print.c $(INCDIR)/libiberty.h $(INCDIR)/ansidecl.h \ - cg_arcs.h gprof.h $(BFDDIR)/sysdep.h ../bfd/config.h \ - $(INCDIR)/fopen-same.h gconfig.h $(INCDIR)/bin-bugs.h \ - symtab.h ../bfd/bfd.h source.h search_list.h cg_print.h \ - hist.h utils.h + gprof.h $(BFDDIR)/sysdep.h ../bfd/config.h $(INCDIR)/fopen-same.h \ + $(INCDIR)/filenames.h ../bfd/bfd.h $(INCDIR)/symcat.h \ + gconfig.h $(INCDIR)/bin-bugs.h search_list.h source.h \ + symtab.h cg_arcs.h cg_print.h hist.h utils.h corefile.h corefile.o: corefile.c $(INCDIR)/libiberty.h $(INCDIR)/ansidecl.h \ gprof.h $(BFDDIR)/sysdep.h ../bfd/config.h $(INCDIR)/fopen-same.h \ - gconfig.h $(INCDIR)/bin-bugs.h corefile.h ../bfd/bfd.h \ - symtab.h source.h search_list.h -gmon_io.o: gmon_io.c cg_arcs.h gprof.h $(BFDDIR)/sysdep.h \ - ../bfd/config.h $(INCDIR)/fopen-same.h gconfig.h $(INCDIR)/bin-bugs.h \ - symtab.h ../bfd/bfd.h source.h search_list.h basic_blocks.h \ - corefile.h call_graph.h gmon_io.h gmon.h gmon_out.h \ + $(INCDIR)/filenames.h ../bfd/bfd.h $(INCDIR)/symcat.h \ + gconfig.h $(INCDIR)/bin-bugs.h search_list.h source.h \ + symtab.h corefile.h +gmon_io.o: gmon_io.c gprof.h $(BFDDIR)/sysdep.h $(INCDIR)/ansidecl.h \ + ../bfd/config.h $(INCDIR)/fopen-same.h $(INCDIR)/filenames.h \ + ../bfd/bfd.h $(INCDIR)/symcat.h gconfig.h $(INCDIR)/bin-bugs.h \ + search_list.h source.h symtab.h cg_arcs.h basic_blocks.h \ + corefile.h call_graph.h gmon_io.h gmon_out.h gmon.h \ hertz.h hist.h $(INCDIR)/libiberty.h -gprof.o: gprof.c $(INCDIR)/getopt.h $(INCDIR)/libiberty.h \ - $(INCDIR)/ansidecl.h gprof.h $(BFDDIR)/sysdep.h ../bfd/config.h \ - $(INCDIR)/fopen-same.h gconfig.h $(INCDIR)/bin-bugs.h \ - basic_blocks.h source.h search_list.h symtab.h ../bfd/bfd.h \ - call_graph.h cg_arcs.h cg_print.h corefile.h gmon_io.h \ - gmon.h hertz.h hist.h sym_ids.h -hertz.o: hertz.c hertz.h gprof.h $(BFDDIR)/sysdep.h \ - ../bfd/config.h $(INCDIR)/fopen-same.h gconfig.h $(INCDIR)/bin-bugs.h +gprof.o: gprof.c $(INCDIR)/libiberty.h $(INCDIR)/ansidecl.h \ + gprof.h $(BFDDIR)/sysdep.h ../bfd/config.h $(INCDIR)/fopen-same.h \ + $(INCDIR)/filenames.h ../bfd/bfd.h $(INCDIR)/symcat.h \ + gconfig.h $(INCDIR)/bin-bugs.h search_list.h source.h \ + symtab.h basic_blocks.h call_graph.h cg_arcs.h cg_print.h \ + corefile.h gmon_io.h hertz.h hist.h sym_ids.h $(INCDIR)/demangle.h +hertz.o: hertz.c gprof.h $(BFDDIR)/sysdep.h $(INCDIR)/ansidecl.h \ + ../bfd/config.h $(INCDIR)/fopen-same.h $(INCDIR)/filenames.h \ + ../bfd/bfd.h $(INCDIR)/symcat.h gconfig.h $(INCDIR)/bin-bugs.h \ + hertz.h hist.o: hist.c $(INCDIR)/libiberty.h $(INCDIR)/ansidecl.h \ gprof.h $(BFDDIR)/sysdep.h ../bfd/config.h $(INCDIR)/fopen-same.h \ - gconfig.h $(INCDIR)/bin-bugs.h corefile.h ../bfd/bfd.h \ - gmon_io.h gmon.h gmon_out.h hist.h symtab.h source.h \ - search_list.h sym_ids.h utils.h -source.o: source.c gprof.h $(BFDDIR)/sysdep.h ../bfd/config.h \ - $(INCDIR)/fopen-same.h gconfig.h $(INCDIR)/bin-bugs.h \ + $(INCDIR)/filenames.h ../bfd/bfd.h $(INCDIR)/symcat.h \ + gconfig.h $(INCDIR)/bin-bugs.h search_list.h source.h \ + symtab.h corefile.h gmon_io.h gmon_out.h hist.h sym_ids.h \ + utils.h +source.o: source.c gprof.h $(BFDDIR)/sysdep.h $(INCDIR)/ansidecl.h \ + ../bfd/config.h $(INCDIR)/fopen-same.h $(INCDIR)/filenames.h \ + ../bfd/bfd.h $(INCDIR)/symcat.h gconfig.h $(INCDIR)/bin-bugs.h \ $(INCDIR)/libiberty.h search_list.h source.h search_list.o: search_list.c $(INCDIR)/libiberty.h \ $(INCDIR)/ansidecl.h gprof.h $(BFDDIR)/sysdep.h ../bfd/config.h \ - $(INCDIR)/fopen-same.h gconfig.h $(INCDIR)/bin-bugs.h \ - search_list.h -symtab.o: symtab.c gprof.h $(BFDDIR)/sysdep.h ../bfd/config.h \ - $(INCDIR)/fopen-same.h gconfig.h $(INCDIR)/bin-bugs.h \ - cg_arcs.h symtab.h ../bfd/bfd.h source.h search_list.h \ - corefile.h + $(INCDIR)/fopen-same.h $(INCDIR)/filenames.h ../bfd/bfd.h \ + $(INCDIR)/symcat.h gconfig.h $(INCDIR)/bin-bugs.h search_list.h +symtab.o: symtab.c gprof.h $(BFDDIR)/sysdep.h $(INCDIR)/ansidecl.h \ + ../bfd/config.h $(INCDIR)/fopen-same.h $(INCDIR)/filenames.h \ + ../bfd/bfd.h $(INCDIR)/symcat.h gconfig.h $(INCDIR)/bin-bugs.h \ + search_list.h source.h symtab.h cg_arcs.h corefile.h sym_ids.o: sym_ids.c $(INCDIR)/libiberty.h $(INCDIR)/ansidecl.h \ - cg_arcs.h gprof.h $(BFDDIR)/sysdep.h ../bfd/config.h \ - $(INCDIR)/fopen-same.h gconfig.h $(INCDIR)/bin-bugs.h \ - symtab.h ../bfd/bfd.h source.h search_list.h sym_ids.h -utils.o: utils.c gprof.h $(BFDDIR)/sysdep.h ../bfd/config.h \ - $(INCDIR)/fopen-same.h gconfig.h $(INCDIR)/bin-bugs.h \ - cg_arcs.h symtab.h ../bfd/bfd.h source.h search_list.h -i386.o: i386.c gprof.h $(BFDDIR)/sysdep.h ../bfd/config.h \ - $(INCDIR)/fopen-same.h gconfig.h $(INCDIR)/bin-bugs.h \ - cg_arcs.h symtab.h ../bfd/bfd.h source.h search_list.h \ - corefile.h hist.h -alpha.o: alpha.c gprof.h $(BFDDIR)/sysdep.h ../bfd/config.h \ - $(INCDIR)/fopen-same.h gconfig.h $(INCDIR)/bin-bugs.h \ - cg_arcs.h symtab.h ../bfd/bfd.h source.h search_list.h \ - corefile.h hist.h -vax.o: vax.c gprof.h $(BFDDIR)/sysdep.h ../bfd/config.h \ - $(INCDIR)/fopen-same.h gconfig.h $(INCDIR)/bin-bugs.h \ - cg_arcs.h symtab.h ../bfd/bfd.h source.h search_list.h \ - corefile.h hist.h -tahoe.o: tahoe.c gprof.h $(BFDDIR)/sysdep.h ../bfd/config.h \ - $(INCDIR)/fopen-same.h gconfig.h $(INCDIR)/bin-bugs.h \ - cg_arcs.h symtab.h ../bfd/bfd.h source.h search_list.h \ - corefile.h hist.h -sparc.o: sparc.c gprof.h $(BFDDIR)/sysdep.h ../bfd/config.h \ - $(INCDIR)/fopen-same.h gconfig.h $(INCDIR)/bin-bugs.h \ - cg_arcs.h symtab.h ../bfd/bfd.h source.h search_list.h \ - corefile.h hist.h -flat_bl.o: flat_bl.c -bsd_callg_bl.o: bsd_callg_bl.c -fsf_callg_bl.o: fsf_callg_bl.c + $(INCDIR)/safe-ctype.h gprof.h $(BFDDIR)/sysdep.h ../bfd/config.h \ + $(INCDIR)/fopen-same.h $(INCDIR)/filenames.h ../bfd/bfd.h \ + $(INCDIR)/symcat.h gconfig.h $(INCDIR)/bin-bugs.h search_list.h \ + source.h symtab.h cg_arcs.h sym_ids.h +utils.o: utils.c $(INCDIR)/demangle.h $(INCDIR)/ansidecl.h \ + gprof.h $(BFDDIR)/sysdep.h ../bfd/config.h $(INCDIR)/fopen-same.h \ + $(INCDIR)/filenames.h ../bfd/bfd.h $(INCDIR)/symcat.h \ + gconfig.h $(INCDIR)/bin-bugs.h search_list.h source.h \ + symtab.h cg_arcs.h utils.h +i386.o: i386.c gprof.h $(BFDDIR)/sysdep.h $(INCDIR)/ansidecl.h \ + ../bfd/config.h $(INCDIR)/fopen-same.h $(INCDIR)/filenames.h \ + ../bfd/bfd.h $(INCDIR)/symcat.h gconfig.h $(INCDIR)/bin-bugs.h \ + search_list.h source.h symtab.h cg_arcs.h corefile.h \ + hist.h +alpha.o: alpha.c gprof.h $(BFDDIR)/sysdep.h $(INCDIR)/ansidecl.h \ + ../bfd/config.h $(INCDIR)/fopen-same.h $(INCDIR)/filenames.h \ + ../bfd/bfd.h $(INCDIR)/symcat.h gconfig.h $(INCDIR)/bin-bugs.h \ + search_list.h source.h symtab.h cg_arcs.h corefile.h \ + hist.h +vax.o: vax.c gprof.h $(BFDDIR)/sysdep.h $(INCDIR)/ansidecl.h \ + ../bfd/config.h $(INCDIR)/fopen-same.h $(INCDIR)/filenames.h \ + ../bfd/bfd.h $(INCDIR)/symcat.h gconfig.h $(INCDIR)/bin-bugs.h \ + search_list.h source.h symtab.h cg_arcs.h corefile.h \ + hist.h +tahoe.o: tahoe.c gprof.h $(BFDDIR)/sysdep.h $(INCDIR)/ansidecl.h \ + ../bfd/config.h $(INCDIR)/fopen-same.h $(INCDIR)/filenames.h \ + ../bfd/bfd.h $(INCDIR)/symcat.h gconfig.h $(INCDIR)/bin-bugs.h \ + search_list.h source.h symtab.h cg_arcs.h corefile.h \ + hist.h +sparc.o: sparc.c gprof.h $(BFDDIR)/sysdep.h $(INCDIR)/ansidecl.h \ + ../bfd/config.h $(INCDIR)/fopen-same.h $(INCDIR)/filenames.h \ + ../bfd/bfd.h $(INCDIR)/symcat.h gconfig.h $(INCDIR)/bin-bugs.h \ + search_list.h source.h symtab.h cg_arcs.h corefile.h \ + hist.h +mips.o: mips.c gprof.h $(BFDDIR)/sysdep.h $(INCDIR)/ansidecl.h \ + ../bfd/config.h $(INCDIR)/fopen-same.h $(INCDIR)/filenames.h \ + ../bfd/bfd.h $(INCDIR)/symcat.h gconfig.h $(INCDIR)/bin-bugs.h \ + search_list.h source.h symtab.h cg_arcs.h corefile.h \ + hist.h +flat_bl.o: flat_bl.c $(INCDIR)/ansidecl.h +bsd_callg_bl.o: bsd_callg_bl.c $(INCDIR)/ansidecl.h +fsf_callg_bl.o: fsf_callg_bl.c $(INCDIR)/ansidecl.h # IF YOU PUT ANYTHING HERE IT WILL GO AWAY diff --git a/gnu/usr.bin/binutils/gprof/Makefile.in b/gnu/usr.bin/binutils/gprof/Makefile.in index 98244736edb..c11cf5fe736 100644 --- a/gnu/usr.bin/binutils/gprof/Makefile.in +++ b/gnu/usr.bin/binutils/gprof/Makefile.in @@ -1,6 +1,6 @@ -# Makefile.in generated automatically by automake 1.4 from Makefile.am +# Makefile.in generated automatically by automake 1.4-p6 from Makefile.am -# Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc. +# Copyright (C) 1994, 1995-8, 1999, 2001 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -120,27 +120,26 @@ INCLUDES = -D_GNU_SOURCE -DDEBUG -I../bfd -I$(srcdir)/../include -I$(srcdir)/../ bin_PROGRAMS = gprof -sources = basic_blocks.c call_graph.c cg_arcs.c cg_dfn.c \ - cg_print.c corefile.c gmon_io.c gprof.c hertz.c hist.c source.c \ - search_list.c symtab.c sym_ids.c utils.c \ - i386.c alpha.c vax.c tahoe.c sparc.c +sources = basic_blocks.c call_graph.c cg_arcs.c cg_dfn.c cg_print.c corefile.c gmon_io.c gprof.c hertz.c hist.c source.c search_list.c symtab.c sym_ids.c utils.c i386.c alpha.c vax.c tahoe.c sparc.c mips.c gprof_SOURCES = $(sources) flat_bl.c bsd_callg_bl.c fsf_callg_bl.c gprof_DEPENDENCIES = ../bfd/libbfd.la $(INTLDEPS) gprof_LDADD = ../bfd/libbfd.la -liberty $(INTLLIBS) -noinst_HEADERS = \ - basic_blocks.h call_graph.h cg_arcs.h cg_dfn.h cg_print.h \ - corefile.h gmon.h gmon_io.h gmon_out.h gprof.h hertz.h hist.h \ - search_list.h source.h sym_ids.h symtab.h utils.h +noinst_HEADERS = basic_blocks.h call_graph.h cg_arcs.h cg_dfn.h cg_print.h corefile.h gmon.h gmon_io.h gmon_out.h gprof.h hertz.h hist.h search_list.h source.h sym_ids.h symtab.h utils.h -EXTRA_DIST = flat_bl.c bsd_callg_bl.c fsf_callg_bl.c bbconv.pl - BUILT_SOURCES = flat_bl.c bsd_callg_bl.c fsf_callg_bl.c +EXTRA_DIST = $(BUILT_SOURCES) bbconv.pl $(man_MANS) POTFILES = $(sources) $(noinst_HEADERS) +MANCONF = -Dman + +TEXI2POD = perl $(srcdir)/../etc/texi2pod.pl + +POD2MAN = pod2man --center="GNU" --release="binutils-$(VERSION)" --section=1 + info_TEXINFOS = gprof.texi man_MANS = gprof.1 @@ -162,8 +161,8 @@ cg_arcs.$(OBJEXT) cg_dfn.$(OBJEXT) cg_print.$(OBJEXT) \ corefile.$(OBJEXT) gmon_io.$(OBJEXT) gprof.$(OBJEXT) hertz.$(OBJEXT) \ hist.$(OBJEXT) source.$(OBJEXT) search_list.$(OBJEXT) symtab.$(OBJEXT) \ sym_ids.$(OBJEXT) utils.$(OBJEXT) i386.$(OBJEXT) alpha.$(OBJEXT) \ -vax.$(OBJEXT) tahoe.$(OBJEXT) sparc.$(OBJEXT) flat_bl.$(OBJEXT) \ -bsd_callg_bl.$(OBJEXT) fsf_callg_bl.$(OBJEXT) +vax.$(OBJEXT) tahoe.$(OBJEXT) sparc.$(OBJEXT) mips.$(OBJEXT) \ +flat_bl.$(OBJEXT) bsd_callg_bl.$(OBJEXT) fsf_callg_bl.$(OBJEXT) gprof_LDFLAGS = CFLAGS = @CFLAGS@ COMPILE = $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) @@ -181,16 +180,12 @@ MANS = $(man_MANS) NROFF = nroff HEADERS = $(noinst_HEADERS) -DIST_COMMON = ./stamp-h.in ChangeLog Makefile.am Makefile.in TODO \ -acconfig.h acinclude.m4 aclocal.m4 configure configure.in gconfig.in +DIST_COMMON = README ./stamp-h.in ChangeLog Makefile.am Makefile.in \ +TODO acinclude.m4 aclocal.m4 configure configure.in gconfig.in DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST) -# Target to use for installing unformatted man-pages. Some systems may not -# want them installed. -INSTALL_MAN = install-man - TAR = tar GZIP_ENV = --best SOURCES = $(gprof_SOURCES) @@ -229,7 +224,7 @@ $(srcdir)/gconfig.in: @MAINTAINER_MODE_TRUE@$(srcdir)/stamp-h.in rm -f $(srcdir)/stamp-h.in; \ $(MAKE) $(srcdir)/stamp-h.in; \ else :; fi -$(srcdir)/stamp-h.in: $(top_srcdir)/configure.in $(ACLOCAL_M4) acconfig.h +$(srcdir)/stamp-h.in: $(top_srcdir)/configure.in $(ACLOCAL_M4) cd $(top_srcdir) && $(AUTOHEADER) @echo timestamp > $(srcdir)/stamp-h.in 2> /dev/null @@ -388,7 +383,7 @@ uninstall-info: else ii=; fi; \ list='$(INFO_DEPS)'; \ for file in $$list; do \ - test -z "$ii" \ + test -z "$$ii" \ || install-info --info-dir=$(DESTDIR)$(infodir) --remove $$file; \ done @$(NORMAL_UNINSTALL) @@ -502,7 +497,7 @@ maintainer-clean-recursive: dot_seen=no; \ rev=''; list='$(SUBDIRS)'; for subdir in $$list; do \ rev="$$subdir $$rev"; \ - test "$$subdir" = "." && dot_seen=yes; \ + test "$$subdir" != "." || dot_seen=yes; \ true; \ done; \ test "$$dot_seen" = "no" && rev=". $$rev"; \ @@ -631,7 +626,7 @@ all-recursive-am: gconfig.h install-exec-am: install-binPROGRAMS install-exec: install-exec-recursive -install-data-am: $(INSTALL_MAN) +install-data-am: install-man install-data: install-data-recursive install-am: all-am @@ -711,7 +706,7 @@ distclean-generic clean-generic maintainer-clean-generic clean \ mostlyclean distclean maintainer-clean -diststuff: $(BUILT_SOURCES) info +diststuff: $(BUILT_SOURCES) info $(man_MANS) .m.c: awk -f $(srcdir)/gen-c-prog.awk > ./$*.c \ @@ -721,6 +716,24 @@ po/POTFILES.in: @MAINT@ Makefile for file in $(POTFILES); do echo $$file; done | sort > tmp \ && mv tmp $(srcdir)/po/POTFILES.in +# Build the man page from the texinfo file +# The sed command removes the no-adjust Nroff command so that +# the man output looks standard. +gprof.1: $(srcdir)/gprof.texi + touch $@ + -$(TEXI2POD) $(MANCONF) -Dgprof < $(srcdir)/gprof.texi > gprof.pod + -($(POD2MAN) gprof.pod | \ + sed -e '/^.if n .na/d' > $@.T$$$$ && \ + mv -f $@.T$$$$ $@) || \ + (rm -f $@.T$$$$ && exit 1) + rm -f gprof.pod + +Makefile: $(BFDDIR)/configure.in + +# We want install to imply install-info as per GNU standards, despite the +# cygnus option. +install: install-info + # Targets to rebuild dependencies in this Makefile. # Have to get rid of DEP1 here so that "$?" later includes all sources. DEP: dep.sed $(gprof_SOURCES) $(noinst_HEADERS) gconfig.h @@ -746,7 +759,8 @@ dep.sed: dep-in.sed config.status -e 's!@INCDIR@!$(INCDIR)!' \ -e 's!@BFDDIR@!$(BFDDIR)!' \ -e 's!@SRCDIR@!$(srcdir)!' \ - -e "s!@OBJDIR@!$${objdir}!" + -e "s!@OBJDIR@!$${objdir}!" \ + -e 's!@TOPDIR@!'`echo $(srcdir) | sed -e s,/gprof$$,,`'!' dep: DEP sed -e '/^..DO NOT DELETE THIS LINE/,$$d' < Makefile > tmp-Makefile @@ -767,101 +781,116 @@ dep-am: DEP # DO NOT DELETE THIS LINE -- mkdep uses it. # DO NOT PUT ANYTHING AFTER THIS LINE, IT WILL GO AWAY. -basic_blocks.o: basic_blocks.c basic_blocks.h gprof.h \ - $(INCDIR)/ansidecl.h $(BFDDIR)/sysdep.h ../bfd/config.h \ - $(INCDIR)/fopen-same.h $(INCDIR)/filenames.h gconfig.h \ - $(INCDIR)/bin-bugs.h source.h search_list.h symtab.h \ - ../bfd/bfd.h corefile.h gmon_io.h gmon.h gmon_out.h \ - $(INCDIR)/libiberty.h sym_ids.h -call_graph.o: call_graph.c cg_arcs.h gprof.h $(INCDIR)/ansidecl.h \ - $(BFDDIR)/sysdep.h ../bfd/config.h $(INCDIR)/fopen-same.h \ - $(INCDIR)/filenames.h gconfig.h $(INCDIR)/bin-bugs.h \ - symtab.h ../bfd/bfd.h source.h search_list.h call_graph.h \ - corefile.h gmon_io.h gmon.h gmon_out.h sym_ids.h +basic_blocks.o: basic_blocks.c $(INCDIR)/libiberty.h \ + $(INCDIR)/ansidecl.h gprof.h $(BFDDIR)/sysdep.h ../bfd/config.h \ + $(INCDIR)/fopen-same.h $(INCDIR)/filenames.h ../bfd/bfd.h \ + $(INCDIR)/symcat.h gconfig.h $(INCDIR)/bin-bugs.h basic_blocks.h \ + corefile.h gmon_io.h gmon_out.h search_list.h source.h \ + symtab.h sym_ids.h +call_graph.o: call_graph.c gprof.h $(BFDDIR)/sysdep.h \ + $(INCDIR)/ansidecl.h ../bfd/config.h $(INCDIR)/fopen-same.h \ + $(INCDIR)/filenames.h ../bfd/bfd.h $(INCDIR)/symcat.h \ + gconfig.h $(INCDIR)/bin-bugs.h search_list.h source.h \ + symtab.h cg_arcs.h call_graph.h corefile.h gmon_io.h \ + gmon_out.h sym_ids.h cg_arcs.o: cg_arcs.c $(INCDIR)/libiberty.h $(INCDIR)/ansidecl.h \ gprof.h $(BFDDIR)/sysdep.h ../bfd/config.h $(INCDIR)/fopen-same.h \ - $(INCDIR)/filenames.h gconfig.h $(INCDIR)/bin-bugs.h \ - call_graph.h symtab.h ../bfd/bfd.h source.h search_list.h \ - cg_arcs.h cg_dfn.h cg_print.h utils.h sym_ids.h + $(INCDIR)/filenames.h ../bfd/bfd.h $(INCDIR)/symcat.h \ + gconfig.h $(INCDIR)/bin-bugs.h search_list.h source.h \ + symtab.h call_graph.h cg_arcs.h cg_dfn.h cg_print.h \ + utils.h sym_ids.h cg_dfn.o: cg_dfn.c $(INCDIR)/libiberty.h $(INCDIR)/ansidecl.h \ gprof.h $(BFDDIR)/sysdep.h ../bfd/config.h $(INCDIR)/fopen-same.h \ - $(INCDIR)/filenames.h gconfig.h $(INCDIR)/bin-bugs.h \ - cg_arcs.h symtab.h ../bfd/bfd.h source.h search_list.h \ - cg_dfn.h utils.h + $(INCDIR)/filenames.h ../bfd/bfd.h $(INCDIR)/symcat.h \ + gconfig.h $(INCDIR)/bin-bugs.h search_list.h source.h \ + symtab.h cg_arcs.h cg_dfn.h utils.h cg_print.o: cg_print.c $(INCDIR)/libiberty.h $(INCDIR)/ansidecl.h \ - cg_arcs.h gprof.h $(BFDDIR)/sysdep.h ../bfd/config.h \ - $(INCDIR)/fopen-same.h $(INCDIR)/filenames.h gconfig.h \ - $(INCDIR)/bin-bugs.h symtab.h ../bfd/bfd.h source.h \ - search_list.h cg_print.h hist.h utils.h + gprof.h $(BFDDIR)/sysdep.h ../bfd/config.h $(INCDIR)/fopen-same.h \ + $(INCDIR)/filenames.h ../bfd/bfd.h $(INCDIR)/symcat.h \ + gconfig.h $(INCDIR)/bin-bugs.h search_list.h source.h \ + symtab.h cg_arcs.h cg_print.h hist.h utils.h corefile.h corefile.o: corefile.c $(INCDIR)/libiberty.h $(INCDIR)/ansidecl.h \ gprof.h $(BFDDIR)/sysdep.h ../bfd/config.h $(INCDIR)/fopen-same.h \ - $(INCDIR)/filenames.h gconfig.h $(INCDIR)/bin-bugs.h \ - corefile.h ../bfd/bfd.h symtab.h source.h search_list.h -gmon_io.o: gmon_io.c cg_arcs.h gprof.h $(INCDIR)/ansidecl.h \ - $(BFDDIR)/sysdep.h ../bfd/config.h $(INCDIR)/fopen-same.h \ - $(INCDIR)/filenames.h gconfig.h $(INCDIR)/bin-bugs.h \ - symtab.h ../bfd/bfd.h source.h search_list.h basic_blocks.h \ - corefile.h call_graph.h gmon_io.h gmon.h gmon_out.h \ + $(INCDIR)/filenames.h ../bfd/bfd.h $(INCDIR)/symcat.h \ + gconfig.h $(INCDIR)/bin-bugs.h search_list.h source.h \ + symtab.h corefile.h +gmon_io.o: gmon_io.c gprof.h $(BFDDIR)/sysdep.h $(INCDIR)/ansidecl.h \ + ../bfd/config.h $(INCDIR)/fopen-same.h $(INCDIR)/filenames.h \ + ../bfd/bfd.h $(INCDIR)/symcat.h gconfig.h $(INCDIR)/bin-bugs.h \ + search_list.h source.h symtab.h cg_arcs.h basic_blocks.h \ + corefile.h call_graph.h gmon_io.h gmon_out.h gmon.h \ hertz.h hist.h $(INCDIR)/libiberty.h -gprof.o: gprof.c $(INCDIR)/getopt.h $(INCDIR)/libiberty.h \ - $(INCDIR)/ansidecl.h gprof.h $(BFDDIR)/sysdep.h ../bfd/config.h \ - $(INCDIR)/fopen-same.h $(INCDIR)/filenames.h gconfig.h \ - $(INCDIR)/bin-bugs.h basic_blocks.h source.h search_list.h \ - symtab.h ../bfd/bfd.h call_graph.h cg_arcs.h cg_print.h \ - corefile.h gmon_io.h gmon.h hertz.h hist.h sym_ids.h \ - $(INCDIR)/demangle.h -hertz.o: hertz.c hertz.h gprof.h $(INCDIR)/ansidecl.h \ - $(BFDDIR)/sysdep.h ../bfd/config.h $(INCDIR)/fopen-same.h \ - $(INCDIR)/filenames.h gconfig.h $(INCDIR)/bin-bugs.h +gprof.o: gprof.c $(INCDIR)/libiberty.h $(INCDIR)/ansidecl.h \ + gprof.h $(BFDDIR)/sysdep.h ../bfd/config.h $(INCDIR)/fopen-same.h \ + $(INCDIR)/filenames.h ../bfd/bfd.h $(INCDIR)/symcat.h \ + gconfig.h $(INCDIR)/bin-bugs.h search_list.h source.h \ + symtab.h basic_blocks.h call_graph.h cg_arcs.h cg_print.h \ + corefile.h gmon_io.h hertz.h hist.h sym_ids.h $(INCDIR)/demangle.h +hertz.o: hertz.c gprof.h $(BFDDIR)/sysdep.h $(INCDIR)/ansidecl.h \ + ../bfd/config.h $(INCDIR)/fopen-same.h $(INCDIR)/filenames.h \ + ../bfd/bfd.h $(INCDIR)/symcat.h gconfig.h $(INCDIR)/bin-bugs.h \ + hertz.h hist.o: hist.c $(INCDIR)/libiberty.h $(INCDIR)/ansidecl.h \ gprof.h $(BFDDIR)/sysdep.h ../bfd/config.h $(INCDIR)/fopen-same.h \ - $(INCDIR)/filenames.h gconfig.h $(INCDIR)/bin-bugs.h \ - corefile.h ../bfd/bfd.h gmon_io.h gmon.h gmon_out.h \ - hist.h symtab.h source.h search_list.h sym_ids.h utils.h -source.o: source.c gprof.h $(INCDIR)/ansidecl.h $(BFDDIR)/sysdep.h \ + $(INCDIR)/filenames.h ../bfd/bfd.h $(INCDIR)/symcat.h \ + gconfig.h $(INCDIR)/bin-bugs.h search_list.h source.h \ + symtab.h corefile.h gmon_io.h gmon_out.h hist.h sym_ids.h \ + utils.h +source.o: source.c gprof.h $(BFDDIR)/sysdep.h $(INCDIR)/ansidecl.h \ ../bfd/config.h $(INCDIR)/fopen-same.h $(INCDIR)/filenames.h \ - gconfig.h $(INCDIR)/bin-bugs.h $(INCDIR)/libiberty.h \ - search_list.h source.h + ../bfd/bfd.h $(INCDIR)/symcat.h gconfig.h $(INCDIR)/bin-bugs.h \ + $(INCDIR)/libiberty.h search_list.h source.h search_list.o: search_list.c $(INCDIR)/libiberty.h \ $(INCDIR)/ansidecl.h gprof.h $(BFDDIR)/sysdep.h ../bfd/config.h \ - $(INCDIR)/fopen-same.h $(INCDIR)/filenames.h gconfig.h \ - $(INCDIR)/bin-bugs.h search_list.h -symtab.o: symtab.c gprof.h $(INCDIR)/ansidecl.h $(BFDDIR)/sysdep.h \ + $(INCDIR)/fopen-same.h $(INCDIR)/filenames.h ../bfd/bfd.h \ + $(INCDIR)/symcat.h gconfig.h $(INCDIR)/bin-bugs.h search_list.h +symtab.o: symtab.c gprof.h $(BFDDIR)/sysdep.h $(INCDIR)/ansidecl.h \ ../bfd/config.h $(INCDIR)/fopen-same.h $(INCDIR)/filenames.h \ - gconfig.h $(INCDIR)/bin-bugs.h cg_arcs.h symtab.h ../bfd/bfd.h \ - source.h search_list.h corefile.h + ../bfd/bfd.h $(INCDIR)/symcat.h gconfig.h $(INCDIR)/bin-bugs.h \ + search_list.h source.h symtab.h cg_arcs.h corefile.h sym_ids.o: sym_ids.c $(INCDIR)/libiberty.h $(INCDIR)/ansidecl.h \ - cg_arcs.h gprof.h $(BFDDIR)/sysdep.h ../bfd/config.h \ - $(INCDIR)/fopen-same.h $(INCDIR)/filenames.h gconfig.h \ - $(INCDIR)/bin-bugs.h symtab.h ../bfd/bfd.h source.h \ - search_list.h sym_ids.h -utils.o: utils.c gprof.h $(BFDDIR)/sysdep.h ../bfd/config.h \ - $(INCDIR)/fopen-same.h $(INCDIR)/filenames.h gconfig.h \ - $(INCDIR)/bin-bugs.h cg_arcs.h symtab.h ../bfd/bfd.h \ - source.h search_list.h -i386.o: i386.c gprof.h $(INCDIR)/ansidecl.h $(BFDDIR)/sysdep.h \ + $(INCDIR)/safe-ctype.h gprof.h $(BFDDIR)/sysdep.h ../bfd/config.h \ + $(INCDIR)/fopen-same.h $(INCDIR)/filenames.h ../bfd/bfd.h \ + $(INCDIR)/symcat.h gconfig.h $(INCDIR)/bin-bugs.h search_list.h \ + source.h symtab.h cg_arcs.h sym_ids.h +utils.o: utils.c $(INCDIR)/demangle.h $(INCDIR)/ansidecl.h \ + gprof.h $(BFDDIR)/sysdep.h ../bfd/config.h $(INCDIR)/fopen-same.h \ + $(INCDIR)/filenames.h ../bfd/bfd.h $(INCDIR)/symcat.h \ + gconfig.h $(INCDIR)/bin-bugs.h search_list.h source.h \ + symtab.h cg_arcs.h utils.h +i386.o: i386.c gprof.h $(BFDDIR)/sysdep.h $(INCDIR)/ansidecl.h \ + ../bfd/config.h $(INCDIR)/fopen-same.h $(INCDIR)/filenames.h \ + ../bfd/bfd.h $(INCDIR)/symcat.h gconfig.h $(INCDIR)/bin-bugs.h \ + search_list.h source.h symtab.h cg_arcs.h corefile.h \ + hist.h +alpha.o: alpha.c gprof.h $(BFDDIR)/sysdep.h $(INCDIR)/ansidecl.h \ ../bfd/config.h $(INCDIR)/fopen-same.h $(INCDIR)/filenames.h \ - gconfig.h $(INCDIR)/bin-bugs.h cg_arcs.h symtab.h ../bfd/bfd.h \ - source.h search_list.h corefile.h hist.h -alpha.o: alpha.c gprof.h $(INCDIR)/ansidecl.h $(BFDDIR)/sysdep.h \ + ../bfd/bfd.h $(INCDIR)/symcat.h gconfig.h $(INCDIR)/bin-bugs.h \ + search_list.h source.h symtab.h cg_arcs.h corefile.h \ + hist.h +vax.o: vax.c gprof.h $(BFDDIR)/sysdep.h $(INCDIR)/ansidecl.h \ ../bfd/config.h $(INCDIR)/fopen-same.h $(INCDIR)/filenames.h \ - gconfig.h $(INCDIR)/bin-bugs.h cg_arcs.h symtab.h ../bfd/bfd.h \ - source.h search_list.h corefile.h hist.h -vax.o: vax.c gprof.h $(INCDIR)/ansidecl.h $(BFDDIR)/sysdep.h \ + ../bfd/bfd.h $(INCDIR)/symcat.h gconfig.h $(INCDIR)/bin-bugs.h \ + search_list.h source.h symtab.h cg_arcs.h corefile.h \ + hist.h +tahoe.o: tahoe.c gprof.h $(BFDDIR)/sysdep.h $(INCDIR)/ansidecl.h \ ../bfd/config.h $(INCDIR)/fopen-same.h $(INCDIR)/filenames.h \ - gconfig.h $(INCDIR)/bin-bugs.h cg_arcs.h symtab.h ../bfd/bfd.h \ - source.h search_list.h corefile.h hist.h -tahoe.o: tahoe.c gprof.h $(INCDIR)/ansidecl.h $(BFDDIR)/sysdep.h \ + ../bfd/bfd.h $(INCDIR)/symcat.h gconfig.h $(INCDIR)/bin-bugs.h \ + search_list.h source.h symtab.h cg_arcs.h corefile.h \ + hist.h +sparc.o: sparc.c gprof.h $(BFDDIR)/sysdep.h $(INCDIR)/ansidecl.h \ ../bfd/config.h $(INCDIR)/fopen-same.h $(INCDIR)/filenames.h \ - gconfig.h $(INCDIR)/bin-bugs.h cg_arcs.h symtab.h ../bfd/bfd.h \ - source.h search_list.h corefile.h hist.h -sparc.o: sparc.c gprof.h $(INCDIR)/ansidecl.h $(BFDDIR)/sysdep.h \ + ../bfd/bfd.h $(INCDIR)/symcat.h gconfig.h $(INCDIR)/bin-bugs.h \ + search_list.h source.h symtab.h cg_arcs.h corefile.h \ + hist.h +mips.o: mips.c gprof.h $(BFDDIR)/sysdep.h $(INCDIR)/ansidecl.h \ ../bfd/config.h $(INCDIR)/fopen-same.h $(INCDIR)/filenames.h \ - gconfig.h $(INCDIR)/bin-bugs.h cg_arcs.h symtab.h ../bfd/bfd.h \ - source.h search_list.h corefile.h hist.h -flat_bl.o: flat_bl.c -bsd_callg_bl.o: bsd_callg_bl.c -fsf_callg_bl.o: fsf_callg_bl.c + ../bfd/bfd.h $(INCDIR)/symcat.h gconfig.h $(INCDIR)/bin-bugs.h \ + search_list.h source.h symtab.h cg_arcs.h corefile.h \ + hist.h +flat_bl.o: flat_bl.c $(INCDIR)/ansidecl.h +bsd_callg_bl.o: bsd_callg_bl.c $(INCDIR)/ansidecl.h +fsf_callg_bl.o: fsf_callg_bl.c $(INCDIR)/ansidecl.h # IF YOU PUT ANYTHING HERE IT WILL GO AWAY # Tell versions [3.59,3.63) of GNU make to not export all variables. diff --git a/gnu/usr.bin/binutils/gprof/TODO b/gnu/usr.bin/binutils/gprof/TODO index 20111c61e74..324983861c7 100644 --- a/gnu/usr.bin/binutils/gprof/TODO +++ b/gnu/usr.bin/binutils/gprof/TODO @@ -1,7 +1,4 @@ -- gmon_io.c cannot deal with target architecture that have a pointer size - that is different from the host architectures pointer size---fix this - (gmon_out.h, and gmon_io.c) - add support for prof file format so that prof files can be displayed at the line-level (this is useful for the uprofile tool under DEC's OSF/1) diff --git a/gnu/usr.bin/binutils/gprof/alpha.c b/gnu/usr.bin/binutils/gprof/alpha.c index 95a13d49b74..5fc9b774213 100644 --- a/gnu/usr.bin/binutils/gprof/alpha.c +++ b/gnu/usr.bin/binutils/gprof/alpha.c @@ -27,10 +27,12 @@ * SUCH DAMAGE. */ #include "gprof.h" +#include "search_list.h" +#include "source.h" +#include "symtab.h" #include "cg_arcs.h" #include "corefile.h" #include "hist.h" -#include "symtab.h" /* * Opcodes of the call instructions: @@ -43,6 +45,9 @@ #define Jxx_FUNC_RET 2 #define Jxx_FUNC_JSR_COROUTINE 3 +#if 0 +/* Here to document only. We can't use this when cross compiling as + the bitfield layout might not be the same as native. */ typedef union { struct @@ -69,9 +74,11 @@ typedef union j; /* jump format */ } alpha_Instruction; +#endif static Sym indirect_child; +void alpha_find_call PARAMS ((Sym *, bfd_vma, bfd_vma)); /* * On the Alpha we can only detect PC relative calls, which are @@ -86,15 +93,12 @@ alpha_find_call (parent, p_lowpc, p_highpc) bfd_vma p_lowpc; bfd_vma p_highpc; { - static bfd_vma delta = 0; - bfd_vma dest_pc; - alpha_Instruction *pc; + bfd_vma pc, dest_pc; + unsigned int insn; Sym *child; - if (!delta) + if (indirect_child.name == NULL) { - delta = (bfd_vma) core_text_space - core_text_sect->vma; - sym_init (&indirect_child); indirect_child.name = _("<indirect child>"); indirect_child.cg.prop.fract = 1.0; @@ -116,13 +120,13 @@ alpha_find_call (parent, p_lowpc, p_highpc) DBG (CALLDEBUG, printf (_("[find_call] %s: 0x%lx to 0x%lx\n"), parent->name, (unsigned long) p_lowpc, (unsigned long) p_highpc)); - for (pc = (alpha_Instruction *) (p_lowpc + delta); - pc < (alpha_Instruction *) (p_highpc + delta); - ++pc) + for (pc = (p_lowpc + 3) & ~(bfd_vma) 3; pc < p_highpc; pc += 4) { - switch (pc->a.op_code) + insn = bfd_get_32 (core_bfd, ((unsigned char *) core_text_space + + pc - core_text_sect->vma)); + switch (insn & (0x3f << 26)) { - case OP_Jxx: + case OP_Jxx << 26: /* * There is no simple and reliable way to determine the * target of a jsr (the hint bits help, but there aren't @@ -131,28 +135,29 @@ alpha_find_call (parent, p_lowpc, p_highpc) * to INDIRECT_CHILD---that way the user it at least able * to see that there are other calls as well. */ - if (pc->j.func == Jxx_FUNC_JSR - || pc->j.func == Jxx_FUNC_JSR_COROUTINE) + if ((insn & (3 << 14)) == Jxx_FUNC_JSR << 14 + || (insn & (3 << 14)) == Jxx_FUNC_JSR_COROUTINE << 14) { DBG (CALLDEBUG, printf (_("[find_call] 0x%lx: jsr%s <indirect_child>\n"), - (unsigned long) pc - delta, - pc->j.func == Jxx_FUNC_JSR ? "" : "_coroutine")); + (unsigned long) pc, + ((insn & (3 << 14)) == Jxx_FUNC_JSR << 14 + ? "" : "_coroutine"))); arc_add (parent, &indirect_child, (unsigned long) 0); } break; - case OP_BSR: + case OP_BSR << 26: DBG (CALLDEBUG, - printf (_("[find_call] 0x%lx: bsr"), - (unsigned long) pc - delta)); + printf (_("[find_call] 0x%lx: bsr"), (unsigned long) pc)); /* * Regular PC relative addressing. Check that this is the * address of a function. The linker sometimes redirects * the entry point by 8 bytes to skip loading the global - * pointer, so we all for either address: + * pointer, so we allow for either address: */ - dest_pc = ((bfd_vma) (pc + 1 + pc->b.disp)) - delta; + dest_pc = pc + 4 + (((bfd_signed_vma) (insn & 0x1fffff) + ^ 0x100000) - 0x100000); if (dest_pc >= s_lowpc && dest_pc <= s_highpc) { child = sym_lookup (&symtab, dest_pc); diff --git a/gnu/usr.bin/binutils/gprof/basic_blocks.c b/gnu/usr.bin/binutils/gprof/basic_blocks.c index 8f560b4b2f6..a37ca0b2441 100644 --- a/gnu/usr.bin/binutils/gprof/basic_blocks.c +++ b/gnu/usr.bin/binutils/gprof/basic_blocks.c @@ -2,7 +2,7 @@ of basic-block info to/from gmon.out; computing and formatting of basic-block related statistics. - Copyright 2000, 2001 Free Software Foundation, Inc. + Copyright 2000, 2001, 2002 Free Software Foundation, Inc. This file is part of GNU Binutils. @@ -21,21 +21,24 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include <stdio.h> +#include "libiberty.h" +#include "gprof.h" #include "basic_blocks.h" #include "corefile.h" #include "gmon_io.h" #include "gmon_out.h" -#include "gprof.h" -#include "libiberty.h" +#include "search_list.h" #include "source.h" +#include "symtab.h" #include "sym_ids.h" -#ifdef HAVE_UNISTD_H -#include <unistd.h> -#endif + +static int cmp_bb PARAMS ((const PTR, const PTR)); +static int cmp_ncalls PARAMS ((const PTR, const PTR)); +static void fskip_string PARAMS ((FILE *)); +static void annotate_with_count PARAMS ((char *, unsigned int, int, PTR)); /* Default option values: */ -bool bb_annotate_all_lines = FALSE; +bfd_boolean bb_annotate_all_lines = FALSE; unsigned long bb_min_calls = 1; int bb_table_length = 10; @@ -49,7 +52,9 @@ static long num_lines_executed; number, and address (in that order). */ static int -DEFUN (cmp_bb, (lp, rp), const void *lp AND const void *rp) +cmp_bb (lp, rp) + const PTR lp; + const PTR rp; { int r; const Sym *left = *(const Sym **) lp; @@ -78,7 +83,9 @@ DEFUN (cmp_bb, (lp, rp), const void *lp AND const void *rp) /* Helper for sorting. Order basic blocks in decreasing number of calls, ties are broken in increasing order of line numbers. */ static int -DEFUN (cmp_ncalls, (lp, rp), const void *lp AND const void *rp) +cmp_ncalls (lp, rp) + const PTR lp; + const PTR rp; { const Sym *left = *(const Sym **) lp; const Sym *right = *(const Sym **) rp; @@ -98,7 +105,8 @@ DEFUN (cmp_ncalls, (lp, rp), const void *lp AND const void *rp) /* Skip over variable length string. */ static void -DEFUN (fskip_string, (fp), FILE * fp) +fskip_string (fp) + FILE *fp; { int ch; @@ -113,7 +121,9 @@ DEFUN (fskip_string, (fp), FILE * fp) of file IFP and is provided for formatting error-messages only. */ void -DEFUN (bb_read_rec, (ifp, filename), FILE * ifp AND const char *filename) +bb_read_rec (ifp, filename) + FILE *ifp; + const char *filename; { int nblocks, b; bfd_vma addr, ncalls; @@ -183,7 +193,7 @@ DEFUN (bb_read_rec, (ifp, filename), FILE * ifp AND const char *filename) } else { - static bool user_warned = FALSE; + static bfd_boolean user_warned = FALSE; if (!user_warned) { @@ -201,9 +211,11 @@ DEFUN (bb_read_rec, (ifp, filename), FILE * ifp AND const char *filename) is the name of OFP and is provided for producing error-messages only. */ void -DEFUN (bb_write_blocks, (ofp, filename), FILE * ofp AND const char *filename) +bb_write_blocks (ofp, filename) + FILE *ofp; + const char *filename; { - int nblocks = 0; + unsigned int nblocks = 0; Sym *sym; int i; @@ -229,7 +241,7 @@ DEFUN (bb_write_blocks, (ofp, filename), FILE * ofp AND const char *filename) for (i = 0; i < NBBS && sym->bb_addr[i]; i++) { if (gmon_io_write_vma (ofp, sym->bb_addr[i]) - || gmon_io_write_vma (ofp, sym->bb_calls[i])) + || gmon_io_write_vma (ofp, (bfd_vma) sym->bb_calls[i])) { perror (filename); done (1); @@ -244,10 +256,10 @@ DEFUN (bb_write_blocks, (ofp, filename), FILE * ofp AND const char *filename) <filename>:<line-number>: (<function-name>:<bb-addr): <ncalls> */ void -DEFUN_VOID (print_exec_counts) +print_exec_counts () { Sym **sorted_bbs, *sym; - int i, j, len; + unsigned int i, j, len; if (first_output) first_output = FALSE; @@ -311,12 +323,15 @@ DEFUN_VOID (print_exec_counts) that starts the basic-block. */ static void -DEFUN (annotate_with_count, (buf, width, line_num, arg), - char *buf AND int width AND int line_num AND void *arg) +annotate_with_count (buf, width, line_num, arg) + char *buf; + unsigned int width; + int line_num; + PTR arg; { Source_File *sf = arg; Sym *b; - int i; + unsigned int i; static unsigned long last_count; unsigned long last_print = (unsigned long) -1; @@ -337,7 +352,7 @@ DEFUN (annotate_with_count, (buf, width, line_num, arg), char *p; unsigned long ncalls; int ncalls_set; - int len; + unsigned int len; ++num_executable_lines; @@ -413,7 +428,7 @@ DEFUN (annotate_with_count, (buf, width, line_num, arg), if (! ncalls_set) { - int c; + unsigned int c; for (c = 0; c < width; c++) buf[c] = ' '; @@ -440,7 +455,7 @@ DEFUN (annotate_with_count, (buf, width, line_num, arg), } else { - int c; + unsigned int c; strcpy (buf + width - len, tmpbuf); for (c = 0; c < width - len; ++c) @@ -454,7 +469,7 @@ DEFUN (annotate_with_count, (buf, width, line_num, arg), regarding that source file are printed. */ void -DEFUN_VOID (print_annotated_source) +print_annotated_source () { Sym *sym, *line_stats, *new_line; Source_File *sf; diff --git a/gnu/usr.bin/binutils/gprof/basic_blocks.h b/gnu/usr.bin/binutils/gprof/basic_blocks.h index 3e85bc2d6bc..4308a792595 100644 --- a/gnu/usr.bin/binutils/gprof/basic_blocks.h +++ b/gnu/usr.bin/binutils/gprof/basic_blocks.h @@ -1,5 +1,5 @@ /* basic_blocks.h - Copyright 2000 Free Software Foundation, Inc. + Copyright 2000, 2002 Free Software Foundation, Inc. This file is part of GNU Binutils. @@ -20,13 +20,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef basic_blocks_h #define basic_blocks_h -#include <stdio.h> -#include "gprof.h" -#include "source.h" -#include "symtab.h" - /* Options: */ -extern bool bb_annotate_all_lines; /* Force annotation of all lines? */ +extern bfd_boolean bb_annotate_all_lines; /* Force annotation of all lines? */ extern int bb_table_length; /* Length of most-used bb table. */ extern unsigned long bb_min_calls; /* Minimum execution count. */ diff --git a/gnu/usr.bin/binutils/gprof/call_graph.c b/gnu/usr.bin/binutils/gprof/call_graph.c index a09938d103b..e798a0e1897 100644 --- a/gnu/usr.bin/binutils/gprof/call_graph.c +++ b/gnu/usr.bin/binutils/gprof/call_graph.c @@ -1,6 +1,6 @@ /* call_graph.c - Create call graphs. - Copyright 2000, 2001 Free Software Foundation, Inc. + Copyright 2000, 2001, 2002 Free Software Foundation, Inc. This file is part of GNU Binutils. @@ -19,17 +19,22 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ +#include "gprof.h" +#include "search_list.h" +#include "source.h" +#include "symtab.h" #include "cg_arcs.h" #include "call_graph.h" #include "corefile.h" #include "gmon_io.h" #include "gmon_out.h" -#include "symtab.h" #include "sym_ids.h" -extern void -DEFUN (cg_tally, (from_pc, self_pc, count), - bfd_vma from_pc AND bfd_vma self_pc AND unsigned long count) +void +cg_tally (from_pc, self_pc, count) + bfd_vma from_pc; + bfd_vma self_pc; + unsigned long count; { Sym *parent; Sym *child; @@ -75,7 +80,9 @@ DEFUN (cg_tally, (from_pc, self_pc, count), for formatting error-messages only. */ void -DEFUN (cg_read_rec, (ifp, filename), FILE * ifp AND CONST char *filename) +cg_read_rec (ifp, filename) + FILE *ifp; + const char *filename; { bfd_vma from_pc, self_pc; unsigned int count; @@ -102,7 +109,9 @@ DEFUN (cg_read_rec, (ifp, filename), FILE * ifp AND CONST char *filename) only. */ void -DEFUN (cg_write_arcs, (ofp, filename), FILE * ofp AND const char *filename) +cg_write_arcs (ofp, filename) + FILE *ofp; + const char *filename; { Arc *arc; Sym *sym; diff --git a/gnu/usr.bin/binutils/gprof/call_graph.h b/gnu/usr.bin/binutils/gprof/call_graph.h index ffa269df96a..233dd701ecb 100644 --- a/gnu/usr.bin/binutils/gprof/call_graph.h +++ b/gnu/usr.bin/binutils/gprof/call_graph.h @@ -21,10 +21,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef call_graph_h #define call_graph_h -#include <stdio.h> -#include "gprof.h" -#include "symtab.h" - extern void cg_tally PARAMS ((bfd_vma, bfd_vma, unsigned long)); extern void cg_read_rec PARAMS ((FILE *, const char *)); extern void cg_write_arcs PARAMS ((FILE *, const char *)); diff --git a/gnu/usr.bin/binutils/gprof/cg_arcs.c b/gnu/usr.bin/binutils/gprof/cg_arcs.c index a7c13d2a22d..cea21cf5053 100644 --- a/gnu/usr.bin/binutils/gprof/cg_arcs.c +++ b/gnu/usr.bin/binutils/gprof/cg_arcs.c @@ -28,6 +28,9 @@ */ #include "libiberty.h" #include "gprof.h" +#include "search_list.h" +#include "source.h" +#include "symtab.h" #include "call_graph.h" #include "cg_arcs.h" #include "cg_dfn.h" @@ -35,6 +38,14 @@ #include "utils.h" #include "sym_ids.h" +static int cmp_topo PARAMS ((const PTR, const PTR)); +static void propagate_time PARAMS ((Sym *)); +static void cycle_time PARAMS ((void)); +static void cycle_link PARAMS ((void)); +static void inherit_flags PARAMS ((Sym *)); +static void propagate_flags PARAMS ((Sym **)); +static int cmp_total PARAMS ((const PTR, const PTR)); + Sym *cycle_header; unsigned int num_cycles; Arc **arcs; @@ -45,7 +56,9 @@ unsigned int numarcs; * range covered by CHILD. */ Arc * -DEFUN (arc_lookup, (parent, child), Sym * parent AND Sym * child) +arc_lookup (parent, child) + Sym *parent; + Sym *child; { Arc *arc; @@ -74,8 +87,10 @@ DEFUN (arc_lookup, (parent, child), Sym * parent AND Sym * child) * Add (or just increment) an arc: */ void -DEFUN (arc_add, (parent, child, count), - Sym * parent AND Sym * child AND unsigned long count) +arc_add (parent, child, count) + Sym *parent; + Sym *child; + unsigned long count; { static unsigned int maxarcs = 0; Arc *arc, **newarcs; @@ -141,7 +156,9 @@ DEFUN (arc_add, (parent, child, count), static int -DEFUN (cmp_topo, (lp, rp), const PTR lp AND const PTR rp) +cmp_topo (lp, rp) + const PTR lp; + const PTR rp; { const Sym *left = *(const Sym **) lp; const Sym *right = *(const Sym **) rp; @@ -151,7 +168,8 @@ DEFUN (cmp_topo, (lp, rp), const PTR lp AND const PTR rp) static void -DEFUN (propagate_time, (parent), Sym * parent) +propagate_time (parent) + Sym *parent; { Arc *arc; Sym *child; @@ -235,7 +253,7 @@ DEFUN (propagate_time, (parent), Sym * parent) * its members. */ static void -DEFUN_VOID (cycle_time) +cycle_time () { Sym *member, *cyc; @@ -259,7 +277,7 @@ DEFUN_VOID (cycle_time) static void -DEFUN_VOID (cycle_link) +cycle_link () { Sym *sym, *cyc, *member; Arc *arc; @@ -347,7 +365,8 @@ DEFUN_VOID (cycle_link) * fractions from parents. */ static void -DEFUN (inherit_flags, (child), Sym * child) +inherit_flags (child) + Sym *child; { Sym *head, *parent, *member; Arc *arc; @@ -425,7 +444,8 @@ DEFUN (inherit_flags, (child), Sym * child) * and while we're here, sum time for functions. */ static void -DEFUN (propagate_flags, (symbols), Sym ** symbols) +propagate_flags (symbols) + Sym **symbols; { int index; Sym *old_head, *child; @@ -525,7 +545,9 @@ DEFUN (propagate_flags, (symbols), Sym ** symbols) * first. All else being equal, compare by names. */ static int -DEFUN (cmp_total, (lp, rp), const PTR lp AND const PTR rp) +cmp_total (lp, rp) + const PTR lp; + const PTR rp; { const Sym *left = *(const Sym **) lp; const Sym *right = *(const Sym **) rp; @@ -582,7 +604,7 @@ DEFUN (cmp_total, (lp, rp), const PTR lp AND const PTR rp) * time bottom up and flags top down. */ Sym ** -DEFUN_VOID (cg_assemble) +cg_assemble () { Sym *parent, **time_sorted_syms, **top_sorted_syms; unsigned int index; diff --git a/gnu/usr.bin/binutils/gprof/cg_arcs.h b/gnu/usr.bin/binutils/gprof/cg_arcs.h index caa0197a2bb..0364eefa2e9 100644 --- a/gnu/usr.bin/binutils/gprof/cg_arcs.h +++ b/gnu/usr.bin/binutils/gprof/cg_arcs.h @@ -1,9 +1,6 @@ #ifndef cg_arcs_h #define cg_arcs_h -#include "gprof.h" -#include "symtab.h" - /* * Arc structure for call-graph. * diff --git a/gnu/usr.bin/binutils/gprof/cg_dfn.c b/gnu/usr.bin/binutils/gprof/cg_dfn.c index 83b2a083ce8..5c8b5ec745e 100644 --- a/gnu/usr.bin/binutils/gprof/cg_dfn.c +++ b/gnu/usr.bin/binutils/gprof/cg_dfn.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 1983, 1993, 2001 + * Copyright (c) 1983, 1993 * The Regents of the University of California. All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -26,12 +26,13 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ -#include <stdio.h> #include "libiberty.h" #include "gprof.h" +#include "search_list.h" +#include "source.h" +#include "symtab.h" #include "cg_arcs.h" #include "cg_dfn.h" -#include "symtab.h" #include "utils.h" #define DFN_INCR_DEPTH (128) @@ -43,6 +44,12 @@ typedef struct } DFN_Stack; +static bfd_boolean is_numbered PARAMS ((Sym *)); +static bfd_boolean is_busy PARAMS ((Sym *)); +static void find_cycle PARAMS ((Sym *)); +static void pre_visit PARAMS ((Sym *)); +static void post_visit PARAMS ((Sym *)); + DFN_Stack *dfn_stack = NULL; int dfn_maxdepth = 0; int dfn_depth = 0; @@ -52,8 +59,9 @@ int dfn_counter = DFN_NAN; /* * Is CHILD already numbered? */ -static bool -DEFUN (is_numbered, (child), Sym * child) +static bfd_boolean +is_numbered (child) + Sym *child; { return child->cg.top_order != DFN_NAN && child->cg.top_order != DFN_BUSY; } @@ -62,8 +70,9 @@ DEFUN (is_numbered, (child), Sym * child) /* * Is CHILD already busy? */ -static bool -DEFUN (is_busy, (child), Sym * child) +static bfd_boolean +is_busy (child) + Sym *child; { if (child->cg.top_order == DFN_NAN) { @@ -80,7 +89,8 @@ DEFUN (is_busy, (child), Sym * child) * depth-first number). */ static void -DEFUN (find_cycle, (child), Sym * child) +find_cycle (child) + Sym *child; { Sym *head = 0; Sym *tail; @@ -203,7 +213,8 @@ DEFUN (find_cycle, (child), Sym * child) * the stack and mark it busy. */ static void -DEFUN (pre_visit, (parent), Sym * parent) +pre_visit (parent) + Sym *parent; { ++dfn_depth; @@ -227,7 +238,8 @@ DEFUN (pre_visit, (parent), Sym * parent) * and number functions if PARENT is head of a cycle. */ static void -DEFUN (post_visit, (parent), Sym * parent) +post_visit (parent) + Sym *parent; { Sym *member; @@ -261,7 +273,8 @@ DEFUN (post_visit, (parent), Sym * parent) * Given this PARENT, depth first number its children. */ void -DEFUN (cg_dfn, (parent), Sym * parent) +cg_dfn (parent) + Sym *parent; { Arc *arc; diff --git a/gnu/usr.bin/binutils/gprof/cg_print.c b/gnu/usr.bin/binutils/gprof/cg_print.c index 0a80cca85b7..21847027c1c 100644 --- a/gnu/usr.bin/binutils/gprof/cg_print.c +++ b/gnu/usr.bin/binutils/gprof/cg_print.c @@ -1,6 +1,6 @@ /* cg_print.c - Print routines for displaying call graphs. - Copyright 2000, 2001 Free Software Foundation, Inc. + Copyright 2000, 2001, 2002 Free Software Foundation, Inc. This file is part of GNU Binutils. @@ -20,19 +20,38 @@ 02111-1307, USA. */ #include "libiberty.h" +#include "gprof.h" +#include "search_list.h" +#include "source.h" +#include "symtab.h" #include "cg_arcs.h" #include "cg_print.h" #include "hist.h" #include "utils.h" +#include "corefile.h" /* Return value of comparison functions used to sort tables. */ #define LESSTHAN -1 #define EQUALTO 0 #define GREATERTHAN 1 -static void order_and_dump_functions_by_arcs PARAMS ((Arc **, unsigned long, - int, Arc **, - unsigned long *)); +static void print_header PARAMS ((void)); +static void print_cycle PARAMS ((Sym *)); +static int cmp_member PARAMS ((Sym *, Sym *)); +static void sort_members PARAMS ((Sym *)); +static void print_members PARAMS ((Sym *)); +static int cmp_arc PARAMS ((Arc *, Arc *)); +static void sort_parents PARAMS ((Sym *)); +static void print_parents PARAMS ((Sym *)); +static void sort_children PARAMS ((Sym *)); +static void print_children PARAMS ((Sym *)); +static void print_line PARAMS ((Sym *)); +static int cmp_name PARAMS ((const PTR, const PTR)); +static int cmp_arc_count PARAMS ((const PTR, const PTR)); +static int cmp_fun_nuses PARAMS ((const PTR, const PTR)); +static void order_and_dump_functions_by_arcs + PARAMS ((Arc **, unsigned long, int, Arc **, unsigned long *)); + /* Declarations of automatically generated functions to output blurbs. */ extern void bsd_callg_blurb PARAMS ((FILE * fp)); extern void fsf_callg_blurb PARAMS ((FILE * fp)); @@ -41,7 +60,7 @@ double print_time = 0.0; static void -DEFUN_VOID (print_header) +print_header () { if (first_output) first_output = FALSE; @@ -75,7 +94,7 @@ DEFUN_VOID (print_header) printf ("%6.6s %5.5s %7.7s %11.11s %7.7s/%-7.7s %-8.8s\n", "", "", "", "", _("called"), _("total"), _("parents")); printf ("%-6.6s %5.5s %7.7s %11.11s %7.7s+%-7.7s %-8.8s\t%5.5s\n", - _("index"), _("%time"), _("self"), _("descendents"), + _("index"), _("%time"), _("self"), _("descendants"), _("called"), _("self"), _("name"), _("index")); printf ("%6.6s %5.5s %7.7s %11.11s %7.7s/%-7.7s %-8.8s\n", "", "", "", "", _("called"), _("total"), _("children")); @@ -90,7 +109,8 @@ DEFUN_VOID (print_header) /* Print a cycle header. */ static void -DEFUN (print_cycle, (cyc), Sym * cyc) +print_cycle (cyc) + Sym *cyc; { char buf[BUFSIZ]; @@ -113,7 +133,9 @@ DEFUN (print_cycle, (cyc), Sym * cyc) CG.PROP.SELF+CG.PROP.CHILD, secondary key is NCALLS+CG.SELF_CALLS. */ static int -DEFUN (cmp_member, (left, right), Sym * left AND Sym * right) +cmp_member (left, right) + Sym *left; + Sym *right; { double left_time = left->cg.prop.self + left->cg.prop.child; double right_time = right->cg.prop.self + right->cg.prop.child; @@ -138,7 +160,8 @@ DEFUN (cmp_member, (left, right), Sym * left AND Sym * right) /* Sort members of a cycle. */ static void -DEFUN (sort_members, (cyc), Sym * cyc) +sort_members (cyc) + Sym *cyc; { Sym *todo, *doing, *prev; @@ -165,7 +188,8 @@ DEFUN (sort_members, (cyc), Sym * cyc) /* Print the members of a cycle. */ static void -DEFUN (print_members, (cyc), Sym * cyc) +print_members (cyc) + Sym *cyc; { Sym *member; @@ -199,7 +223,9 @@ DEFUN (print_members, (cyc), Sym * cyc) arc count as minor key. */ static int -DEFUN (cmp_arc, (left, right), Arc * left AND Arc * right) +cmp_arc (left, right) + Arc *left; + Arc *right; { Sym *left_parent = left->parent; Sym *left_child = left->child; @@ -285,7 +311,8 @@ DEFUN (cmp_arc, (left, right), Arc * left AND Arc * right) static void -DEFUN (sort_parents, (child), Sym * child) +sort_parents (child) + Sym * child; { Arc *arc, *detached, sorted, *prev; @@ -318,7 +345,8 @@ DEFUN (sort_parents, (child), Sym * child) static void -DEFUN (print_parents, (child), Sym * child) +print_parents (child) + Sym *child; { Sym *parent; Arc *arc; @@ -372,7 +400,8 @@ DEFUN (print_parents, (child), Sym * child) static void -DEFUN (sort_children, (parent), Sym * parent) +sort_children (parent) + Sym *parent; { Arc *arc, *detached, sorted, *prev; @@ -405,7 +434,8 @@ DEFUN (sort_children, (parent), Sym * parent) static void -DEFUN (print_children, (parent), Sym * parent) +print_children (parent) + Sym *parent; { Sym *child; Arc *arc; @@ -444,7 +474,8 @@ DEFUN (print_children, (parent), Sym * parent) static void -DEFUN (print_line, (np), Sym * np) +print_line (np) + Sym *np; { char buf[BUFSIZ]; @@ -477,7 +508,8 @@ DEFUN (print_line, (np), Sym * np) /* Print dynamic call graph. */ void -DEFUN (cg_print, (timesortsym), Sym ** timesortsym) +cg_print (timesortsym) + Sym ** timesortsym; { unsigned int index; Sym *parent; @@ -528,7 +560,9 @@ DEFUN (cg_print, (timesortsym), Sym ** timesortsym) static int -DEFUN (cmp_name, (left, right), const PTR left AND const PTR right) +cmp_name (left, right) + const PTR left; + const PTR right; { const Sym **npp1 = (const Sym **) left; const Sym **npp2 = (const Sym **) right; @@ -538,7 +572,7 @@ DEFUN (cmp_name, (left, right), const PTR left AND const PTR right) void -DEFUN_VOID (cg_print_index) +cg_print_index () { unsigned int index; unsigned int nnames, todo, i, j; @@ -652,7 +686,9 @@ DEFUN_VOID (cg_print_index) We want to sort in descending order. */ static int -DEFUN (cmp_arc_count, (left, right), const PTR left AND const PTR right) +cmp_arc_count (left, right) + const PTR left; + const PTR right; { const Arc **npp1 = (const Arc **) left; const Arc **npp2 = (const Arc **) right; @@ -669,7 +705,9 @@ DEFUN (cmp_arc_count, (left, right), const PTR left AND const PTR right) We want to sort in descending order. */ static int -DEFUN (cmp_fun_nuses, (left, right), const PTR left AND const PTR right) +cmp_fun_nuses (left, right) + const PTR left; + const PTR right; { const Sym **npp1 = (const Sym **) left; const Sym **npp2 = (const Sym **) right; @@ -751,7 +789,7 @@ DEFUN (cmp_fun_nuses, (left, right), const PTR left AND const PTR right) of function ordering). */ void -DEFUN_VOID (cg_print_function_ordering) +cg_print_function_ordering () { unsigned long index, used, unused, scratch_index; unsigned long unplaced_arc_count, high_arc_count, scratch_arc_count; @@ -956,18 +994,18 @@ DEFUN_VOID (cg_print_function_ordering) free (unplaced_arcs); } -/* Place functions based on the arcs in ARCS with NUMARCS entries; +/* Place functions based on the arcs in THE_ARCS with ARC_COUNT entries; place unused arcs into UNPLACED_ARCS/UNPLACED_ARC_COUNT. - If ALL is nonzero, then place all functions referenced by ARCS, - else only place those referenced in the top 99% of the arcs in ARCS. */ + If ALL is nonzero, then place all functions referenced by THE_ARCS, + else only place those referenced in the top 99% of the arcs in THE_ARCS. */ #define MOST 0.99 static void -order_and_dump_functions_by_arcs (arcs, numarcs, all, +order_and_dump_functions_by_arcs (the_arcs, arc_count, all, unplaced_arcs, unplaced_arc_count) - Arc **arcs; - unsigned long numarcs; + Arc **the_arcs; + unsigned long arc_count; int all; Arc **unplaced_arcs; unsigned long *unplaced_arc_count; @@ -985,27 +1023,27 @@ order_and_dump_functions_by_arcs (arcs, numarcs, all, if (! all) { total_arcs = 0; - for (index = 0; index < numarcs; index++) - total_arcs += arcs[index]->count; + for (index = 0; index < arc_count; index++) + total_arcs += the_arcs[index]->count; } else total_arcs = 0; tmp_arcs = 0; - for (index = 0; index < numarcs; index++) + for (index = 0; index < arc_count; index++) { Sym *sym1, *sym2; Sym *child, *parent; - tmp_arcs += arcs[index]->count; + tmp_arcs += the_arcs[index]->count; /* Ignore this arc if it's already been placed. */ - if (arcs[index]->has_been_placed) + if (the_arcs[index]->has_been_placed) continue; - child = arcs[index]->child; - parent = arcs[index]->parent; + child = the_arcs[index]->child; + parent = the_arcs[index]->parent; /* If we're not using all arcs, and this is a rarely used arc, then put it on the unplaced_arc list. Similarly @@ -1013,7 +1051,7 @@ order_and_dump_functions_by_arcs (arcs, numarcs, all, if ((! all && (double)tmp_arcs / (double)total_arcs > MOST) || child->has_been_placed || parent->has_been_placed) { - unplaced_arcs[(*unplaced_arc_count)++] = arcs[index]; + unplaced_arcs[(*unplaced_arc_count)++] = the_arcs[index]; continue; } @@ -1023,7 +1061,7 @@ order_and_dump_functions_by_arcs (arcs, numarcs, all, algorithm can use it to place function chains. */ if (parent->next && parent->prev && child->next && child->prev) { - unplaced_arcs[(*unplaced_arc_count)++] = arcs[index]; + unplaced_arcs[(*unplaced_arc_count)++] = the_arcs[index]; continue; } @@ -1078,7 +1116,7 @@ order_and_dump_functions_by_arcs (arcs, numarcs, all, { /* Couldn't find anywhere to attach the functions, put the arc on the unplaced arc list. */ - unplaced_arcs[(*unplaced_arc_count)++] = arcs[index]; + unplaced_arcs[(*unplaced_arc_count)++] = the_arcs[index]; continue; } @@ -1103,7 +1141,7 @@ order_and_dump_functions_by_arcs (arcs, numarcs, all, && sym2 == parent) { /* This would tie two ends together. */ - unplaced_arcs[(*unplaced_arc_count)++] = arcs[index]; + unplaced_arcs[(*unplaced_arc_count)++] = the_arcs[index]; continue; } @@ -1115,7 +1153,7 @@ order_and_dump_functions_by_arcs (arcs, numarcs, all, /* parent-prev and child-next */ parent->prev = child; child->next = parent; - arcs[index]->has_been_placed = 1; + the_arcs[index]->has_been_placed = 1; } } else if (parent->prev) @@ -1126,7 +1164,7 @@ order_and_dump_functions_by_arcs (arcs, numarcs, all, /* parent-next and child-prev */ parent->next = child; child->prev = parent; - arcs[index]->has_been_placed = 1; + the_arcs[index]->has_been_placed = 1; } } else @@ -1138,27 +1176,27 @@ order_and_dump_functions_by_arcs (arcs, numarcs, all, /* parent-prev and child-next. */ parent->prev = child; child->next = parent; - arcs[index]->has_been_placed = 1; + the_arcs[index]->has_been_placed = 1; } else { /* parent-next and child-prev. */ parent->next = child; child->prev = parent; - arcs[index]->has_been_placed = 1; + the_arcs[index]->has_been_placed = 1; } } } /* Dump the chains of functions we've made. */ - for (index = 0; index < numarcs; index++) + for (index = 0; index < arc_count; index++) { Sym *sym; - if (arcs[index]->parent->has_been_placed - || arcs[index]->child->has_been_placed) + if (the_arcs[index]->parent->has_been_placed + || the_arcs[index]->child->has_been_placed) continue; - sym = arcs[index]->parent; + sym = the_arcs[index]->parent; /* If this symbol isn't attached to any other symbols, then we've got a rarely used arc. @@ -1184,14 +1222,14 @@ order_and_dump_functions_by_arcs (arcs, numarcs, all, /* If we want to place all the arcs, then output those which weren't placed by the main algorithm. */ if (all) - for (index = 0; index < numarcs; index++) + for (index = 0; index < arc_count; index++) { Sym *sym; - if (arcs[index]->parent->has_been_placed - || arcs[index]->child->has_been_placed) + if (the_arcs[index]->parent->has_been_placed + || the_arcs[index]->child->has_been_placed) continue; - sym = arcs[index]->parent; + sym = the_arcs[index]->parent; sym->has_been_placed = 1; printf ("%s\n", sym->name); @@ -1202,19 +1240,11 @@ order_and_dump_functions_by_arcs (arcs, numarcs, all, on profiling information. This uses the function placement code for the bulk of its work. */ -struct function_map -{ - char *function_name; - char *file_name; -}; - void -DEFUN_VOID (cg_print_file_ordering) +cg_print_file_ordering () { unsigned long scratch_arc_count, index; Arc **scratch_arcs; - extern struct function_map *symbol_map; - extern unsigned int symbol_map_count; char *last; scratch_arc_count = 0; diff --git a/gnu/usr.bin/binutils/gprof/cg_print.h b/gnu/usr.bin/binutils/gprof/cg_print.h index ad9f4240c8a..ce41987df2c 100644 --- a/gnu/usr.bin/binutils/gprof/cg_print.h +++ b/gnu/usr.bin/binutils/gprof/cg_print.h @@ -21,9 +21,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef cg_print_h #define cg_print_h -#include "gprof.h" -#include "symtab.h" - extern double print_time; /* Total of time being printed. */ extern void cg_print PARAMS ((Sym **)); diff --git a/gnu/usr.bin/binutils/gprof/configure b/gnu/usr.bin/binutils/gprof/configure index 411ce5838aa..8a38fc3491c 100644 --- a/gnu/usr.bin/binutils/gprof/configure +++ b/gnu/usr.bin/binutils/gprof/configure @@ -49,7 +49,6 @@ program_suffix=NONE program_transform_name=s,x,x, silent= site= -sitefile= srcdir= target=NONE verbose= @@ -164,7 +163,6 @@ Configuration: --help print this message --no-create do not create output files --quiet, --silent do not print \`checking...' messages - --site-file=FILE use FILE as the site file --version print the version of autoconf that created configure Directory and file names: --prefix=PREFIX install architecture-independent files in PREFIX @@ -335,11 +333,6 @@ EOF -site=* | --site=* | --sit=*) site="$ac_optarg" ;; - -site-file | --site-file | --site-fil | --site-fi | --site-f) - ac_prev=sitefile ;; - -site-file=* | --site-file=* | --site-fil=* | --site-fi=* | --site-f=*) - sitefile="$ac_optarg" ;; - -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) ac_prev=srcdir ;; -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) @@ -505,16 +498,12 @@ fi srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'` # Prefer explicitly selected file to automatically selected ones. -if test -z "$sitefile"; then - if test -z "$CONFIG_SITE"; then - if test "x$prefix" != xNONE; then - CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site" - else - CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" - fi +if test -z "$CONFIG_SITE"; then + if test "x$prefix" != xNONE; then + CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site" + else + CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" fi -else - CONFIG_SITE="$sitefile" fi for ac_site_file in $CONFIG_SITE; do if test -r "$ac_site_file"; then @@ -553,12 +542,12 @@ else fi echo $ac_n "checking for Cygwin environment""... $ac_c" 1>&6 -echo "configure:557: checking for Cygwin environment" >&5 +echo "configure:546: checking for Cygwin environment" >&5 if eval "test \"`echo '$''{'ac_cv_cygwin'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 562 "configure" +#line 551 "configure" #include "confdefs.h" int main() { @@ -569,7 +558,7 @@ int main() { return __CYGWIN__; ; return 0; } EOF -if { (eval echo configure:573: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:562: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_cygwin=yes else @@ -586,19 +575,19 @@ echo "$ac_t""$ac_cv_cygwin" 1>&6 CYGWIN= test "$ac_cv_cygwin" = yes && CYGWIN=yes echo $ac_n "checking for mingw32 environment""... $ac_c" 1>&6 -echo "configure:590: checking for mingw32 environment" >&5 +echo "configure:579: checking for mingw32 environment" >&5 if eval "test \"`echo '$''{'ac_cv_mingw32'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 595 "configure" +#line 584 "configure" #include "confdefs.h" int main() { return __MINGW32__; ; return 0; } EOF -if { (eval echo configure:602: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:591: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_mingw32=yes else @@ -617,7 +606,7 @@ test "$ac_cv_mingw32" = yes && MINGW32=yes ac_aux_dir= -for ac_dir in ${GNUSYSTEM_AUX_DIR} $srcdir $srcdir/.. $srcdir/../..; do +for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do if test -f $ac_dir/install-sh; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install-sh -c" @@ -663,7 +652,7 @@ else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; } fi echo $ac_n "checking host system type""... $ac_c" 1>&6 -echo "configure:667: checking host system type" >&5 +echo "configure:656: checking host system type" >&5 host_alias=$host case "$host_alias" in @@ -684,7 +673,7 @@ host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` echo "$ac_t""$host" 1>&6 echo $ac_n "checking target system type""... $ac_c" 1>&6 -echo "configure:688: checking target system type" >&5 +echo "configure:677: checking target system type" >&5 target_alias=$target case "$target_alias" in @@ -702,7 +691,7 @@ target_os=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` echo "$ac_t""$target" 1>&6 echo $ac_n "checking build system type""... $ac_c" 1>&6 -echo "configure:706: checking build system type" >&5 +echo "configure:695: checking build system type" >&5 build_alias=$build case "$build_alias" in @@ -727,7 +716,7 @@ test "$host_alias" != "$target_alias" && # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:731: checking for $ac_word" >&5 +echo "configure:720: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -757,7 +746,7 @@ if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:761: checking for $ac_word" >&5 +echo "configure:750: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -808,7 +797,7 @@ fi # Extract the first word of "cl", so it can be a program name with args. set dummy cl; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:812: checking for $ac_word" >&5 +echo "configure:801: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -840,7 +829,7 @@ fi fi echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6 -echo "configure:844: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 +echo "configure:833: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 ac_ext=c # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. @@ -851,12 +840,12 @@ cross_compiling=$ac_cv_prog_cc_cross cat > conftest.$ac_ext << EOF -#line 855 "configure" +#line 844 "configure" #include "confdefs.h" main(){return(0);} EOF -if { (eval echo configure:860: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:849: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ac_cv_prog_cc_works=yes # If we can't run a trivial program, we are probably using a cross compiler. if (./conftest; exit) 2>/dev/null; then @@ -882,12 +871,12 @@ if test $ac_cv_prog_cc_works = no; then { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; } fi echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6 -echo "configure:886: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 +echo "configure:875: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6 cross_compiling=$ac_cv_prog_cc_cross echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6 -echo "configure:891: checking whether we are using GNU C" >&5 +echo "configure:880: checking whether we are using GNU C" >&5 if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -896,7 +885,7 @@ else yes; #endif EOF -if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:900: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then +if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:889: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then ac_cv_prog_gcc=yes else ac_cv_prog_gcc=no @@ -915,7 +904,7 @@ ac_test_CFLAGS="${CFLAGS+set}" ac_save_CFLAGS="$CFLAGS" CFLAGS= echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6 -echo "configure:919: checking whether ${CC-cc} accepts -g" >&5 +echo "configure:908: checking whether ${CC-cc} accepts -g" >&5 if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -947,7 +936,7 @@ else fi echo $ac_n "checking for POSIXized ISC""... $ac_c" 1>&6 -echo "configure:951: checking for POSIXized ISC" >&5 +echo "configure:940: checking for POSIXized ISC" >&5 if test -d /etc/conf/kconfig.d && grep _POSIX_VERSION /usr/include/sys/unistd.h >/dev/null 2>&1 then @@ -981,7 +970,7 @@ BFD_VERSION=`sed -n -e 's/^.._INIT_AUTOMAKE.*,[ ]*\([^ ]*\)[ ]*).*/\1/p' < ${ # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # ./install, which can be erroneously created by make from ./install.sh. echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6 -echo "configure:985: checking for a BSD compatible install" >&5 +echo "configure:974: checking for a BSD compatible install" >&5 if test -z "$INSTALL"; then if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -1034,7 +1023,7 @@ test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}' test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' echo $ac_n "checking whether build environment is sane""... $ac_c" 1>&6 -echo "configure:1038: checking whether build environment is sane" >&5 +echo "configure:1027: checking whether build environment is sane" >&5 # Just in case sleep 1 echo timestamp > conftestfile @@ -1091,7 +1080,7 @@ test "$program_suffix" != NONE && test "$program_transform_name" = "" && program_transform_name="s,x,x," echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6 -echo "configure:1095: checking whether ${MAKE-make} sets \${MAKE}" >&5 +echo "configure:1084: checking whether ${MAKE-make} sets \${MAKE}" >&5 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -1137,7 +1126,7 @@ EOF missing_dir=`cd $ac_aux_dir && pwd` echo $ac_n "checking for working aclocal""... $ac_c" 1>&6 -echo "configure:1141: checking for working aclocal" >&5 +echo "configure:1130: checking for working aclocal" >&5 # Run test in a subshell; some versions of sh will print an error if # an executable is not found, even if stderr is redirected. # Redirect stdin to placate older versions of autoconf. Sigh. @@ -1150,7 +1139,7 @@ else fi echo $ac_n "checking for working autoconf""... $ac_c" 1>&6 -echo "configure:1154: checking for working autoconf" >&5 +echo "configure:1143: checking for working autoconf" >&5 # Run test in a subshell; some versions of sh will print an error if # an executable is not found, even if stderr is redirected. # Redirect stdin to placate older versions of autoconf. Sigh. @@ -1163,7 +1152,7 @@ else fi echo $ac_n "checking for working automake""... $ac_c" 1>&6 -echo "configure:1167: checking for working automake" >&5 +echo "configure:1156: checking for working automake" >&5 # Run test in a subshell; some versions of sh will print an error if # an executable is not found, even if stderr is redirected. # Redirect stdin to placate older versions of autoconf. Sigh. @@ -1176,7 +1165,7 @@ else fi echo $ac_n "checking for working autoheader""... $ac_c" 1>&6 -echo "configure:1180: checking for working autoheader" >&5 +echo "configure:1169: checking for working autoheader" >&5 # Run test in a subshell; some versions of sh will print an error if # an executable is not found, even if stderr is redirected. # Redirect stdin to placate older versions of autoconf. Sigh. @@ -1189,7 +1178,7 @@ else fi echo $ac_n "checking for working makeinfo""... $ac_c" 1>&6 -echo "configure:1193: checking for working makeinfo" >&5 +echo "configure:1182: checking for working makeinfo" >&5 # Run test in a subshell; some versions of sh will print an error if # an executable is not found, even if stderr is redirected. # Redirect stdin to placate older versions of autoconf. Sigh. @@ -1207,7 +1196,7 @@ fi if test "${enable_shared+set}" = set; then enableval="$enable_shared" p=${PACKAGE-default} -case "$enableval" in +case $enableval in yes) enable_shared=yes ;; no) enable_shared=no ;; *) @@ -1230,7 +1219,7 @@ fi if test "${enable_static+set}" = set; then enableval="$enable_static" p=${PACKAGE-default} -case "$enableval" in +case $enableval in yes) enable_static=yes ;; no) enable_static=no ;; *) @@ -1253,7 +1242,7 @@ fi if test "${enable_fast_install+set}" = set; then enableval="$enable_fast_install" p=${PACKAGE-default} -case "$enableval" in +case $enableval in yes) enable_fast_install=yes ;; no) enable_fast_install=no ;; *) @@ -1281,10 +1270,10 @@ else fi ac_prog=ld -if test "$ac_cv_prog_gcc" = yes; then +if test "$GCC" = yes; then # Check if gcc -print-prog-name=ld gives a path. echo $ac_n "checking for ld used by GCC""... $ac_c" 1>&6 -echo "configure:1288: checking for ld used by GCC" >&5 +echo "configure:1277: checking for ld used by GCC" >&5 case $host in *-*-mingw*) # gcc leaves a trailing carriage return which upsets mingw @@ -1292,7 +1281,7 @@ echo "configure:1288: checking for ld used by GCC" >&5 *) ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; esac - case "$ac_prog" in + case $ac_prog in # Accept absolute paths. [\\/]* | [A-Za-z]:[\\/]*) re_direlt='/[^/][^/]*/\.\./' @@ -1314,12 +1303,12 @@ echo "configure:1288: checking for ld used by GCC" >&5 esac elif test "$with_gnu_ld" = yes; then echo $ac_n "checking for GNU ld""... $ac_c" 1>&6 -echo "configure:1318: checking for GNU ld" >&5 +echo "configure:1307: checking for GNU ld" >&5 else echo $ac_n "checking for non-GNU ld""... $ac_c" 1>&6 -echo "configure:1321: checking for non-GNU ld" >&5 +echo "configure:1310: checking for non-GNU ld" >&5 fi -if eval "test \"`echo '$''{'ac_cv_path_LD'+set}'`\" = set"; then +if eval "test \"`echo '$''{'lt_cv_path_LD'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else if test -z "$LD"; then @@ -1327,11 +1316,11 @@ else for ac_dir in $PATH; do test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then - ac_cv_path_LD="$ac_dir/$ac_prog" + lt_cv_path_LD="$ac_dir/$ac_prog" # Check to see if the program is GNU ld. I'd rather use --version, # but apparently some GNU ld's only accept -v. # Break only if it was the GNU/non-GNU ld that we prefer. - if "$ac_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then + if "$lt_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then test "$with_gnu_ld" != no && break else test "$with_gnu_ld" != yes && break @@ -1340,11 +1329,11 @@ else done IFS="$ac_save_ifs" else - ac_cv_path_LD="$LD" # Let the user override the test with a path. + lt_cv_path_LD="$LD" # Let the user override the test with a path. fi fi -LD="$ac_cv_path_LD" +LD="$lt_cv_path_LD" if test -n "$LD"; then echo "$ac_t""$LD" 1>&6 else @@ -1352,24 +1341,24 @@ else fi test -z "$LD" && { echo "configure: error: no acceptable ld found in \$PATH" 1>&2; exit 1; } echo $ac_n "checking if the linker ($LD) is GNU ld""... $ac_c" 1>&6 -echo "configure:1356: checking if the linker ($LD) is GNU ld" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_gnu_ld'+set}'`\" = set"; then +echo "configure:1345: checking if the linker ($LD) is GNU ld" >&5 +if eval "test \"`echo '$''{'lt_cv_prog_gnu_ld'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else # I'd rather use --version here, but apparently some GNU ld's only accept -v. if $LD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then - ac_cv_prog_gnu_ld=yes + lt_cv_prog_gnu_ld=yes else - ac_cv_prog_gnu_ld=no + lt_cv_prog_gnu_ld=no fi fi -echo "$ac_t""$ac_cv_prog_gnu_ld" 1>&6 -with_gnu_ld=$ac_cv_prog_gnu_ld +echo "$ac_t""$lt_cv_prog_gnu_ld" 1>&6 +with_gnu_ld=$lt_cv_prog_gnu_ld echo $ac_n "checking for $LD option to reload object files""... $ac_c" 1>&6 -echo "configure:1373: checking for $LD option to reload object files" >&5 +echo "configure:1362: checking for $LD option to reload object files" >&5 if eval "test \"`echo '$''{'lt_cv_ld_reload_flag'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1381,13 +1370,13 @@ reload_flag=$lt_cv_ld_reload_flag test -n "$reload_flag" && reload_flag=" $reload_flag" echo $ac_n "checking for BSD-compatible nm""... $ac_c" 1>&6 -echo "configure:1385: checking for BSD-compatible nm" >&5 -if eval "test \"`echo '$''{'ac_cv_path_NM'+set}'`\" = set"; then +echo "configure:1374: checking for BSD-compatible nm" >&5 +if eval "test \"`echo '$''{'lt_cv_path_NM'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else if test -n "$NM"; then # Let the user override the test. - ac_cv_path_NM="$NM" + lt_cv_path_NM="$NM" else IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}" for ac_dir in $PATH /usr/ccs/bin /usr/ucb /bin; do @@ -1399,27 +1388,27 @@ else # nm: unknown option "B" ignored # Tru64's nm complains that /dev/null is an invalid object file if ($tmp_nm -B /dev/null 2>&1 | sed '1q'; exit 0) | egrep '(/dev/null|Invalid file or object type)' >/dev/null; then - ac_cv_path_NM="$tmp_nm -B" + lt_cv_path_NM="$tmp_nm -B" break elif ($tmp_nm -p /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then - ac_cv_path_NM="$tmp_nm -p" + lt_cv_path_NM="$tmp_nm -p" break else - ac_cv_path_NM=${ac_cv_path_NM="$tmp_nm"} # keep the first match, but + lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but continue # so that we can try to find one that supports BSD flags fi fi done IFS="$ac_save_ifs" - test -z "$ac_cv_path_NM" && ac_cv_path_NM=nm + test -z "$lt_cv_path_NM" && lt_cv_path_NM=nm fi fi -NM="$ac_cv_path_NM" +NM="$lt_cv_path_NM" echo "$ac_t""$NM" 1>&6 echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6 -echo "configure:1423: checking whether ln -s works" >&5 +echo "configure:1412: checking whether ln -s works" >&5 if eval "test \"`echo '$''{'ac_cv_prog_LN_S'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1440,7 +1429,7 @@ else fi echo $ac_n "checking how to recognise dependant libraries""... $ac_c" 1>&6 -echo "configure:1444: checking how to recognise dependant libraries" >&5 +echo "configure:1433: checking how to recognise dependant libraries" >&5 if eval "test \"`echo '$''{'lt_cv_deplibs_check_method'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1458,8 +1447,8 @@ lt_cv_deplibs_check_method='unknown' # If you have `file' or equivalent on your system and you're not sure # whether `pass_all' will *always* work, you probably want this one. -case "$host_os" in -aix4*) +case $host_os in +aix*) lt_cv_deplibs_check_method=pass_all ;; @@ -1468,8 +1457,8 @@ beos*) ;; bsdi4*) - lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib)' - lt_cv_file_magic_cmd='/usr/bin/file -L' + lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib)' + lt_cv_file_magic_cmd='/usr/bin/file -L' lt_cv_file_magic_test_file=/shlib/libc.so ;; @@ -1478,14 +1467,27 @@ cygwin* | mingw* |pw32*) lt_cv_file_magic_cmd='$OBJDUMP -f' ;; +darwin* | rhapsody*) + lt_cv_deplibs_check_method='file_magic Mach-O dynamically linked shared library' + lt_cv_file_magic_cmd='/usr/bin/file -L' + case "$host_os" in + rhapsody* | darwin1.012) + lt_cv_file_magic_test_file='/System/Library/Frameworks/System.framework/System' + ;; + *) # Darwin 1.3 on + lt_cv_file_magic_test_file='/usr/lib/libSystem.dylib' + ;; + esac + ;; + freebsd* ) if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then - case "$host_cpu" in + case $host_cpu in i*86 ) # Not sure whether the presence of OpenBSD here was a mistake. # Let's accept both of them until this is cleared up. - lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD)/i[3-9]86 (compact )?demand paged shared library' - lt_cv_file_magic_cmd=/usr/bin/file + lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD)/i[3-9]86 (compact )?demand paged shared library' + lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` ;; esac @@ -1498,29 +1500,37 @@ gnu*) lt_cv_deplibs_check_method=pass_all ;; -hpux10.20*) - # TODO: Does this work for hpux-11 too? - lt_cv_deplibs_check_method='file_magic (s0-90-90-9|PA-RISC0-9.0-9) shared library' - lt_cv_file_magic_cmd=/usr/bin/file - lt_cv_file_magic_test_file=/usr/lib/libc.sl +hpux10.20*|hpux11*) + case $host_cpu in + hppa*) + lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|PA-RISC[0-9].[0-9]) shared library' + lt_cv_file_magic_cmd=/usr/bin/file + lt_cv_file_magic_test_file=/usr/lib/libc.sl + ;; + ia64*) + lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - IA64' + lt_cv_file_magic_cmd=/usr/bin/file + lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so + ;; + esac ;; irix5* | irix6*) - case "$host_os" in + case $host_os in irix5*) # this will be overridden with pass_all, but let us keep it just in case lt_cv_deplibs_check_method="file_magic ELF 32-bit MSB dynamic lib MIPS - version 1" ;; *) - case "$LD" in + case $LD in *-32|*"-32 ") libmagic=32-bit;; *-n32|*"-n32 ") libmagic=N32;; *-64|*"-64 ") libmagic=64-bit;; *) libmagic=never-match;; esac # this will be overridden with pass_all, but let us keep it just in case - lt_cv_deplibs_check_method="file_magic ELF ${libmagic} MSB mips-[1234] dynamic lib MIPS - version 1" - ;; + lt_cv_deplibs_check_method="file_magic ELF ${libmagic} MSB mips-[1234] dynamic lib MIPS - version 1" + ;; esac lt_cv_file_magic_test_file=`echo /lib${libsuff}/libc.so*` lt_cv_deplibs_check_method=pass_all @@ -1528,25 +1538,30 @@ irix5* | irix6*) # This must be Linux ELF. linux-gnu*) - case "$host_cpu" in - alpha* | i*86 | powerpc* | sparc* | ia64* ) + case $host_cpu in + alpha* | hppa* | i*86 | powerpc* | sparc* | ia64* ) lt_cv_deplibs_check_method=pass_all ;; *) # glibc up to 2.1.1 does not perform some relocations on ARM - lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )' ;; - esac + lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )' ;; + esac lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so` ;; netbsd*) - if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then : + if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then + lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$' else - lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB shared object' - lt_cv_file_magic_cmd='/usr/bin/file -L' - lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` + lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so$' fi ;; +newsos6) + lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (executable|dynamic lib)' + lt_cv_file_magic_cmd=/usr/bin/file + lt_cv_file_magic_test_file=/usr/lib/libnls.so + ;; + osf3* | osf4* | osf5*) # this will be overridden with pass_all, but let us keep it just in case lt_cv_deplibs_check_method='file_magic COFF format alpha shared library' @@ -1563,14 +1578,18 @@ solaris*) lt_cv_file_magic_test_file=/lib/libc.so ;; +sysv5uw[78]* | sysv4*uw2*) + lt_cv_deplibs_check_method=pass_all + ;; + sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) - case "$host_vendor" in + case $host_vendor in ncr) lt_cv_deplibs_check_method=pass_all ;; motorola) - lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib) M[0-9][0-9]* Version [0-9]' - lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` + lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib) M[0-9][0-9]* Version [0-9]' + lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` ;; esac ;; @@ -1583,13 +1602,13 @@ file_magic_cmd=$lt_cv_file_magic_cmd deplibs_check_method=$lt_cv_deplibs_check_method echo $ac_n "checking for object suffix""... $ac_c" 1>&6 -echo "configure:1587: checking for object suffix" >&5 +echo "configure:1606: checking for object suffix" >&5 if eval "test \"`echo '$''{'ac_cv_objext'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else rm -f conftest* echo 'int i = 1;' > conftest.$ac_ext -if { (eval echo configure:1593: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1612: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then for ac_file in conftest.*; do case $ac_file in *.c) ;; @@ -1609,7 +1628,7 @@ ac_objext=$ac_cv_objext echo $ac_n "checking for executable suffix""... $ac_c" 1>&6 -echo "configure:1613: checking for executable suffix" >&5 +echo "configure:1632: checking for executable suffix" >&5 if eval "test \"`echo '$''{'ac_cv_exeext'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1619,10 +1638,10 @@ else rm -f conftest* echo 'int main () { return 0; }' > conftest.$ac_ext ac_cv_exeext= - if { (eval echo configure:1623: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then + if { (eval echo configure:1642: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then for file in conftest.*; do case $file in - *.c | *.o | *.obj | *.ilk | *.pdb) ;; + *.c | *.o | *.obj) ;; *) ac_cv_exeext=`echo $file | sed -e s/conftest//` ;; esac done @@ -1648,15 +1667,15 @@ fi # Autoconf 2.13's AC_OBJEXT and AC_EXEEXT macros only works for C compilers! # Only perform the check for file, if the check method requires it -case "$deplibs_check_method" in +case $deplibs_check_method in file_magic*) if test "$file_magic_cmd" = '$MAGIC_CMD'; then echo $ac_n "checking for ${ac_tool_prefix}file""... $ac_c" 1>&6 -echo "configure:1656: checking for ${ac_tool_prefix}file" >&5 +echo "configure:1675: checking for ${ac_tool_prefix}file" >&5 if eval "test \"`echo '$''{'lt_cv_path_MAGIC_CMD'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else - case "$MAGIC_CMD" in + case $MAGIC_CMD in /*) lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. ;; @@ -1672,7 +1691,7 @@ else if test -f $ac_dir/${ac_tool_prefix}file; then lt_cv_path_MAGIC_CMD="$ac_dir/${ac_tool_prefix}file" if test -n "$file_magic_test_file"; then - case "$deplibs_check_method" in + case $deplibs_check_method in "file_magic "*) file_magic_regex="`expr \"$deplibs_check_method\" : \"file_magic \(.*\)\"`" MAGIC_CMD="$lt_cv_path_MAGIC_CMD" @@ -1714,11 +1733,11 @@ fi if test -z "$lt_cv_path_MAGIC_CMD"; then if test -n "$ac_tool_prefix"; then echo $ac_n "checking for file""... $ac_c" 1>&6 -echo "configure:1718: checking for file" >&5 +echo "configure:1737: checking for file" >&5 if eval "test \"`echo '$''{'lt_cv_path_MAGIC_CMD'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else - case "$MAGIC_CMD" in + case $MAGIC_CMD in /*) lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. ;; @@ -1734,7 +1753,7 @@ else if test -f $ac_dir/file; then lt_cv_path_MAGIC_CMD="$ac_dir/file" if test -n "$file_magic_test_file"; then - case "$deplibs_check_method" in + case $deplibs_check_method in "file_magic "*) file_magic_regex="`expr \"$deplibs_check_method\" : \"file_magic \(.*\)\"`" MAGIC_CMD="$lt_cv_path_MAGIC_CMD" @@ -1785,7 +1804,7 @@ esac # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. set dummy ${ac_tool_prefix}ranlib; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1789: checking for $ac_word" >&5 +echo "configure:1808: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1817,7 +1836,7 @@ if test -n "$ac_tool_prefix"; then # Extract the first word of "ranlib", so it can be a program name with args. set dummy ranlib; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1821: checking for $ac_word" >&5 +echo "configure:1840: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1852,7 +1871,7 @@ fi # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. set dummy ${ac_tool_prefix}strip; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1856: checking for $ac_word" >&5 +echo "configure:1875: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_STRIP'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1884,7 +1903,7 @@ if test -n "$ac_tool_prefix"; then # Extract the first word of "strip", so it can be a program name with args. set dummy strip; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1888: checking for $ac_word" >&5 +echo "configure:1907: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_STRIP'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1922,8 +1941,8 @@ libtool_flags="--cache-file=$cache_file" test "$enable_shared" = no && libtool_flags="$libtool_flags --disable-shared" test "$enable_static" = no && libtool_flags="$libtool_flags --disable-static" test "$enable_fast_install" = no && libtool_flags="$libtool_flags --disable-fast-install" -test "$ac_cv_prog_gcc" = yes && libtool_flags="$libtool_flags --with-gcc" -test "$ac_cv_prog_gnu_ld" = yes && libtool_flags="$libtool_flags --with-gnu-ld" +test "$GCC" = yes && libtool_flags="$libtool_flags --with-gcc" +test "$lt_cv_prog_gnu_ld" = yes && libtool_flags="$libtool_flags --with-gnu-ld" # Check whether --enable-libtool-lock or --disable-libtool-lock was given. @@ -1948,12 +1967,12 @@ test x"$pic_mode" = xno && libtool_flags="$libtool_flags --prefer-non-pic" # Some flags need to be propagated to the compiler or linker for good # libtool support. -case "$host" in +case $host in *-*-irix6*) # Find out which ABI we are using. - echo '#line 1955 "configure"' > conftest.$ac_ext - if { (eval echo configure:1956: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then - case "`/usr/bin/file conftest.o`" in + echo '#line 1974 "configure"' > conftest.$ac_ext + if { (eval echo configure:1975: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -32" ;; @@ -1968,12 +1987,28 @@ case "$host" in rm -rf conftest* ;; +ia64-*-hpux*) + # Find out which ABI we are using. + echo 'int i;' > conftest.$ac_ext + if { (eval echo configure:1994: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + case "`/usr/bin/file conftest.o`" in + *ELF-32*) + HPUX_IA64_MODE="32" + ;; + *ELF-64*) + HPUX_IA64_MODE="64" + ;; + esac + fi + rm -rf conftest* + ;; + *-*-sco3.2v5*) # On SCO OpenServer 5, we need -belf to get full-featured binaries. SAVE_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -belf" echo $ac_n "checking whether the C compiler needs -belf""... $ac_c" 1>&6 -echo "configure:1977: checking whether the C compiler needs -belf" >&5 +echo "configure:2012: checking whether the C compiler needs -belf" >&5 if eval "test \"`echo '$''{'lt_cv_cc_needs_belf'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1986,14 +2021,14 @@ ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$a cross_compiling=$ac_cv_prog_cc_cross cat > conftest.$ac_ext <<EOF -#line 1990 "configure" +#line 2025 "configure" #include "confdefs.h" int main() { ; return 0; } EOF -if { (eval echo configure:1997: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2032: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* lt_cv_cc_needs_belf=yes else @@ -2103,7 +2138,6 @@ LIBTOOL='$(SHELL) $(top_builddir)/libtool' # clobbered by the next message. exec 5>>./config.log - @@ -2117,7 +2151,7 @@ exec 5>>./config.log # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:2121: checking for $ac_word" >&5 +echo "configure:2155: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2147,7 +2181,7 @@ if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:2151: checking for $ac_word" >&5 +echo "configure:2185: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2198,7 +2232,7 @@ fi # Extract the first word of "cl", so it can be a program name with args. set dummy cl; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:2202: checking for $ac_word" >&5 +echo "configure:2236: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2230,7 +2264,7 @@ fi fi echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6 -echo "configure:2234: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 +echo "configure:2268: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 ac_ext=c # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. @@ -2241,12 +2275,12 @@ cross_compiling=$ac_cv_prog_cc_cross cat > conftest.$ac_ext << EOF -#line 2245 "configure" +#line 2279 "configure" #include "confdefs.h" main(){return(0);} EOF -if { (eval echo configure:2250: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2284: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ac_cv_prog_cc_works=yes # If we can't run a trivial program, we are probably using a cross compiler. if (./conftest; exit) 2>/dev/null; then @@ -2272,12 +2306,12 @@ if test $ac_cv_prog_cc_works = no; then { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; } fi echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6 -echo "configure:2276: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 +echo "configure:2310: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6 cross_compiling=$ac_cv_prog_cc_cross echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6 -echo "configure:2281: checking whether we are using GNU C" >&5 +echo "configure:2315: checking whether we are using GNU C" >&5 if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2286,7 +2320,7 @@ else yes; #endif EOF -if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:2290: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then +if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:2324: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then ac_cv_prog_gcc=yes else ac_cv_prog_gcc=no @@ -2305,7 +2339,7 @@ ac_test_CFLAGS="${CFLAGS+set}" ac_save_CFLAGS="$CFLAGS" CFLAGS= echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6 -echo "configure:2309: checking whether ${CC-cc} accepts -g" >&5 +echo "configure:2343: checking whether ${CC-cc} accepts -g" >&5 if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2348,7 +2382,7 @@ fi # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # ./install, which can be erroneously created by make from ./install.sh. echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6 -echo "configure:2352: checking for a BSD compatible install" >&5 +echo "configure:2386: checking for a BSD compatible install" >&5 if test -z "$INSTALL"; then if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -2404,12 +2438,12 @@ test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' for ac_func in setmode do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:2408: checking for $ac_func" >&5 +echo "configure:2442: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 2413 "configure" +#line 2447 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func(); below. */ @@ -2432,7 +2466,7 @@ $ac_func(); ; return 0; } EOF -if { (eval echo configure:2436: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2470: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -2457,9 +2491,9 @@ fi done -ALL_LINGUAS= +ALL_LINGUAS="fr tr sv es id da pt_BR" echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6 -echo "configure:2463: checking how to run the C preprocessor" >&5 +echo "configure:2497: checking how to run the C preprocessor" >&5 # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= @@ -2474,13 +2508,13 @@ else # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. cat > conftest.$ac_ext <<EOF -#line 2478 "configure" +#line 2512 "configure" #include "confdefs.h" #include <assert.h> Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2484: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2518: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then : @@ -2491,13 +2525,13 @@ else rm -rf conftest* CPP="${CC-cc} -E -traditional-cpp" cat > conftest.$ac_ext <<EOF -#line 2495 "configure" +#line 2529 "configure" #include "confdefs.h" #include <assert.h> Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2501: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2535: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then : @@ -2508,13 +2542,13 @@ else rm -rf conftest* CPP="${CC-cc} -nologo -E" cat > conftest.$ac_ext <<EOF -#line 2512 "configure" +#line 2546 "configure" #include "confdefs.h" #include <assert.h> Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2518: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2552: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then : @@ -2541,7 +2575,7 @@ echo "$ac_t""$CPP" 1>&6 # Extract the first word of "ranlib", so it can be a program name with args. set dummy ranlib; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:2545: checking for $ac_word" >&5 +echo "configure:2579: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2569,12 +2603,12 @@ else fi echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6 -echo "configure:2573: checking for ANSI C header files" >&5 +echo "configure:2607: checking for ANSI C header files" >&5 if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 2578 "configure" +#line 2612 "configure" #include "confdefs.h" #include <stdlib.h> #include <stdarg.h> @@ -2582,7 +2616,7 @@ else #include <float.h> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2586: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2620: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -2599,7 +2633,7 @@ rm -f conftest* if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat > conftest.$ac_ext <<EOF -#line 2603 "configure" +#line 2637 "configure" #include "confdefs.h" #include <string.h> EOF @@ -2617,7 +2651,7 @@ fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat > conftest.$ac_ext <<EOF -#line 2621 "configure" +#line 2655 "configure" #include "confdefs.h" #include <stdlib.h> EOF @@ -2638,7 +2672,7 @@ if test "$cross_compiling" = yes; then : else cat > conftest.$ac_ext <<EOF -#line 2642 "configure" +#line 2676 "configure" #include "confdefs.h" #include <ctype.h> #define ISLOWER(c) ('a' <= (c) && (c) <= 'z') @@ -2649,7 +2683,7 @@ if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2); exit (0); } EOF -if { (eval echo configure:2653: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:2687: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then : else @@ -2673,12 +2707,12 @@ EOF fi echo $ac_n "checking for working const""... $ac_c" 1>&6 -echo "configure:2677: checking for working const" >&5 +echo "configure:2711: checking for working const" >&5 if eval "test \"`echo '$''{'ac_cv_c_const'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 2682 "configure" +#line 2716 "configure" #include "confdefs.h" int main() { @@ -2727,7 +2761,7 @@ ccp = (char const *const *) p; ; return 0; } EOF -if { (eval echo configure:2731: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2765: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_c_const=yes else @@ -2748,21 +2782,21 @@ EOF fi echo $ac_n "checking for inline""... $ac_c" 1>&6 -echo "configure:2752: checking for inline" >&5 +echo "configure:2786: checking for inline" >&5 if eval "test \"`echo '$''{'ac_cv_c_inline'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_cv_c_inline=no for ac_kw in inline __inline__ __inline; do cat > conftest.$ac_ext <<EOF -#line 2759 "configure" +#line 2793 "configure" #include "confdefs.h" int main() { } $ac_kw foo() { ; return 0; } EOF -if { (eval echo configure:2766: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2800: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_c_inline=$ac_kw; break else @@ -2788,12 +2822,12 @@ EOF esac echo $ac_n "checking for off_t""... $ac_c" 1>&6 -echo "configure:2792: checking for off_t" >&5 +echo "configure:2826: checking for off_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_off_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 2797 "configure" +#line 2831 "configure" #include "confdefs.h" #include <sys/types.h> #if STDC_HEADERS @@ -2821,12 +2855,12 @@ EOF fi echo $ac_n "checking for size_t""... $ac_c" 1>&6 -echo "configure:2825: checking for size_t" >&5 +echo "configure:2859: checking for size_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_size_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 2830 "configure" +#line 2864 "configure" #include "confdefs.h" #include <sys/types.h> #if STDC_HEADERS @@ -2856,19 +2890,19 @@ fi # The Ultrix 4.2 mips builtin alloca declared by alloca.h only works # for constant arguments. Useless! echo $ac_n "checking for working alloca.h""... $ac_c" 1>&6 -echo "configure:2860: checking for working alloca.h" >&5 +echo "configure:2894: checking for working alloca.h" >&5 if eval "test \"`echo '$''{'ac_cv_header_alloca_h'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 2865 "configure" +#line 2899 "configure" #include "confdefs.h" #include <alloca.h> int main() { char *p = alloca(2 * sizeof(int)); ; return 0; } EOF -if { (eval echo configure:2872: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2906: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ac_cv_header_alloca_h=yes else @@ -2889,12 +2923,12 @@ EOF fi echo $ac_n "checking for alloca""... $ac_c" 1>&6 -echo "configure:2893: checking for alloca" >&5 +echo "configure:2927: checking for alloca" >&5 if eval "test \"`echo '$''{'ac_cv_func_alloca_works'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 2898 "configure" +#line 2932 "configure" #include "confdefs.h" #ifdef __GNUC__ @@ -2922,7 +2956,7 @@ int main() { char *p = (char *) alloca(1); ; return 0; } EOF -if { (eval echo configure:2926: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2960: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ac_cv_func_alloca_works=yes else @@ -2954,12 +2988,12 @@ EOF echo $ac_n "checking whether alloca needs Cray hooks""... $ac_c" 1>&6 -echo "configure:2958: checking whether alloca needs Cray hooks" >&5 +echo "configure:2992: checking whether alloca needs Cray hooks" >&5 if eval "test \"`echo '$''{'ac_cv_os_cray'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 2963 "configure" +#line 2997 "configure" #include "confdefs.h" #if defined(CRAY) && ! defined(CRAY2) webecray @@ -2984,12 +3018,12 @@ echo "$ac_t""$ac_cv_os_cray" 1>&6 if test $ac_cv_os_cray = yes; then for ac_func in _getb67 GETB67 getb67; do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:2988: checking for $ac_func" >&5 +echo "configure:3022: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 2993 "configure" +#line 3027 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func(); below. */ @@ -3012,7 +3046,7 @@ $ac_func(); ; return 0; } EOF -if { (eval echo configure:3016: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3050: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -3039,7 +3073,7 @@ done fi echo $ac_n "checking stack direction for C alloca""... $ac_c" 1>&6 -echo "configure:3043: checking stack direction for C alloca" >&5 +echo "configure:3077: checking stack direction for C alloca" >&5 if eval "test \"`echo '$''{'ac_cv_c_stack_direction'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3047,7 +3081,7 @@ else ac_cv_c_stack_direction=0 else cat > conftest.$ac_ext <<EOF -#line 3051 "configure" +#line 3085 "configure" #include "confdefs.h" find_stack_direction () { @@ -3066,7 +3100,7 @@ main () exit (find_stack_direction() < 0); } EOF -if { (eval echo configure:3070: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:3104: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_c_stack_direction=1 else @@ -3087,21 +3121,21 @@ EOF fi -for ac_hdr in unistd.h +for ac_hdr in stdlib.h unistd.h sys/stat.h sys/types.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:3095: checking for $ac_hdr" >&5 +echo "configure:3129: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 3100 "configure" +#line 3134 "configure" #include "confdefs.h" #include <$ac_hdr> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:3105: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:3139: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -3130,12 +3164,12 @@ done for ac_func in getpagesize do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:3134: checking for $ac_func" >&5 +echo "configure:3168: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 3139 "configure" +#line 3173 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func(); below. */ @@ -3158,7 +3192,7 @@ $ac_func(); ; return 0; } EOF -if { (eval echo configure:3162: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3196: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -3183,7 +3217,7 @@ fi done echo $ac_n "checking for working mmap""... $ac_c" 1>&6 -echo "configure:3187: checking for working mmap" >&5 +echo "configure:3221: checking for working mmap" >&5 if eval "test \"`echo '$''{'ac_cv_func_mmap_fixed_mapped'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3191,7 +3225,7 @@ else ac_cv_func_mmap_fixed_mapped=no else cat > conftest.$ac_ext <<EOF -#line 3195 "configure" +#line 3229 "configure" #include "confdefs.h" /* Thanks to Mike Haertel and Jim Avera for this test. @@ -3219,11 +3253,24 @@ else #include <fcntl.h> #include <sys/mman.h> +#if HAVE_SYS_TYPES_H +# include <sys/types.h> +#endif + +#if HAVE_STDLIB_H +# include <stdlib.h> +#endif + +#if HAVE_SYS_STAT_H +# include <sys/stat.h> +#endif + +#if HAVE_UNISTD_H +# include <unistd.h> +#endif + /* This mess was copied from the GNU getpagesize.h. */ #ifndef HAVE_GETPAGESIZE -# ifdef HAVE_UNISTD_H -# include <unistd.h> -# endif /* Assume that all systems that can run configure have sys/param.h. */ # ifndef HAVE_SYS_PARAM_H @@ -3331,7 +3378,7 @@ main() } EOF -if { (eval echo configure:3335: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:3382: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_func_mmap_fixed_mapped=yes else @@ -3359,17 +3406,17 @@ unistd.h values.h sys/param.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:3363: checking for $ac_hdr" >&5 +echo "configure:3410: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 3368 "configure" +#line 3415 "configure" #include "confdefs.h" #include <$ac_hdr> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:3373: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:3420: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -3399,12 +3446,12 @@ done __argz_count __argz_stringify __argz_next do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:3403: checking for $ac_func" >&5 +echo "configure:3450: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 3408 "configure" +#line 3455 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func(); below. */ @@ -3427,7 +3474,7 @@ $ac_func(); ; return 0; } EOF -if { (eval echo configure:3431: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3478: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -3456,12 +3503,12 @@ done for ac_func in stpcpy do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:3460: checking for $ac_func" >&5 +echo "configure:3507: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 3465 "configure" +#line 3512 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func(); below. */ @@ -3484,7 +3531,7 @@ $ac_func(); ; return 0; } EOF -if { (eval echo configure:3488: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3535: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -3518,19 +3565,19 @@ EOF if test $ac_cv_header_locale_h = yes; then echo $ac_n "checking for LC_MESSAGES""... $ac_c" 1>&6 -echo "configure:3522: checking for LC_MESSAGES" >&5 +echo "configure:3569: checking for LC_MESSAGES" >&5 if eval "test \"`echo '$''{'am_cv_val_LC_MESSAGES'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 3527 "configure" +#line 3574 "configure" #include "confdefs.h" #include <locale.h> int main() { return LC_MESSAGES ; return 0; } EOF -if { (eval echo configure:3534: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3581: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* am_cv_val_LC_MESSAGES=yes else @@ -3551,7 +3598,7 @@ EOF fi fi echo $ac_n "checking whether NLS is requested""... $ac_c" 1>&6 -echo "configure:3555: checking whether NLS is requested" >&5 +echo "configure:3602: checking whether NLS is requested" >&5 # Check whether --enable-nls or --disable-nls was given. if test "${enable_nls+set}" = set; then enableval="$enable_nls" @@ -3571,7 +3618,7 @@ fi EOF echo $ac_n "checking whether included gettext is requested""... $ac_c" 1>&6 -echo "configure:3575: checking whether included gettext is requested" >&5 +echo "configure:3622: checking whether included gettext is requested" >&5 # Check whether --with-included-gettext or --without-included-gettext was given. if test "${with_included_gettext+set}" = set; then withval="$with_included_gettext" @@ -3590,17 +3637,17 @@ fi ac_safe=`echo "libintl.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for libintl.h""... $ac_c" 1>&6 -echo "configure:3594: checking for libintl.h" >&5 +echo "configure:3641: checking for libintl.h" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 3599 "configure" +#line 3646 "configure" #include "confdefs.h" #include <libintl.h> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:3604: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:3651: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -3617,19 +3664,19 @@ fi if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then echo "$ac_t""yes" 1>&6 echo $ac_n "checking for gettext in libc""... $ac_c" 1>&6 -echo "configure:3621: checking for gettext in libc" >&5 +echo "configure:3668: checking for gettext in libc" >&5 if eval "test \"`echo '$''{'gt_cv_func_gettext_libc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 3626 "configure" +#line 3673 "configure" #include "confdefs.h" #include <libintl.h> int main() { return (int) gettext ("") ; return 0; } EOF -if { (eval echo configure:3633: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3680: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* gt_cv_func_gettext_libc=yes else @@ -3645,7 +3692,7 @@ echo "$ac_t""$gt_cv_func_gettext_libc" 1>&6 if test "$gt_cv_func_gettext_libc" != "yes"; then echo $ac_n "checking for bindtextdomain in -lintl""... $ac_c" 1>&6 -echo "configure:3649: checking for bindtextdomain in -lintl" >&5 +echo "configure:3696: checking for bindtextdomain in -lintl" >&5 ac_lib_var=`echo intl'_'bindtextdomain | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -3653,7 +3700,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lintl $LIBS" cat > conftest.$ac_ext <<EOF -#line 3657 "configure" +#line 3704 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 @@ -3664,7 +3711,7 @@ int main() { bindtextdomain() ; return 0; } EOF -if { (eval echo configure:3668: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3715: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -3680,19 +3727,19 @@ fi if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then echo "$ac_t""yes" 1>&6 echo $ac_n "checking for gettext in libintl""... $ac_c" 1>&6 -echo "configure:3684: checking for gettext in libintl" >&5 +echo "configure:3731: checking for gettext in libintl" >&5 if eval "test \"`echo '$''{'gt_cv_func_gettext_libintl'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 3689 "configure" +#line 3736 "configure" #include "confdefs.h" int main() { return (int) gettext ("") ; return 0; } EOF -if { (eval echo configure:3696: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3743: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* gt_cv_func_gettext_libintl=yes else @@ -3720,7 +3767,7 @@ EOF # Extract the first word of "msgfmt", so it can be a program name with args. set dummy msgfmt; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3724: checking for $ac_word" >&5 +echo "configure:3771: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_MSGFMT'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3754,12 +3801,12 @@ fi for ac_func in dcgettext do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:3758: checking for $ac_func" >&5 +echo "configure:3805: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 3763 "configure" +#line 3810 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func(); below. */ @@ -3782,7 +3829,7 @@ $ac_func(); ; return 0; } EOF -if { (eval echo configure:3786: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3833: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -3809,7 +3856,7 @@ done # Extract the first word of "gmsgfmt", so it can be a program name with args. set dummy gmsgfmt; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3813: checking for $ac_word" >&5 +echo "configure:3860: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_GMSGFMT'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3845,7 +3892,7 @@ fi # Extract the first word of "xgettext", so it can be a program name with args. set dummy xgettext; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3849: checking for $ac_word" >&5 +echo "configure:3896: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_XGETTEXT'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3877,7 +3924,7 @@ else fi cat > conftest.$ac_ext <<EOF -#line 3881 "configure" +#line 3928 "configure" #include "confdefs.h" int main() { @@ -3885,7 +3932,7 @@ extern int _nl_msg_cat_cntr; return _nl_msg_cat_cntr ; return 0; } EOF -if { (eval echo configure:3889: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3936: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* CATOBJEXT=.gmo DATADIRNAME=share @@ -3917,7 +3964,7 @@ fi # Extract the first word of "msgfmt", so it can be a program name with args. set dummy msgfmt; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3921: checking for $ac_word" >&5 +echo "configure:3968: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_MSGFMT'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3951,7 +3998,7 @@ fi # Extract the first word of "gmsgfmt", so it can be a program name with args. set dummy gmsgfmt; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3955: checking for $ac_word" >&5 +echo "configure:4002: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_GMSGFMT'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3987,7 +4034,7 @@ fi # Extract the first word of "xgettext", so it can be a program name with args. set dummy xgettext; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3991: checking for $ac_word" >&5 +echo "configure:4038: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_XGETTEXT'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -4077,7 +4124,7 @@ fi LINGUAS= else echo $ac_n "checking for catalogs to be installed""... $ac_c" 1>&6 -echo "configure:4081: checking for catalogs to be installed" >&5 +echo "configure:4128: checking for catalogs to be installed" >&5 NEW_LINGUAS= for lang in ${LINGUAS=$ALL_LINGUAS}; do case "$ALL_LINGUAS" in @@ -4105,17 +4152,17 @@ echo "configure:4081: checking for catalogs to be installed" >&5 if test "$CATOBJEXT" = ".cat"; then ac_safe=`echo "linux/version.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for linux/version.h""... $ac_c" 1>&6 -echo "configure:4109: checking for linux/version.h" >&5 +echo "configure:4156: checking for linux/version.h" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 4114 "configure" +#line 4161 "configure" #include "confdefs.h" #include <linux/version.h> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:4119: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:4166: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -4160,7 +4207,7 @@ fi l= - if test -d $srcdir/po; then + if test -f $srcdir/po/POTFILES.in; then test -d po || mkdir po if test "x$srcdir" != "x."; then if test "x`echo $srcdir | sed 's@/.*@@'`" = "x"; then @@ -4178,7 +4225,7 @@ fi echo $ac_n "checking whether to enable maintainer-specific portions of Makefiles""... $ac_c" 1>&6 -echo "configure:4182: checking whether to enable maintainer-specific portions of Makefiles" >&5 +echo "configure:4229: checking whether to enable maintainer-specific portions of Makefiles" >&5 # Check whether --enable-maintainer-mode or --disable-maintainer-mode was given. if test "${enable_maintainer_mode+set}" = set; then enableval="$enable_maintainer_mode" @@ -4203,7 +4250,7 @@ fi echo $ac_n "checking for executable suffix""... $ac_c" 1>&6 -echo "configure:4207: checking for executable suffix" >&5 +echo "configure:4254: checking for executable suffix" >&5 if eval "test \"`echo '$''{'ac_cv_exeext'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -4213,10 +4260,10 @@ else rm -f conftest* echo 'int main () { return 0; }' > conftest.$ac_ext ac_cv_exeext= - if { (eval echo configure:4217: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then + if { (eval echo configure:4264: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then for file in conftest.*; do case $file in - *.c | *.o | *.obj | *.ilk | *.pdb) ;; + *.c | *.o | *.obj) ;; *) ac_cv_exeext=`echo $file | sed -e s/conftest//` ;; esac done @@ -4238,17 +4285,17 @@ for ac_hdr in sys/gmon_out.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:4242: checking for $ac_hdr" >&5 +echo "configure:4289: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 4247 "configure" +#line 4294 "configure" #include "confdefs.h" #include <$ac_hdr> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:4252: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:4299: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -4275,55 +4322,7 @@ fi done -echo $ac_n "checking the size of gmon pointers""... $ac_c" 1>&6 -echo "configure:4280: checking the size of gmon pointers" >&5 -if test "$cross_compiling" = yes; then - gmon_ptr_size=4 -else - cat > conftest.$ac_ext <<EOF -#line 4285 "configure" -#include "confdefs.h" -#include <stdio.h> -#include <stdlib.h> -#if HAVE_SYS_GMON_OUT_H -#include <sys/gmon_out.h> -#endif -main() -{ -#if HAVE_SYS_GMON_OUT_H - struct gmon_cg_arc_record arc; - FILE *f=fopen("conftestval", "w"); - if (!f) exit(1); - fprintf(f, "%d\n", sizeof(arc.from_pc)); - exit(0); -#else - FILE *f=fopen("conftestval", "w"); - if (!f) exit(1); - fprintf(f, "%d\n", (int) sizeof(char *)); - exit(1); -#endif -} -EOF -if { (eval echo configure:4308: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null -then - gmon_ptr_size=`cat conftestval` -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -fr conftest* - gmon_ptr_size=4 -fi -rm -fr conftest* -fi - -echo "$ac_t""$gmon_ptr_size" 1>&6 - -cat >> confdefs.h <<EOF -#define GMON_PTR_SIZE $gmon_ptr_size -EOF - - -build_warnings="-W -Wall" +build_warnings="-W -Wall -Wstrict-prototypes -Wmissing-prototypes" # Check whether --enable-build-warnings or --disable-build-warnings was given. if test "${enable_build_warnings+set}" = set; then enableval="$enable_build_warnings" diff --git a/gnu/usr.bin/binutils/gprof/configure.in b/gnu/usr.bin/binutils/gprof/configure.in index 7d6ca2cc25a..8956171b6c0 100644 --- a/gnu/usr.bin/binutils/gprof/configure.in +++ b/gnu/usr.bin/binutils/gprof/configure.in @@ -23,7 +23,7 @@ AC_PROG_INSTALL AC_CHECK_FUNCS(setmode) -ALL_LINGUAS= +ALL_LINGUAS="fr tr sv es id da pt_BR" CY_GNU_GETTEXT AM_MAINTAINER_MODE @@ -31,32 +31,7 @@ AC_EXEEXT AC_CHECK_HEADERS(sys/gmon_out.h) -AC_MSG_CHECKING(the size of gmon pointers) -AC_TRY_RUN([#include <stdio.h> -#include <stdlib.h> -#if HAVE_SYS_GMON_OUT_H -#include <sys/gmon_out.h> -#endif -main() -{ -#if HAVE_SYS_GMON_OUT_H - struct gmon_cg_arc_record arc; - FILE *f=fopen("conftestval", "w"); - if (!f) exit(1); - fprintf(f, "%d\n", sizeof(arc.from_pc)); - exit(0); -#else - FILE *f=fopen("conftestval", "w"); - if (!f) exit(1); - fprintf(f, "%d\n", (int) sizeof(char *)); - exit(1); -#endif -}], gmon_ptr_size=`cat conftestval`, gmon_ptr_size=4, gmon_ptr_size=4) -AC_MSG_RESULT($gmon_ptr_size) - -AC_DEFINE_UNQUOTED(GMON_PTR_SIZE, $gmon_ptr_size) - -build_warnings="-W -Wall" +build_warnings="-W -Wall -Wstrict-prototypes -Wmissing-prototypes" AC_ARG_ENABLE(build-warnings, [ --enable-build-warnings Enable build-time compiler warnings if gcc is used], [case "${enableval}" in diff --git a/gnu/usr.bin/binutils/gprof/gen-c-prog.awk b/gnu/usr.bin/binutils/gprof/gen-c-prog.awk index b59c1f8d8dd..b235a64a451 100644 --- a/gnu/usr.bin/binutils/gprof/gen-c-prog.awk +++ b/gnu/usr.bin/binutils/gprof/gen-c-prog.awk @@ -3,6 +3,7 @@ NR == 1 { print "/* ==> Do not modify this file!! It is created automatically" printf " from %s using the gen-c-prog.awk script. <== */\n\n", FILE print "#include <stdio.h>" + print "#include \"ansidecl.h\"" } { @@ -12,6 +13,7 @@ NR == 1 { print "}" curfun = FUNCTION print "" + print "void ", FUNCTION, "PARAMS ((FILE *));" print "void"; printf "%s (file)\n", FUNCTION print " FILE *file;"; diff --git a/gnu/usr.bin/binutils/gprof/gmon.h b/gnu/usr.bin/binutils/gprof/gmon.h index 72edbfbf04f..7f1c333525e 100644 --- a/gnu/usr.bin/binutils/gprof/gmon.h +++ b/gnu/usr.bin/binutils/gprof/gmon.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 1983, 1993, 2001 + * Copyright (c) 1983, 1991, 1993, 2001 * The Regents of the University of California. All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -29,37 +29,53 @@ #ifndef gmon_h #define gmon_h -struct raw_phdr - { - /* FIXME: Checking a host compiler define means that we can't use - a cross gprof to the alpha. */ - char low_pc[GMON_PTR_SIZE]; /* base pc address of sample buffer */ - char high_pc[GMON_PTR_SIZE];/* max pc address of sampled buffer */ - char ncnt[4]; /* size of sample buffer (plus this header) */ +/* Size of the 4.4BSD gmon header */ +#define GMON_HDRSIZE_BSD44_32 (4 + 4 + 4 + 4 + 4 + (3 * 4)) +#define GMON_HDRSIZE_BSD44_64 (8 + 8 + 4 + 4 + 4 + (3 * 4)) - char version[4]; /* version number */ - char profrate[4]; /* profiling clock rate */ - char spare[3*4]; /* reserved */ - }; +#if 0 /* For documentation purposes only. */ + struct raw_phdr + { + char low_pc[sizeof(void *)]; /* base pc address of sample buffer */ + char high_pc[sizeof(void *)];/* max pc address of sampled buffer */ + char ncnt[4]; /* size of sample buffer (plus this + header) */ + + char version[4]; /* version number */ + char profrate[4]; /* profiling clock rate */ + char spare[3*4]; /* reserved */ + }; +#endif #define GMONVERSION 0x00051879 -struct old_raw_phdr - { - char low_pc[GMON_PTR_SIZE]; /* base pc address of sample buffer */ - char high_pc[GMON_PTR_SIZE];/* max pc address of sampled buffer */ - char ncnt[4]; /* size of sample buffer (plus this header) */ +/* Size of the old BSD gmon header */ +#define GMON_HDRSIZE_OLDBSD_32 (4 + 4 + 4) + +/* FIXME: Checking host compiler defines here means that we can't + use a cross gprof alpha OSF. */ +#if defined(__alpha__) && defined (__osf__) +#define GMON_HDRSIZE_OLDBSD_64 (8 + 8 + 4 + 4) +#else +#define GMON_HDRSIZE_OLDBSD_64 (8 + 8 + 4) +#endif - /* FIXME: Checking host compiler defines here means that we can't - use a cross gprof alpha OSF. */ +#if 0 /* For documentation purposes only. */ + struct old_raw_phdr + { + char low_pc[sizeof(void *)]; /* base pc address of sample buffer */ + char high_pc[sizeof(void *)];/* max pc address of sampled buffer */ + char ncnt[4]; /* size of sample buffer (plus this + header) */ #if defined (__alpha__) && defined (__osf__) - /* - * DEC's OSF v3.0 uses 4 bytes of padding to bring the header to - * a size that is a multiple of 8. - */ - char pad[4]; + /* + * DEC's OSF v3.0 uses 4 bytes of padding to bring the header to + * a size that is a multiple of 8. + */ + char pad[4]; +#endif + }; #endif - }; /* * Histogram counters are unsigned shorts: @@ -114,12 +130,14 @@ struct tostruct * as to get a packed representation (otherwise, different compilers * might introduce different padding): */ -struct raw_arc - { - char from_pc[GMON_PTR_SIZE]; - char self_pc[GMON_PTR_SIZE]; - char count[4]; - }; +#if 0 /* For documentation purposes only. */ + struct raw_arc + { + char from_pc[sizeof(void *)]; + char self_pc[sizeof(void *)]; + char count[sizeof(long)]; + }; +#endif /* * General rounding functions: diff --git a/gnu/usr.bin/binutils/gprof/gmon_io.c b/gnu/usr.bin/binutils/gprof/gmon_io.c index cff132cb5aa..6188631f101 100644 --- a/gnu/usr.bin/binutils/gprof/gmon_io.c +++ b/gnu/usr.bin/binutils/gprof/gmon_io.c @@ -1,6 +1,6 @@ /* gmon_io.c - Input and output from/to gmon.out files. - Copyright 2000, 2001 Free Software Foundation, Inc. + Copyright 2000, 2001, 2002 Free Software Foundation, Inc. This file is part of GNU Binutils. @@ -19,53 +19,88 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ +#include "gprof.h" +#include "search_list.h" +#include "source.h" +#include "symtab.h" #include "cg_arcs.h" #include "basic_blocks.h" -#include "bfd.h" #include "corefile.h" #include "call_graph.h" #include "gmon_io.h" #include "gmon_out.h" #include "gmon.h" /* Fetch header for old format. */ -#include "gprof.h" #include "hertz.h" #include "hist.h" #include "libiberty.h" +enum gmon_ptr_size { + ptr_32bit, + ptr_64bit +}; + +enum gmon_ptr_signedness { + ptr_signed, + ptr_unsigned +}; + +static enum gmon_ptr_size gmon_get_ptr_size PARAMS ((void)); +static enum gmon_ptr_signedness gmon_get_ptr_signedness PARAMS ((void)); + +#ifdef BFD_HOST_U_64_BIT +static int gmon_io_read_64 PARAMS ((FILE *, BFD_HOST_U_64_BIT *)); +static int gmon_io_write_64 PARAMS ((FILE *, BFD_HOST_U_64_BIT)); +#endif +static int gmon_read_raw_arc + PARAMS ((FILE *, bfd_vma *, bfd_vma *, unsigned long *)); +static int gmon_write_raw_arc + PARAMS ((FILE *, bfd_vma, bfd_vma, unsigned long)); + int gmon_input = 0; int gmon_file_version = 0; /* 0 == old (non-versioned) file format. */ -int -DEFUN (gmon_io_read_vma, (ifp, valp), FILE * ifp AND bfd_vma *valp) +static enum gmon_ptr_size +gmon_get_ptr_size () { - char buf[8]; - bfd_vma val; + int size; + + /* Pick best size for pointers. Start with the ELF size, and if not + elf go with the architecture's address size. */ + size = bfd_get_arch_size (core_bfd); + if (size == -1) + size = bfd_arch_bits_per_address (core_bfd); - switch (GMON_PTR_SIZE) + switch (size) { - case 4: - if (fread (buf, 1, 4, ifp) != 4) - return 1; - val = bfd_get_32 (core_bfd, buf); - break; + case 32: + return ptr_32bit; - case 8: - if (fread (buf, 1, 8, ifp) != 8) - return 1; - val = bfd_get_64 (core_bfd, buf); - break; + case 64: + return ptr_64bit; default: - fprintf (stderr, _("%s: GMON_PTR_SIZE has unexpected value of %u\n"), - whoami, GMON_PTR_SIZE); + fprintf (stderr, _("%s: address size has unexpected value of %u\n"), + whoami, size); done (1); } - *valp = val; - return 0; +} + +static enum gmon_ptr_signedness +gmon_get_ptr_signedness () +{ + int sext; + + /* Figure out whether to sign extend. If BFD doesn't know, assume no. */ + sext = bfd_get_sign_extend_vma (core_bfd); + if (sext == -1) + return ptr_unsigned; + return (sext ? ptr_signed : ptr_unsigned); } int -DEFUN (gmon_io_read_32, (ifp, valp), FILE * ifp AND unsigned int *valp) +gmon_io_read_32 (ifp, valp) + FILE *ifp; + unsigned int *valp; { char buf[4]; @@ -75,54 +110,124 @@ DEFUN (gmon_io_read_32, (ifp, valp), FILE * ifp AND unsigned int *valp) return 0; } -int -DEFUN (gmon_io_read, (ifp, buf, n), FILE * ifp AND char *buf AND size_t n) +#ifdef BFD_HOST_U_64_BIT +static int +gmon_io_read_64 (ifp, valp) + FILE *ifp; + BFD_HOST_U_64_BIT *valp; { - if (fread (buf, 1, n, ifp) != n) + char buf[8]; + + if (fread (buf, 1, 8, ifp) != 8) return 1; + *valp = bfd_get_64 (core_bfd, buf); return 0; } +#endif int -DEFUN (gmon_io_write_vma, (ofp, val), FILE * ofp AND bfd_vma val) +gmon_io_read_vma (ifp, valp) + FILE *ifp; + bfd_vma *valp; { - char buf[8]; + unsigned int val32; +#ifdef BFD_HOST_U_64_BIT + BFD_HOST_U_64_BIT val64; +#endif - switch (GMON_PTR_SIZE) + switch (gmon_get_ptr_size ()) { - case 4: - bfd_put_32 (core_bfd, val, buf); - if (fwrite (buf, 1, 4, ofp) != 4) + case ptr_32bit: + if (gmon_io_read_32 (ifp, &val32)) return 1; + if (gmon_get_ptr_signedness () == ptr_signed) + *valp = (int) val32; + else + *valp = val32; break; - case 8: - bfd_put_64 (core_bfd, val, buf); - if (fwrite (buf, 1, 8, ofp) != 8) +#ifdef BFD_HOST_U_64_BIT + case ptr_64bit: + if (gmon_io_read_64 (ifp, &val64)) return 1; +#ifdef BFD_HOST_64_BIT + if (gmon_get_ptr_signedness () == ptr_signed) + *valp = (BFD_HOST_64_BIT) val64; + else +#endif + *valp = val64; break; - - default: - fprintf (stderr, _("%s: GMON_PTR_SIZE has unexpected value of %u\n"), - whoami, GMON_PTR_SIZE); - done (1); +#endif } return 0; } int -DEFUN (gmon_io_write_32, (ofp, val), FILE * ofp AND unsigned int val) +gmon_io_read (ifp, buf, n) + FILE *ifp; + char *buf; + size_t n; +{ + if (fread (buf, 1, n, ifp) != n) + return 1; + return 0; +} + +int +gmon_io_write_32 (ofp, val) + FILE *ofp; + unsigned int val; { char buf[4]; - bfd_put_32 (core_bfd, val, buf); + bfd_put_32 (core_bfd, (bfd_vma) val, buf); if (fwrite (buf, 1, 4, ofp) != 4) return 1; return 0; } +#ifdef BFD_HOST_U_64_BIT +static int +gmon_io_write_64 (ofp, val) + FILE *ofp; + BFD_HOST_U_64_BIT val; +{ + char buf[8]; + + bfd_put_64 (core_bfd, (bfd_vma) val, buf); + if (fwrite (buf, 1, 8, ofp) != 8) + return 1; + return 0; +} +#endif + +int +gmon_io_write_vma (ofp, val) + FILE *ofp; + bfd_vma val; +{ + + switch (gmon_get_ptr_size ()) + { + case ptr_32bit: + if (gmon_io_write_32 (ofp, (unsigned int) val)) + return 1; + break; + +#ifdef BFD_HOST_U_64_BIT + case ptr_64bit: + if (gmon_io_write_64 (ofp, (BFD_HOST_U_64_BIT) val)) + return 1; + break; +#endif + } + return 0; +} + int -DEFUN (gmon_io_write_8, (ofp, val), FILE * ofp AND unsigned char val) +gmon_io_write_8 (ofp, val) + FILE *ofp; + unsigned int val; { char buf[1]; @@ -133,50 +238,83 @@ DEFUN (gmon_io_write_8, (ofp, val), FILE * ofp AND unsigned char val) } int -DEFUN (gmon_io_write, (ofp, buf, n), FILE * ofp AND char *buf AND size_t n) +gmon_io_write (ofp, buf, n) + FILE *ofp; + char *buf; + size_t n; { if (fwrite (buf, 1, n, ofp) != n) return 1; return 0; } -/* get_vma and put_vma are for backwards compatibility only */ -static bfd_vma -DEFUN (get_vma, (abfd, addr), bfd * abfd AND bfd_byte * addr) +static int +gmon_read_raw_arc (ifp, fpc, spc, cnt) + FILE *ifp; + bfd_vma *fpc; + bfd_vma *spc; + unsigned long *cnt; { - switch (sizeof (char*)) +#ifdef BFD_HOST_U_64_BIT + BFD_HOST_U_64_BIT cnt64; +#endif + unsigned int cnt32; + + if (gmon_io_read_vma (ifp, fpc) + || gmon_io_read_vma (ifp, spc)) + return 1; + + switch (gmon_get_ptr_size ()) { - case 4: - return bfd_get_32 (abfd, addr); - case 8: - return bfd_get_64 (abfd, addr); - default: - fprintf (stderr, _("%s: bfd_vma has unexpected size of %ld bytes\n"), - whoami, (long) sizeof (char*)); - done (1); + case ptr_32bit: + if (gmon_io_read_32 (ifp, &cnt32)) + return 1; + *cnt = cnt32; + break; + +#ifdef BFD_HOST_U_64_BIT + case ptr_64bit: + if (gmon_io_read_64 (ifp, &cnt64)) + return 1; + *cnt = cnt64; + break; +#endif } + return 0; } -static void -DEFUN (put_vma, (abfd, val, addr), bfd * abfd AND bfd_vma val AND bfd_byte * addr) +static int +gmon_write_raw_arc (ofp, fpc, spc, cnt) + FILE *ofp; + bfd_vma fpc; + bfd_vma spc; + unsigned long cnt; { - switch (sizeof (char*)) + + if (gmon_io_write_vma (ofp, fpc) + || gmon_io_write_vma (ofp, spc)) + return 1; + + switch (gmon_get_ptr_size ()) { - case 4: - bfd_put_32 (abfd, val, addr); + case ptr_32bit: + if (gmon_io_write_32 (ofp, (unsigned int) cnt)) + return 1; break; - case 8: - bfd_put_64 (abfd, val, addr); + +#ifdef BFD_HOST_U_64_BIT + case ptr_64bit: + if (gmon_io_write_64 (ofp, (BFD_HOST_U_64_BIT) cnt)) + return 1; break; - default: - fprintf (stderr, _("%s: bfd_vma has unexpected size of %ld bytes\n"), - whoami, (long) sizeof (char*)); - done (1); +#endif } + return 0; } void -DEFUN (gmon_out_read, (filename), const char *filename) +gmon_out_read (filename) + const char *filename; { FILE *ifp; struct gmon_hdr ghdr; @@ -271,14 +409,13 @@ DEFUN (gmon_out_read, (filename), const char *filename) bfd_vma high_pc; int ncnt; }; - int i, samp_bytes, header_size; + int i, samp_bytes, header_size = 0; unsigned long count; bfd_vma from_pc, self_pc; - struct raw_arc raw_arc; - struct raw_phdr raw; static struct hdr h; UNIT raw_bin_count; struct hdr tmp; + int version; /* Information from a gmon.out file is in two parts: an array of sampling hits within pc ranges, and the arcs. */ @@ -293,25 +430,29 @@ DEFUN (gmon_out_read, (filename), const char *filename) done (1); } - if (fread (&raw, 1, sizeof (struct raw_phdr), ifp) - != sizeof (struct raw_phdr)) + /* The beginning of the old BSD header and the 4.4BSD header + are the same: lowpc, highpc, ncnt */ + if (gmon_io_read_vma (ifp, &tmp.low_pc) + || gmon_io_read_vma (ifp, &tmp.high_pc) + || gmon_io_read_32 (ifp, &tmp.ncnt)) { - fprintf (stderr, _("%s: file too short to be a gmon file\n"), + bad_gmon_file: + fprintf (stderr, _("%s: file too short to be a gmon file\n"), filename); done (1); } - tmp.low_pc = get_vma (core_bfd, (bfd_byte *) &raw.low_pc[0]); - tmp.high_pc = get_vma (core_bfd, (bfd_byte *) &raw.high_pc[0]); - tmp.ncnt = bfd_get_32 (core_bfd, (bfd_byte *) &raw.ncnt[0]); + /* Check to see if this a 4.4BSD-style header. */ + if (gmon_io_read_32 (ifp, &version)) + goto bad_gmon_file; - if (bfd_get_32 (core_bfd, (bfd_byte *) &raw.version[0]) - == GMONVERSION) + if (version == GMONVERSION) { int profrate; /* 4.4BSD format header. */ - profrate = bfd_get_32 (core_bfd, (bfd_byte *) &raw.profrate[0]); + if (gmon_io_read_32 (ifp, &profrate)) + goto bad_gmon_file; if (!s_highpc) hz = profrate; @@ -323,7 +464,16 @@ DEFUN (gmon_out_read, (filename), const char *filename) done (1); } - header_size = sizeof (struct raw_phdr); + switch (gmon_get_ptr_size ()) + { + case ptr_32bit: + header_size = GMON_HDRSIZE_BSD44_32; + break; + + case ptr_64bit: + header_size = GMON_HDRSIZE_BSD44_64; + break; + } } else { @@ -335,13 +485,23 @@ DEFUN (gmon_out_read, (filename), const char *filename) done (1); } - if (fseek (ifp, sizeof (struct old_raw_phdr), SEEK_SET) < 0) + switch (gmon_get_ptr_size ()) { - perror (filename); - done (1); + case ptr_32bit: + header_size = GMON_HDRSIZE_OLDBSD_32; + break; + + case ptr_64bit: + header_size = GMON_HDRSIZE_OLDBSD_64; + break; } + } - header_size = sizeof (struct old_raw_phdr); + /* Position the file to after the header. */ + if (fseek (ifp, header_size, SEEK_SET) < 0) + { + perror (filename); + done (1); } if (s_highpc && (tmp.low_pc != h.low_pc @@ -406,12 +566,9 @@ DEFUN (gmon_out_read, (filename), const char *filename) /* The rest of the file consists of a bunch of <from,self,count> tuples. */ - while (fread (&raw_arc, sizeof (raw_arc), 1, ifp) == 1) + while (gmon_read_raw_arc (ifp, &from_pc, &self_pc, &count) == 0) { ++narcs; - from_pc = get_vma (core_bfd, (bfd_byte *) raw_arc.from_pc); - self_pc = get_vma (core_bfd, (bfd_byte *) raw_arc.self_pc); - count = bfd_get_32 (core_bfd, (bfd_byte *) raw_arc.count); DBG (SAMPLEDEBUG, printf ("[gmon_out_read] frompc 0x%lx selfpc 0x%lx count %lu\n", @@ -447,19 +604,23 @@ DEFUN (gmon_out_read, (filename), const char *filename) { printf (_("File `%s' (version %d) contains:\n"), filename, gmon_file_version); - printf (_("\t%d histogram record%s\n"), - nhist, nhist == 1 ? "" : "s"); - printf (_("\t%d call-graph record%s\n"), - narcs, narcs == 1 ? "" : "s"); - printf (_("\t%d basic-block count record%s\n"), - nbbs, nbbs == 1 ? "" : "s"); + printf (nhist == 1 ? + _("\t%d histogram record\n") : + _("\t%d histogram records\n"), nhist); + printf (narcs == 1 ? + _("\t%d call-graph record\n") : + _("\t%d call-graph records\n"), narcs); + printf (nbbs == 1 ? + _("\t%d basic-block count record\n") : + _("\t%d basic-block count records\n"), nbbs); first_output = FALSE; } } void -DEFUN (gmon_out_write, (filename), const char *filename) +gmon_out_write (filename) + const char *filename; { FILE *ofp; struct gmon_hdr ghdr; @@ -476,7 +637,7 @@ DEFUN (gmon_out_write, (filename), const char *filename) /* Write gmon header. */ memcpy (&ghdr.cookie[0], GMON_MAGIC, 4); - bfd_put_32 (core_bfd, GMON_VERSION, (bfd_byte *) ghdr.version); + bfd_put_32 (core_bfd, (bfd_vma) GMON_VERSION, (bfd_byte *) ghdr.version); if (fwrite (&ghdr, sizeof (ghdr), 1, ofp) != 1) { @@ -498,47 +659,90 @@ DEFUN (gmon_out_write, (filename), const char *filename) } else if (file_format == FF_BSD || file_format == FF_BSD44) { - struct raw_arc raw_arc; UNIT raw_bin_count; - struct raw_phdr h; - int i; + int i, hdrsize; + unsigned padsize; + char pad[3*4]; Arc *arc; Sym *sym; - memset (&h, 0, sizeof h); - put_vma (core_bfd, s_lowpc, (bfd_byte *) &h.low_pc); - put_vma (core_bfd, s_highpc, (bfd_byte *) &h.high_pc); - bfd_put_32 (core_bfd, - hist_num_bins * sizeof (UNIT) + sizeof (struct raw_phdr), - (bfd_byte *) &h.ncnt); + memset (pad, 0, sizeof (pad)); - /* Write header. Use new style BSD format is explicitly - specified, or if the profiling rate is non-standard; - otherwise, use the old BSD format. */ + hdrsize = 0; + /* Decide how large the header will be. Use the 4.4BSD format + header if explicitly specified, or if the profiling rate is + non-standard. Otherwise, use the old BSD format. */ if (file_format == FF_BSD44 - || hz != hertz ()) + || hz != hertz()) { - bfd_put_32 (core_bfd, GMONVERSION, (bfd_byte *) &h.version); - bfd_put_32 (core_bfd, hz, (bfd_byte *) &h.profrate); - if (fwrite (&h, sizeof (struct raw_phdr), 1, ofp) != 1) + padsize = 3*4; + switch (gmon_get_ptr_size ()) { - perror (filename); - done (1); + case ptr_32bit: + hdrsize = GMON_HDRSIZE_BSD44_32; + break; + + case ptr_64bit: + hdrsize = GMON_HDRSIZE_BSD44_64; + break; } } else { - if (fwrite (&h, sizeof (struct old_raw_phdr), 1, ofp) != 1) + padsize = 0; + switch (gmon_get_ptr_size ()) + { + case ptr_32bit: + hdrsize = GMON_HDRSIZE_OLDBSD_32; + break; + + case ptr_64bit: + hdrsize = GMON_HDRSIZE_OLDBSD_64; + /* FIXME: Checking host compiler defines here means that we can't + use a cross gprof alpha OSF. */ +#if defined(__alpha__) && defined (__osf__) + padsize = 4; +#endif + break; + } + } + + /* Write the parts of the headers that are common to both the + old BSD and 4.4BSD formats. */ + if (gmon_io_write_vma (ofp, s_lowpc) + || gmon_io_write_vma (ofp, s_highpc) + || gmon_io_write_32 (ofp, hist_num_bins * sizeof (UNIT) + hdrsize)) + { + perror (filename); + done (1); + } + + /* Write out the 4.4BSD header bits, if that's what we're using. */ + if (file_format == FF_BSD44 + || hz != hertz()) + { + if (gmon_io_write_32 (ofp, GMONVERSION) + || gmon_io_write_32 (ofp, (unsigned int) hz)) { perror (filename); done (1); } } + /* Now write out any necessary padding after the meaningful + header bits. */ + if (padsize != 0 + && fwrite (pad, 1, padsize, ofp) != padsize) + { + perror (filename); + done (1); + } + /* Dump the samples. */ for (i = 0; i < hist_num_bins; ++i) { - bfd_put_16 (core_bfd, hist_sample[i], (bfd_byte *) & raw_bin_count[0]); + bfd_put_16 (core_bfd, (bfd_vma) hist_sample[i], + (bfd_byte *) &raw_bin_count[0]); if (fwrite (&raw_bin_count[0], sizeof (raw_bin_count), 1, ofp) != 1) { perror (filename); @@ -551,12 +755,8 @@ DEFUN (gmon_out_write, (filename), const char *filename) { for (arc = sym->cg.children; arc; arc = arc->next_child) { - put_vma (core_bfd, arc->parent->addr, - (bfd_byte *) raw_arc.from_pc); - put_vma (core_bfd, arc->child->addr, - (bfd_byte *) raw_arc.self_pc); - bfd_put_32 (core_bfd, arc->count, (bfd_byte *) raw_arc.count); - if (fwrite (&raw_arc, sizeof (raw_arc), 1, ofp) != 1) + if (gmon_write_raw_arc (ofp, arc->parent->addr, + arc->child->addr, arc->count)) { perror (filename); done (1); diff --git a/gnu/usr.bin/binutils/gprof/gmon_io.h b/gnu/usr.bin/binutils/gprof/gmon_io.h index 7936d836efe..b632d758e5c 100644 --- a/gnu/usr.bin/binutils/gprof/gmon_io.h +++ b/gnu/usr.bin/binutils/gprof/gmon_io.h @@ -1,6 +1,6 @@ /* gmon_io.h - Copyright 2000, 2001 Free Software Foundation, Inc. + Copyright 2000, 2001, 2002 Free Software Foundation, Inc. This file is part of GNU Binutils. @@ -21,9 +21,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef gmon_io_h #define gmon_io_h -#include "bfd.h" -#include "gmon.h" - /* Some platforms need to put stdin into binary mode, to read binary files. */ #include "sysdep.h" @@ -54,7 +51,7 @@ extern int gmon_io_read_32 PARAMS ((FILE *ifp, unsigned int *valp)); extern int gmon_io_read PARAMS ((FILE *ifp, char *buf, size_t n)); extern int gmon_io_write_vma PARAMS ((FILE *ifp, bfd_vma val)); extern int gmon_io_write_32 PARAMS ((FILE *ifp, unsigned int val)); -extern int gmon_io_write_8 PARAMS ((FILE *ifp, unsigned char val)); +extern int gmon_io_write_8 PARAMS ((FILE *ifp, unsigned int val)); extern int gmon_io_write PARAMS ((FILE *ifp, char *buf, size_t n)); extern void gmon_out_read PARAMS ((const char *)); diff --git a/gnu/usr.bin/binutils/gprof/gmon_out.h b/gnu/usr.bin/binutils/gprof/gmon_out.h index 714f9f21b51..25dce59d93c 100644 --- a/gnu/usr.bin/binutils/gprof/gmon_out.h +++ b/gnu/usr.bin/binutils/gprof/gmon_out.h @@ -24,8 +24,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef gmon_out_h #define gmon_out_h -#include <gconfig.h> - #define GMON_MAGIC "gmon" /* magic cookie */ #define GMON_VERSION 1 /* version number */ diff --git a/gnu/usr.bin/binutils/gprof/gprof.1 b/gnu/usr.bin/binutils/gprof/gprof.1 index 5a734da0b21..044ad0ca782 100644 --- a/gnu/usr.bin/binutils/gprof/gprof.1 +++ b/gnu/usr.bin/binutils/gprof/gprof.1 @@ -1,232 +1,670 @@ -.\" Copyright (c) 1983, 1990 The Regents of the University of California. -.\" All rights reserved. +.\" Automatically generated by Pod::Man v1.34, Pod::Parser v1.13 .\" -.\" Redistribution and use in source and binary forms are permitted provided -.\" that: (1) source distributions retain this entire copyright notice and -.\" comment, and (2) distributions including binaries display the following -.\" acknowledgement: ``This product includes software developed by the -.\" University of California, Berkeley and its contributors'' in the -.\" documentation or other materials provided with the distribution and in -.\" all advertising materials mentioning features or use of this software. -.\" Neither the name of the University nor the names of its contributors may -.\" be used to endorse or promote products derived from this software without -.\" specific prior written permission. -.\" THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED -.\" WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF -.\" MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. +.\" Standard preamble: +.\" ======================================================================== +.de Sh \" Subsection heading +.br +.if t .Sp +.ne 5 +.PP +\fB\\$1\fR +.PP +.. +.de Sp \" Vertical space (when we can't use .PP) +.if t .sp .5v +.if n .sp +.. +.de Vb \" Begin verbatim text +.ft CW +.nf +.ne \\$1 +.. +.de Ve \" End verbatim text +.ft R +.fi +.. +.\" Set up some character translations and predefined strings. \*(-- will +.\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left +.\" double quote, and \*(R" will give a right double quote. | will give a +.\" real vertical bar. \*(C+ will give a nicer C++. Capital omega is used to +.\" do unbreakable dashes and therefore won't be available. \*(C` and \*(C' +.\" expand to `' in nroff, nothing in troff, for use with C<>. +.tr \(*W-|\(bv\*(Tr +.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' +.ie n \{\ +. ds -- \(*W- +. ds PI pi +. if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch +. if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch +. ds L" "" +. ds R" "" +. ds C` "" +. ds C' "" +'br\} +.el\{\ +. ds -- \|\(em\| +. ds PI \(*p +. ds L" `` +. ds R" '' +'br\} .\" -.\" @(#)gprof.1 6.6 (Berkeley) 7/24/90 +.\" If the F register is turned on, we'll generate index entries on stderr for +.\" titles (.TH), headers (.SH), subsections (.Sh), items (.Ip), and index +.\" entries marked with X<> in POD. Of course, you'll have to process the +.\" output yourself in some meaningful fashion. +.if \nF \{\ +. de IX +. tm Index:\\$1\t\\n%\t"\\$2" +.. +. nr % 0 +. rr F +.\} .\" -.TH GPROF 1 "January 29, 1993" -.SH NAME +.\" For nroff, turn off justification. Always turn off hyphenation; it makes +.\" way too many mistakes in technical documents. +.hy 0 +.\" +.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). +.\" Fear. Run. Save yourself. No user-serviceable parts. +. \" fudge factors for nroff and troff +.if n \{\ +. ds #H 0 +. ds #V .8m +. ds #F .3m +. ds #[ \f1 +. ds #] \fP +.\} +.if t \{\ +. ds #H ((1u-(\\\\n(.fu%2u))*.13m) +. ds #V .6m +. ds #F 0 +. ds #[ \& +. ds #] \& +.\} +. \" simple accents for nroff and troff +.if n \{\ +. ds ' \& +. ds ` \& +. ds ^ \& +. ds , \& +. ds ~ ~ +. ds / +.\} +.if t \{\ +. ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" +. ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' +. ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' +. ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u' +. ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u' +. ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' +.\} +. \" troff and (daisy-wheel) nroff accents +.ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V' +.ds 8 \h'\*(#H'\(*b\h'-\*(#H' +.ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#] +.ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H' +.ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u' +.ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#] +.ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#] +.ds ae a\h'-(\w'a'u*4/10)'e +.ds Ae A\h'-(\w'A'u*4/10)'E +. \" corrections for vroff +.if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u' +.if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u' +. \" for low resolution devices (crt and lpr) +.if \n(.H>23 .if \n(.V>19 \ +\{\ +. ds : e +. ds 8 ss +. ds o a +. ds d- d\h'-1'\(ga +. ds D- D\h'-1'\(hy +. ds th \o'bp' +. ds Th \o'LP' +. ds ae ae +. ds Ae AE +.\} +.rm #[ #] #H #V #F C +.\" ======================================================================== +.\" +.IX Title "GPROF 1" +.TH GPROF 1 "2003-04-27" "binutils-2.13.90" "GNU" +.SH "NAME" gprof \- display call graph profile data -.SH SYNOPSIS -.B gprof [ \-abcsz ] [ \-e|\-E -.I name -.B ] [ \-f|\-F -.I name -.B ] -.B [ \-k -.I fromname toname -.B ] [ -.I objfile -.B [ -.I gmon.out -.B ] -.B ] -.SH DESCRIPTION -.B gprof -produces an execution profile of C, Pascal, or Fortran77 programs. -The effect of called routines is incorporated in the profile of each caller. -The profile data is taken from the call graph profile file -\&(`gmon.out' default) which is created by programs -that are compiled with the -.B \-pg -option of -.BR cc ( 1 ) , -.BR pc ( 1 ) , -and -.BR f77 ( 1 ) . -The -.B \-pg -option also links in versions of the library routines -that are compiled for profiling. -.B Gprof -reads the given object file (the default is `a.out') -and establishes the relation between its symbol table -and the call graph profile from `gmon.out'. -If more than one profile file is specified, -the -.B gprof +.SH "SYNOPSIS" +.IX Header "SYNOPSIS" +gprof [ \-[abcDhilLsTvwxyz] ] [ \-[ACeEfFJnNOpPqQZ][\fIname\fR] ] + [ \-I \fIdirs\fR ] [ \-d[\fInum\fR] ] [ \-k \fIfrom/to\fR ] + [ \-m \fImin-count\fR ] [ \-t \fItable-length\fR ] + [ \-\-[no\-]annotated\-source[=\fIname\fR] ] + [ \-\-[no\-]exec\-counts[=\fIname\fR] ] + [ \-\-[no\-]flat\-profile[=\fIname\fR] ] [ \-\-[no\-]graph[=\fIname\fR] ] + [ \-\-[no\-]time=\fIname\fR] [ \-\-all\-lines ] [ \-\-brief ] + [ \-\-debug[=\fIlevel\fR] ] [ \-\-function\-ordering ] + [ \-\-file\-ordering ] [ \-\-directory\-path=\fIdirs\fR ] + [ \-\-display\-unused\-functions ] [ \-\-file\-format=\fIname\fR ] + [ \-\-file\-info ] [ \-\-help ] [ \-\-line ] [ \-\-min\-count=\fIn\fR ] + [ \-\-no\-static ] [ \-\-print\-path ] [ \-\-separate\-files ] + [ \-\-static\-call\-graph ] [ \-\-sum ] [ \-\-table\-length=\fIlen\fR ] + [ \-\-traditional ] [ \-\-version ] [ \-\-width=\fIn\fR ] + [ \-\-ignore\-non\-functions ] [ \-\-demangle[=\fI\s-1STYLE\s0\fR] ] + [ \-\-no\-demangle ] [ \fIimage-file\fR ] [ \fIprofile-file\fR ... ] +.SH "DESCRIPTION" +.IX Header "DESCRIPTION" +\&\f(CW\*(C`gprof\*(C'\fR produces an execution profile of C, Pascal, or Fortran77 +programs. The effect of called routines is incorporated in the profile +of each caller. The profile data is taken from the call graph profile file +(\fIgmon.out\fR default) which is created by programs +that are compiled with the \fB\-pg\fR option of +\&\f(CW\*(C`cc\*(C'\fR, \f(CW\*(C`pc\*(C'\fR, and \f(CW\*(C`f77\*(C'\fR. +The \fB\-pg\fR option also links in versions of the library routines +that are compiled for profiling. \f(CW\*(C`Gprof\*(C'\fR reads the given object +file (the default is \f(CW\*(C`a.out\*(C'\fR) and establishes the relation between +its symbol table and the call graph profile from \fIgmon.out\fR. +If more than one profile file is specified, the \f(CW\*(C`gprof\*(C'\fR output shows the sum of the profile information in the given profile files. .PP -.B Gprof -calculates the amount of time spent in each routine. +\&\f(CW\*(C`Gprof\*(C'\fR calculates the amount of time spent in each routine. Next, these times are propagated along the edges of the call graph. Cycles are discovered, and calls into a cycle are made to share the time of the cycle. -The first listing shows the functions -sorted according to the time they represent -including the time of their call graph descendants. -Below each function entry is shown its (direct) call graph children, -and how their times are propagated to this function. -A similar display above the function shows how this function's time and the -time of its descendants is propagated to its (direct) call graph parents. .PP -Cycles are also shown, with an entry for the cycle as a whole and -a listing of the members of the cycle and their contributions to the -time and call counts of the cycle. +Several forms of output are available from the analysis. .PP -Second, a flat profile is given, -similar to that provided by -.BR prof ( 1 ) . -This listing gives the total execution times, the call counts, -the time in milliseconds the call spent in the routine itself, and -the time in milliseconds the call spent in the routine itself including -its descendants. +The \fIflat profile\fR shows how much time your program spent in each function, +and how many times that function was called. If you simply want to know +which functions burn most of the cycles, it is stated concisely here. .PP -Finally, an index of the function names is provided. -.SH OPTIONS -The following options are available: -.TP -.B \-a -suppresses the printing of statically declared functions. -If this option is given, all relevant information about the static function -(e.g., time samples, calls to other functions, calls from other functions) -belongs to the function loaded just before the static function in the -\&`objfile' file. -.TP -.B \-b -suppresses the printing of a description of each field in the profile. -.TP -.B \-c -the static call graph of the program is discovered by a heuristic -that examines the text space of the object file. -Static-only parents or children are shown -with call counts of 0. -.TP -.BI "\-e " name -suppresses the printing of the graph profile entry for routine -.I name -and all its descendants -(unless they have other ancestors that aren't suppressed). -More than one -.B \-e -option may be given. -Only one -.I name -may be given with each -.B \-e -option. -.TP -.BI "\-E " name -suppresses the printing of the graph profile entry for routine -.I name -(and its descendants) as -.B \-e , -above, and also excludes the time spent in -.I name -(and its descendants) from the total and percentage time computations. -(For example, -.BI "\-E " mcount -.BI "\-E " mcleanup -is the default.) -.TP -.BI "\-f " name -prints the graph profile entry of only the specified routine -.I name -and its descendants. -More than one -.B \-f -option may be given. -Only one -.I name -may be given with each -.B \-f -option. -.TP -.BI "\-F " name -prints the graph profile entry of only the routine -.I name -and its descendants (as -.B \-f , -above) and also uses only the times of the printed routines -in total time and percentage computations. -More than one -.B \-F -option may be given. -Only one -.I name -may be given with each -.B \-F -option. -The -.B \-F -option -overrides -the -.B \-E -option. -.TP -.BI "\-k " "fromname toname" -will delete any arcs from routine -.I fromname -to routine -.IR toname . -This can be used to break undesired cycles. -More than one -.B \-k -option may be given. -Only one pair of routine names may be given with each -.B \-k -option. -.TP -.B \-s -a profile file `gmon.sum' is produced that represents -the sum of the profile information in all the specified profile files. -This summary profile file may be given to later -executions of gprof (probably also with a -.BR \-s ) -to accumulate profile data across several runs of an `objfile' file. -.TP -.B -v -prints the version number for gprof, and then exits. -.TP -.B -z -displays routines that have zero usage (as shown by call counts -and accumulated time). -This is useful with the -.B \-c -option for discovering which routines were never called. +The \fIcall graph\fR shows, for each function, which functions called it, which +other functions it called, and how many times. There is also an estimate +of how much time was spent in the subroutines of each function. This can +suggest places where you might try to eliminate function calls that use a +lot of time. .PP -.SH FILES -.ta \w'gmon.sum 'u -a.out the namelist and text space. -.br -gmon.out dynamic call graph and profile. -.br -gmon.sum summarized dynamic call graph and profile. -.SH SEE ALSO -.BR monitor ( 3 ) , -.BR profil ( 2 ) , -.BR cc ( 1 ) , -.BR prof ( 1 ) -.sp -``An Execution Profiler for Modular Programs'', -by S. Graham, P. Kessler, M. McKusick; -.I -Software \- Practice and Experience, -Vol. 13, pp. 671-685, 1983. -.sp -``gprof: A Call Graph Execution Profiler'', -by S. Graham, P. Kessler, M. McKusick; -.I -Proceedings of the SIGPLAN '82 Symposium on Compiler Construction, -SIGPLAN Notices, Vol. 17, No 6, pp. 120-126, June 1982. -.SH HISTORY -.B Gprof -appeared in 4.2 BSD. -.SH BUGS +The \fIannotated source\fR listing is a copy of the program's +source code, labeled with the number of times each line of the +program was executed. +.SH "OPTIONS" +.IX Header "OPTIONS" +These options specify which of several output formats +\&\f(CW\*(C`gprof\*(C'\fR should produce. +.PP +Many of these options take an optional \fIsymspec\fR to specify +functions to be included or excluded. These options can be +specified multiple times, with different symspecs, to include +or exclude sets of symbols. +.PP +Specifying any of these options overrides the default (\fB\-p \-q\fR), +which prints a flat profile and call graph analysis +for all functions. +.ie n .IP """\-A[\f(CIsymspec\f(CW]""" 4 +.el .IP "\f(CW\-A[\f(CIsymspec\f(CW]\fR" 4 +.IX Item "-A[symspec]" +.PD 0 +.ie n .IP """\-\-annotated\-source[=\f(CIsymspec\f(CW]""" 4 +.el .IP "\f(CW\-\-annotated\-source[=\f(CIsymspec\f(CW]\fR" 4 +.IX Item "--annotated-source[=symspec]" +.PD +The \fB\-A\fR option causes \f(CW\*(C`gprof\*(C'\fR to print annotated source code. +If \fIsymspec\fR is specified, print output only for matching symbols. +.ie n .IP """\-b""" 4 +.el .IP "\f(CW\-b\fR" 4 +.IX Item "-b" +.PD 0 +.ie n .IP """\-\-brief""" 4 +.el .IP "\f(CW\-\-brief\fR" 4 +.IX Item "--brief" +.PD +If the \fB\-b\fR option is given, \f(CW\*(C`gprof\*(C'\fR doesn't print the +verbose blurbs that try to explain the meaning of all of the fields in +the tables. This is useful if you intend to print out the output, or +are tired of seeing the blurbs. +.ie n .IP """\-C[\f(CIsymspec\f(CW]""" 4 +.el .IP "\f(CW\-C[\f(CIsymspec\f(CW]\fR" 4 +.IX Item "-C[symspec]" +.PD 0 +.ie n .IP """\-\-exec\-counts[=\f(CIsymspec\f(CW]""" 4 +.el .IP "\f(CW\-\-exec\-counts[=\f(CIsymspec\f(CW]\fR" 4 +.IX Item "--exec-counts[=symspec]" +.PD +The \fB\-C\fR option causes \f(CW\*(C`gprof\*(C'\fR to +print a tally of functions and the number of times each was called. +If \fIsymspec\fR is specified, print tally only for matching symbols. +.Sp +If the profile data file contains basic-block count records, specifying +the \fB\-l\fR option, along with \fB\-C\fR, will cause basic-block +execution counts to be tallied and displayed. +.ie n .IP """\-i""" 4 +.el .IP "\f(CW\-i\fR" 4 +.IX Item "-i" +.PD 0 +.ie n .IP """\-\-file\-info""" 4 +.el .IP "\f(CW\-\-file\-info\fR" 4 +.IX Item "--file-info" +.PD +The \fB\-i\fR option causes \f(CW\*(C`gprof\*(C'\fR to display summary information +about the profile data file(s) and then exit. The number of histogram, +call graph, and basic-block count records is displayed. +.ie n .IP """\-I \f(CIdirs\f(CW""" 4 +.el .IP "\f(CW\-I \f(CIdirs\f(CW\fR" 4 +.IX Item "-I dirs" +.PD 0 +.ie n .IP """\-\-directory\-path=\f(CIdirs\f(CW""" 4 +.el .IP "\f(CW\-\-directory\-path=\f(CIdirs\f(CW\fR" 4 +.IX Item "--directory-path=dirs" +.PD +The \fB\-I\fR option specifies a list of search directories in +which to find source files. Environment variable \fI\s-1GPROF_PATH\s0\fR +can also be used to convey this information. +Used mostly for annotated source output. +.ie n .IP """\-J[\f(CIsymspec\f(CW]""" 4 +.el .IP "\f(CW\-J[\f(CIsymspec\f(CW]\fR" 4 +.IX Item "-J[symspec]" +.PD 0 +.ie n .IP """\-\-no\-annotated\-source[=\f(CIsymspec\f(CW]""" 4 +.el .IP "\f(CW\-\-no\-annotated\-source[=\f(CIsymspec\f(CW]\fR" 4 +.IX Item "--no-annotated-source[=symspec]" +.PD +The \fB\-J\fR option causes \f(CW\*(C`gprof\*(C'\fR not to +print annotated source code. +If \fIsymspec\fR is specified, \f(CW\*(C`gprof\*(C'\fR prints annotated source, +but excludes matching symbols. +.ie n .IP """\-L""" 4 +.el .IP "\f(CW\-L\fR" 4 +.IX Item "-L" +.PD 0 +.ie n .IP """\-\-print\-path""" 4 +.el .IP "\f(CW\-\-print\-path\fR" 4 +.IX Item "--print-path" +.PD +Normally, source filenames are printed with the path +component suppressed. The \fB\-L\fR option causes \f(CW\*(C`gprof\*(C'\fR +to print the full pathname of +source filenames, which is determined +from symbolic debugging information in the image file +and is relative to the directory in which the compiler +was invoked. +.ie n .IP """\-p[\f(CIsymspec\f(CW]""" 4 +.el .IP "\f(CW\-p[\f(CIsymspec\f(CW]\fR" 4 +.IX Item "-p[symspec]" +.PD 0 +.ie n .IP """\-\-flat\-profile[=\f(CIsymspec\f(CW]""" 4 +.el .IP "\f(CW\-\-flat\-profile[=\f(CIsymspec\f(CW]\fR" 4 +.IX Item "--flat-profile[=symspec]" +.PD +The \fB\-p\fR option causes \f(CW\*(C`gprof\*(C'\fR to print a flat profile. +If \fIsymspec\fR is specified, print flat profile only for matching symbols. +.ie n .IP """\-P[\f(CIsymspec\f(CW]""" 4 +.el .IP "\f(CW\-P[\f(CIsymspec\f(CW]\fR" 4 +.IX Item "-P[symspec]" +.PD 0 +.ie n .IP """\-\-no\-flat\-profile[=\f(CIsymspec\f(CW]""" 4 +.el .IP "\f(CW\-\-no\-flat\-profile[=\f(CIsymspec\f(CW]\fR" 4 +.IX Item "--no-flat-profile[=symspec]" +.PD +The \fB\-P\fR option causes \f(CW\*(C`gprof\*(C'\fR to suppress printing a flat profile. +If \fIsymspec\fR is specified, \f(CW\*(C`gprof\*(C'\fR prints a flat profile, +but excludes matching symbols. +.ie n .IP """\-q[\f(CIsymspec\f(CW]""" 4 +.el .IP "\f(CW\-q[\f(CIsymspec\f(CW]\fR" 4 +.IX Item "-q[symspec]" +.PD 0 +.ie n .IP """\-\-graph[=\f(CIsymspec\f(CW]""" 4 +.el .IP "\f(CW\-\-graph[=\f(CIsymspec\f(CW]\fR" 4 +.IX Item "--graph[=symspec]" +.PD +The \fB\-q\fR option causes \f(CW\*(C`gprof\*(C'\fR to print the call graph analysis. +If \fIsymspec\fR is specified, print call graph only for matching symbols +and their children. +.ie n .IP """\-Q[\f(CIsymspec\f(CW]""" 4 +.el .IP "\f(CW\-Q[\f(CIsymspec\f(CW]\fR" 4 +.IX Item "-Q[symspec]" +.PD 0 +.ie n .IP """\-\-no\-graph[=\f(CIsymspec\f(CW]""" 4 +.el .IP "\f(CW\-\-no\-graph[=\f(CIsymspec\f(CW]\fR" 4 +.IX Item "--no-graph[=symspec]" +.PD +The \fB\-Q\fR option causes \f(CW\*(C`gprof\*(C'\fR to suppress printing the +call graph. +If \fIsymspec\fR is specified, \f(CW\*(C`gprof\*(C'\fR prints a call graph, +but excludes matching symbols. +.ie n .IP """\-y""" 4 +.el .IP "\f(CW\-y\fR" 4 +.IX Item "-y" +.PD 0 +.ie n .IP """\-\-separate\-files""" 4 +.el .IP "\f(CW\-\-separate\-files\fR" 4 +.IX Item "--separate-files" +.PD +This option affects annotated source output only. +Normally, \f(CW\*(C`gprof\*(C'\fR prints annotated source files +to standard\-output. If this option is specified, +annotated source for a file named \fIpath/\fIfilename\fI\fR +is generated in the file \fI\fIfilename\fI\-ann\fR. If the underlying +filesystem would truncate \fI\fIfilename\fI\-ann\fR so that it +overwrites the original \fI\fIfilename\fI\fR, \f(CW\*(C`gprof\*(C'\fR generates +annotated source in the file \fI\fIfilename\fI.ann\fR instead (if the +original file name has an extension, that extension is \fIreplaced\fR +with \fI.ann\fR). +.ie n .IP """\-Z[\f(CIsymspec\f(CW]""" 4 +.el .IP "\f(CW\-Z[\f(CIsymspec\f(CW]\fR" 4 +.IX Item "-Z[symspec]" +.PD 0 +.ie n .IP """\-\-no\-exec\-counts[=\f(CIsymspec\f(CW]""" 4 +.el .IP "\f(CW\-\-no\-exec\-counts[=\f(CIsymspec\f(CW]\fR" 4 +.IX Item "--no-exec-counts[=symspec]" +.PD +The \fB\-Z\fR option causes \f(CW\*(C`gprof\*(C'\fR not to +print a tally of functions and the number of times each was called. +If \fIsymspec\fR is specified, print tally, but exclude matching symbols. +.ie n .IP """\-\-function\-ordering""" 4 +.el .IP "\f(CW\-\-function\-ordering\fR" 4 +.IX Item "--function-ordering" +The \fB\-\-function\-ordering\fR option causes \f(CW\*(C`gprof\*(C'\fR to print a +suggested function ordering for the program based on profiling data. +This option suggests an ordering which may improve paging, tlb and +cache behavior for the program on systems which support arbitrary +ordering of functions in an executable. +.Sp +The exact details of how to force the linker to place functions +in a particular order is system dependent and out of the scope of this +manual. +.ie n .IP """\-\-file\-ordering \f(CImap_file\f(CW""" 4 +.el .IP "\f(CW\-\-file\-ordering \f(CImap_file\f(CW\fR" 4 +.IX Item "--file-ordering map_file" +The \fB\-\-file\-ordering\fR option causes \f(CW\*(C`gprof\*(C'\fR to print a +suggested .o link line ordering for the program based on profiling data. +This option suggests an ordering which may improve paging, tlb and +cache behavior for the program on systems which do not support arbitrary +ordering of functions in an executable. +.Sp +Use of the \fB\-a\fR argument is highly recommended with this option. +.Sp +The \fImap_file\fR argument is a pathname to a file which provides +function name to object file mappings. The format of the file is similar to +the output of the program \f(CW\*(C`nm\*(C'\fR. +.Sp +.Vb 8 +\& c-parse.o:00000000 T yyparse +\& c-parse.o:00000004 C yyerrflag +\& c-lang.o:00000000 T maybe_objc_method_name +\& c-lang.o:00000000 T print_lang_statistics +\& c-lang.o:00000000 T recognize_objc_keyword +\& c-decl.o:00000000 T print_lang_identifier +\& c-decl.o:00000000 T print_lang_type +\& ... +.Ve +.Sp +To create a \fImap_file\fR with \s-1GNU\s0 \f(CW\*(C`nm\*(C'\fR, type a command like +\&\f(CW\*(C`nm \-\-extern\-only \-\-defined\-only \-v \-\-print\-file\-name program\-name\*(C'\fR. +.ie n .IP """\-T""" 4 +.el .IP "\f(CW\-T\fR" 4 +.IX Item "-T" +.PD 0 +.ie n .IP """\-\-traditional""" 4 +.el .IP "\f(CW\-\-traditional\fR" 4 +.IX Item "--traditional" +.PD +The \fB\-T\fR option causes \f(CW\*(C`gprof\*(C'\fR to print its output in +``traditional'' \s-1BSD\s0 style. +.ie n .IP """\-w \f(CIwidth\f(CW""" 4 +.el .IP "\f(CW\-w \f(CIwidth\f(CW\fR" 4 +.IX Item "-w width" +.PD 0 +.ie n .IP """\-\-width=\f(CIwidth\f(CW""" 4 +.el .IP "\f(CW\-\-width=\f(CIwidth\f(CW\fR" 4 +.IX Item "--width=width" +.PD +Sets width of output lines to \fIwidth\fR. +Currently only used when printing the function index at the bottom +of the call graph. +.ie n .IP """\-x""" 4 +.el .IP "\f(CW\-x\fR" 4 +.IX Item "-x" +.PD 0 +.ie n .IP """\-\-all\-lines""" 4 +.el .IP "\f(CW\-\-all\-lines\fR" 4 +.IX Item "--all-lines" +.PD +This option affects annotated source output only. +By default, only the lines at the beginning of a basic-block +are annotated. If this option is specified, every line in +a basic-block is annotated by repeating the annotation for the +first line. This behavior is similar to \f(CW\*(C`tcov\*(C'\fR's \fB\-a\fR. +.ie n .IP """\-\-demangle[=\f(CIstyle\f(CW]""" 4 +.el .IP "\f(CW\-\-demangle[=\f(CIstyle\f(CW]\fR" 4 +.IX Item "--demangle[=style]" +.PD 0 +.ie n .IP """\-\-no\-demangle""" 4 +.el .IP "\f(CW\-\-no\-demangle\fR" 4 +.IX Item "--no-demangle" +.PD +These options control whether \*(C+ symbol names should be demangled when +printing output. The default is to demangle symbols. The +\&\f(CW\*(C`\-\-no\-demangle\*(C'\fR option may be used to turn off demangling. Different +compilers have different mangling styles. The optional demangling style +argument can be used to choose an appropriate demangling style for your +compiler. +.Sh "Analysis Options" +.IX Subsection "Analysis Options" +.ie n .IP """\-a""" 4 +.el .IP "\f(CW\-a\fR" 4 +.IX Item "-a" +.PD 0 +.ie n .IP """\-\-no\-static""" 4 +.el .IP "\f(CW\-\-no\-static\fR" 4 +.IX Item "--no-static" +.PD +The \fB\-a\fR option causes \f(CW\*(C`gprof\*(C'\fR to suppress the printing of +statically declared (private) functions. (These are functions whose +names are not listed as global, and which are not visible outside the +file/function/block where they were defined.) Time spent in these +functions, calls to/from them, etc, will all be attributed to the +function that was loaded directly before it in the executable file. +This option affects both the flat profile and the call graph. +.ie n .IP """\-c""" 4 +.el .IP "\f(CW\-c\fR" 4 +.IX Item "-c" +.PD 0 +.ie n .IP """\-\-static\-call\-graph""" 4 +.el .IP "\f(CW\-\-static\-call\-graph\fR" 4 +.IX Item "--static-call-graph" +.PD +The \fB\-c\fR option causes the call graph of the program to be +augmented by a heuristic which examines the text space of the object +file and identifies function calls in the binary machine code. +Since normal call graph records are only generated when functions are +entered, this option identifies children that could have been called, +but never were. Calls to functions that were not compiled with +profiling enabled are also identified, but only if symbol table +entries are present for them. +Calls to dynamic library routines are typically \fInot\fR found +by this option. +Parents or children identified via this heuristic +are indicated in the call graph with call counts of \fB0\fR. +.ie n .IP """\-D""" 4 +.el .IP "\f(CW\-D\fR" 4 +.IX Item "-D" +.PD 0 +.ie n .IP """\-\-ignore\-non\-functions""" 4 +.el .IP "\f(CW\-\-ignore\-non\-functions\fR" 4 +.IX Item "--ignore-non-functions" +.PD +The \fB\-D\fR option causes \f(CW\*(C`gprof\*(C'\fR to ignore symbols which +are not known to be functions. This option will give more accurate +profile data on systems where it is supported (Solaris and \s-1HPUX\s0 for +example). +.ie n .IP """\-k \f(CIfrom\f(CW/\f(CIto\f(CW""" 4 +.el .IP "\f(CW\-k \f(CIfrom\f(CW/\f(CIto\f(CW\fR" 4 +.IX Item "-k from/to" +The \fB\-k\fR option allows you to delete from the call graph any arcs from +symbols matching symspec \fIfrom\fR to those matching symspec \fIto\fR. +.ie n .IP """\-l""" 4 +.el .IP "\f(CW\-l\fR" 4 +.IX Item "-l" +.PD 0 +.ie n .IP """\-\-line""" 4 +.el .IP "\f(CW\-\-line\fR" 4 +.IX Item "--line" +.PD +The \fB\-l\fR option enables line-by-line profiling, which causes +histogram hits to be charged to individual source code lines, +instead of functions. +If the program was compiled with basic-block counting enabled, +this option will also identify how many times each line of +code was executed. +While line-by-line profiling can help isolate where in a large function +a program is spending its time, it also significantly increases +the running time of \f(CW\*(C`gprof\*(C'\fR, and magnifies statistical +inaccuracies. +.ie n .IP """\-m \f(CInum\f(CW""" 4 +.el .IP "\f(CW\-m \f(CInum\f(CW\fR" 4 +.IX Item "-m num" +.PD 0 +.ie n .IP """\-\-min\-count=\f(CInum\f(CW""" 4 +.el .IP "\f(CW\-\-min\-count=\f(CInum\f(CW\fR" 4 +.IX Item "--min-count=num" +.PD +This option affects execution count output only. +Symbols that are executed less than \fInum\fR times are suppressed. +.ie n .IP """\-n[\f(CIsymspec\f(CW]""" 4 +.el .IP "\f(CW\-n[\f(CIsymspec\f(CW]\fR" 4 +.IX Item "-n[symspec]" +.PD 0 +.ie n .IP """\-\-time[=\f(CIsymspec\f(CW]""" 4 +.el .IP "\f(CW\-\-time[=\f(CIsymspec\f(CW]\fR" 4 +.IX Item "--time[=symspec]" +.PD +The \fB\-n\fR option causes \f(CW\*(C`gprof\*(C'\fR, in its call graph analysis, +to only propagate times for symbols matching \fIsymspec\fR. +.ie n .IP """\-N[\f(CIsymspec\f(CW]""" 4 +.el .IP "\f(CW\-N[\f(CIsymspec\f(CW]\fR" 4 +.IX Item "-N[symspec]" +.PD 0 +.ie n .IP """\-\-no\-time[=\f(CIsymspec\f(CW]""" 4 +.el .IP "\f(CW\-\-no\-time[=\f(CIsymspec\f(CW]\fR" 4 +.IX Item "--no-time[=symspec]" +.PD +The \fB\-n\fR option causes \f(CW\*(C`gprof\*(C'\fR, in its call graph analysis, +not to propagate times for symbols matching \fIsymspec\fR. +.ie n .IP """\-z""" 4 +.el .IP "\f(CW\-z\fR" 4 +.IX Item "-z" +.PD 0 +.ie n .IP """\-\-display\-unused\-functions""" 4 +.el .IP "\f(CW\-\-display\-unused\-functions\fR" 4 +.IX Item "--display-unused-functions" +.PD +If you give the \fB\-z\fR option, \f(CW\*(C`gprof\*(C'\fR will mention all +functions in the flat profile, even those that were never called, and +that had no time spent in them. This is useful in conjunction with the +\&\fB\-c\fR option for discovering which routines were never called. +.Sh "Miscellaneous Options" +.IX Subsection "Miscellaneous Options" +.ie n .IP """\-d[\f(CInum\f(CW]""" 4 +.el .IP "\f(CW\-d[\f(CInum\f(CW]\fR" 4 +.IX Item "-d[num]" +.PD 0 +.ie n .IP """\-\-debug[=\f(CInum\f(CW]""" 4 +.el .IP "\f(CW\-\-debug[=\f(CInum\f(CW]\fR" 4 +.IX Item "--debug[=num]" +.PD +The \fB\-d\fR \fInum\fR option specifies debugging options. +If \fInum\fR is not specified, enable all debugging. +.ie n .IP """\-O\f(CIname\f(CW""" 4 +.el .IP "\f(CW\-O\f(CIname\f(CW\fR" 4 +.IX Item "-Oname" +.PD 0 +.ie n .IP """\-\-file\-format=\f(CIname\f(CW""" 4 +.el .IP "\f(CW\-\-file\-format=\f(CIname\f(CW\fR" 4 +.IX Item "--file-format=name" +.PD +Selects the format of the profile data files. Recognized formats are +\&\fBauto\fR (the default), \fBbsd\fR, \fB4.4bsd\fR, \fBmagic\fR, and +\&\fBprof\fR (not yet supported). +.ie n .IP """\-s""" 4 +.el .IP "\f(CW\-s\fR" 4 +.IX Item "-s" +.PD 0 +.ie n .IP """\-\-sum""" 4 +.el .IP "\f(CW\-\-sum\fR" 4 +.IX Item "--sum" +.PD +The \fB\-s\fR option causes \f(CW\*(C`gprof\*(C'\fR to summarize the information +in the profile data files it read in, and write out a profile data +file called \fIgmon.sum\fR, which contains all the information from +the profile data files that \f(CW\*(C`gprof\*(C'\fR read in. The file \fIgmon.sum\fR +may be one of the specified input files; the effect of this is to +merge the data in the other input files into \fIgmon.sum\fR. +.Sp +Eventually you can run \f(CW\*(C`gprof\*(C'\fR again without \fB\-s\fR to analyze the +cumulative data in the file \fIgmon.sum\fR. +.ie n .IP """\-v""" 4 +.el .IP "\f(CW\-v\fR" 4 +.IX Item "-v" +.PD 0 +.ie n .IP """\-\-version""" 4 +.el .IP "\f(CW\-\-version\fR" 4 +.IX Item "--version" +.PD +The \fB\-v\fR flag causes \f(CW\*(C`gprof\*(C'\fR to print the current version +number, and then exit. +.Sh "Deprecated Options" +.IX Subsection "Deprecated Options" +.RS 4 +These options have been replaced with newer versions that use symspecs. +.RE +.ie n .IP """\-e \f(CIfunction_name\f(CW""" 4 +.el .IP "\f(CW\-e \f(CIfunction_name\f(CW\fR" 4 +.IX Item "-e function_name" +The \fB\-e\fR \fIfunction\fR option tells \f(CW\*(C`gprof\*(C'\fR to not print +information about the function \fIfunction_name\fR (and its +children...) in the call graph. The function will still be listed +as a child of any functions that call it, but its index number will be +shown as \fB[not printed]\fR. More than one \fB\-e\fR option may be +given; only one \fIfunction_name\fR may be indicated with each \fB\-e\fR +option. +.ie n .IP """\-E \f(CIfunction_name\f(CW""" 4 +.el .IP "\f(CW\-E \f(CIfunction_name\f(CW\fR" 4 +.IX Item "-E function_name" +The \f(CW\*(C`\-E \f(CIfunction\f(CW\*(C'\fR option works like the \f(CW\*(C`\-e\*(C'\fR option, but +time spent in the function (and children who were not called from +anywhere else), will not be used to compute the percentages-of-time for +the call graph. More than one \fB\-E\fR option may be given; only one +\&\fIfunction_name\fR may be indicated with each \fB\-E\fR option. +.ie n .IP """\-f \f(CIfunction_name\f(CW""" 4 +.el .IP "\f(CW\-f \f(CIfunction_name\f(CW\fR" 4 +.IX Item "-f function_name" +The \fB\-f\fR \fIfunction\fR option causes \f(CW\*(C`gprof\*(C'\fR to limit the +call graph to the function \fIfunction_name\fR and its children (and +their children...). More than one \fB\-f\fR option may be given; +only one \fIfunction_name\fR may be indicated with each \fB\-f\fR +option. +.ie n .IP """\-F \f(CIfunction_name\f(CW""" 4 +.el .IP "\f(CW\-F \f(CIfunction_name\f(CW\fR" 4 +.IX Item "-F function_name" +The \fB\-F\fR \fIfunction\fR option works like the \f(CW\*(C`\-f\*(C'\fR option, but +only time spent in the function and its children (and their +children...) will be used to determine total-time and +percentages-of-time for the call graph. More than one \fB\-F\fR option +may be given; only one \fIfunction_name\fR may be indicated with each +\&\fB\-F\fR option. The \fB\-F\fR option overrides the \fB\-E\fR option. +.SH "FILES" +.IX Header "FILES" +.ie n .IP """\f(CIa.out\f(CW""" 4 +.el .IP "\f(CW\f(CIa.out\f(CW\fR" 4 +.IX Item "a.out" +the namelist and text space. +.ie n .IP """\f(CIgmon.out\f(CW""" 4 +.el .IP "\f(CW\f(CIgmon.out\f(CW\fR" 4 +.IX Item "gmon.out" +dynamic call graph and profile. +.ie n .IP """\f(CIgmon.sum\f(CW""" 4 +.el .IP "\f(CW\f(CIgmon.sum\f(CW\fR" 4 +.IX Item "gmon.sum" +summarized dynamic call graph and profile. +.SH "BUGS" +.IX Header "BUGS" The granularity of the sampling is shown, but remains statistical at best. We assume that the time for each execution of a function @@ -246,7 +684,29 @@ Any profiled children of signal catchers should have their times propagated properly, unless the signal catcher was invoked during the execution of the profiling routine, in which case all is lost. .PP -The profiled program must call -.BR exit ( 2 ) +The profiled program must call \f(CW\*(C`exit\*(C'\fR(2) or return normally for the profiling information to be saved -in the `gmon.out' file. +in the \fIgmon.out\fR file. +.SH "SEE ALSO" +.IX Header "SEE ALSO" +\&\fImonitor\fR\|(3), \fIprofil\fR\|(2), \fIcc\fR\|(1), \fIprof\fR\|(1), and the Info entry for \fIgprof\fR. +.PP +``An Execution Profiler for Modular Programs'', +by S. Graham, P. Kessler, M. McKusick; +Software \- Practice and Experience, +Vol. 13, pp. 671\-685, 1983. +.PP +``gprof: A Call Graph Execution Profiler'', +by S. Graham, P. Kessler, M. McKusick; +Proceedings of the \s-1SIGPLAN\s0 '82 Symposium on Compiler Construction, +\&\s-1SIGPLAN\s0 Notices, Vol. 17, No 6, pp. 120\-126, June 1982. +.SH "COPYRIGHT" +.IX Header "COPYRIGHT" +Copyright (C) 1988, 92, 97, 98, 99, 2000, 2001 Free Software Foundation, Inc. +.PP +Permission is granted to copy, distribute and/or modify this document +under the terms of the \s-1GNU\s0 Free Documentation License, Version 1.1 +or any later version published by the Free Software Foundation; +with no Invariant Sections, with no Front-Cover Texts, and with no +Back-Cover Texts. A copy of the license is included in the +section entitled \*(L"\s-1GNU\s0 Free Documentation License\*(R". diff --git a/gnu/usr.bin/binutils/gprof/gprof.c b/gnu/usr.bin/binutils/gprof/gprof.c index bfc7995c14f..260dbebb4a7 100644 --- a/gnu/usr.bin/binutils/gprof/gprof.c +++ b/gnu/usr.bin/binutils/gprof/gprof.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 1983, 1993, 2001 + * Copyright (c) 1983, 1993, 1998, 2001, 2002 * The Regents of the University of California. All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -26,9 +26,12 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ -#include "getopt.h" + #include "libiberty.h" #include "gprof.h" +#include "search_list.h" +#include "source.h" +#include "symtab.h" #include "basic_blocks.h" #include "call_graph.h" #include "cg_arcs.h" @@ -37,9 +40,12 @@ #include "gmon_io.h" #include "hertz.h" #include "hist.h" -#include "source.h" #include "sym_ids.h" #include "demangle.h" +#include "getopt.h" + +static void usage PARAMS ((FILE *, int)) ATTRIBUTE_NORETURN; +int main PARAMS ((int, char **)); const char *whoami; const char *function_mapping_file; @@ -52,19 +58,19 @@ long hz = HZ_WRONG; int debug_level = 0; int output_style = 0; int output_width = 80; -bool bsd_style_output = FALSE; -bool demangle = TRUE; -bool discard_underscores = TRUE; -bool ignore_direct_calls = FALSE; -bool ignore_static_funcs = FALSE; -bool ignore_zeros = TRUE; -bool line_granularity = FALSE; -bool print_descriptions = TRUE; -bool print_path = FALSE; -bool ignore_non_functions = FALSE; +bfd_boolean bsd_style_output = FALSE; +bfd_boolean demangle = TRUE; +bfd_boolean discard_underscores = TRUE; +bfd_boolean ignore_direct_calls = FALSE; +bfd_boolean ignore_static_funcs = FALSE; +bfd_boolean ignore_zeros = TRUE; +bfd_boolean line_granularity = FALSE; +bfd_boolean print_descriptions = TRUE; +bfd_boolean print_path = FALSE; +bfd_boolean ignore_non_functions = FALSE; File_Format file_format = FF_AUTO; -bool first_output = TRUE; +bfd_boolean first_output = TRUE; char copyright[] = "@(#) Copyright (c) 1983 Regents of the University of California.\n\ @@ -150,7 +156,9 @@ static struct option long_options[] = static void -DEFUN (usage, (stream, status), FILE * stream AND int status) +usage (stream, status) + FILE *stream; + int status; { fprintf (stream, _("\ Usage: %s [-[abcDhilLsTvwxyz]] [-[ACeEfFJnNOpPqQZ][name]] [-I dirs]\n\ @@ -174,7 +182,9 @@ Usage: %s [-[abcDhilLsTvwxyz]] [-[ACeEfFJnNOpPqQZ][name]] [-I dirs]\n\ int -DEFUN (main, (argc, argv), int argc AND char **argv) +main (argc, argv) + int argc; + char **argv; { char **sp, *str; Sym **cg = 0; @@ -183,6 +193,9 @@ DEFUN (main, (argc, argv), int argc AND char **argv) #if defined (HAVE_SETLOCALE) && defined (HAVE_LC_MESSAGES) setlocale (LC_MESSAGES, ""); #endif +#if defined (HAVE_SETLOCALE) + setlocale (LC_CTYPE, ""); +#endif bindtextdomain (PACKAGE, LOCALEDIR); textdomain (PACKAGE); @@ -499,9 +512,7 @@ This program is free software. This program has absolutely no warranty.\n")); { sym_id_add (*sp, EXCL_TIME); sym_id_add (*sp, EXCL_GRAPH); -#ifdef __alpha__ sym_id_add (*sp, EXCL_FLAT); -#endif } /* diff --git a/gnu/usr.bin/binutils/gprof/gprof.h b/gnu/usr.bin/binutils/gprof/gprof.h index 283236e86d2..b0679ff61d1 100644 --- a/gnu/usr.bin/binutils/gprof/gprof.h +++ b/gnu/usr.bin/binutils/gprof/gprof.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 1983, 1993, 2001 + * Copyright (c) 1983, 1993 * The Regents of the University of California. All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -29,10 +29,9 @@ #ifndef gprof_h #define gprof_h -#include "ansidecl.h" - /* Include the BFD sysdep.h file. */ #include "sysdep.h" +#include "bfd.h" /* Undefine the BFD PACKAGE and VERSION macros before including the gprof config.h file. */ @@ -71,16 +70,6 @@ #include "bin-bugs.h" -/* - * These may already be defined on some systems. We could probably - * just use the BFD versions of these, since BFD has already dealt - * with this problem. - */ -#undef FALSE -#define FALSE 0 -#undef TRUE -#define TRUE 1 - #define STYLE_FLAT_PROFILE (1<<0) #define STYLE_CALL_GRAPH (1<<1) #define STYLE_SUMMARY_FILE (1<<2) @@ -117,7 +106,6 @@ typedef enum } File_Format; -typedef int bool; typedef unsigned char UNIT[2]; /* unit of profiling */ extern const char *whoami; /* command-name, for error messages */ @@ -128,24 +116,24 @@ extern long hz; /* ticks per second */ /* * Command-line options: */ -extern int debug_level; /* debug level */ +extern int debug_level; /* debug level */ extern int output_style; -extern int output_width; /* controls column width in index */ -extern bool bsd_style_output; /* as opposed to FSF style output */ -extern bool demangle; /* demangle symbol names? */ -extern bool discard_underscores; /* discard leading underscores? */ -extern bool ignore_direct_calls; /* don't count direct calls */ -extern bool ignore_static_funcs; /* suppress static functions */ -extern bool ignore_zeros; /* ignore unused symbols/files */ -extern bool line_granularity; /* function or line granularity? */ -extern bool print_descriptions; /* output profile description */ -extern bool print_path; /* print path or just filename? */ -extern bool ignore_non_functions;/* Ignore non-function symbols. */ - -extern File_Format file_format; /* requested file format */ - -extern bool first_output; /* no output so far? */ - -extern void done PARAMS ((int status)); +extern int output_width; /* controls column width in index */ +extern bfd_boolean bsd_style_output; /* as opposed to FSF style output */ +extern bfd_boolean demangle; /* demangle symbol names? */ +extern bfd_boolean discard_underscores; /* discard leading underscores? */ +extern bfd_boolean ignore_direct_calls; /* don't count direct calls */ +extern bfd_boolean ignore_static_funcs; /* suppress static functions */ +extern bfd_boolean ignore_zeros; /* ignore unused symbols/files */ +extern bfd_boolean line_granularity; /* function or line granularity? */ +extern bfd_boolean print_descriptions; /* output profile description */ +extern bfd_boolean print_path; /* print path or just filename? */ +extern bfd_boolean ignore_non_functions; /* Ignore non-function symbols. */ + +extern File_Format file_format; /* requested file format */ + +extern bfd_boolean first_output; /* no output so far? */ + +extern void done PARAMS ((int status)) ATTRIBUTE_NORETURN; #endif /* gprof_h */ diff --git a/gnu/usr.bin/binutils/gprof/gprof.texi b/gnu/usr.bin/binutils/gprof/gprof.texi index 7bd5fb898de..9789ac7d993 100644 --- a/gnu/usr.bin/binutils/gprof/gprof.texi +++ b/gnu/usr.bin/binutils/gprof/gprof.texi @@ -18,14 +18,17 @@ END-INFO-DIR-ENTRY @ifinfo This file documents the gprof profiler of the GNU system. -Copyright (C) 1988, 92, 97, 98, 99, 2000 Free Software Foundation, Inc. +@c man begin COPYRIGHT +Copyright (C) 1988, 92, 97, 98, 99, 2000, 2001 Free Software Foundation, Inc. + +Permission is granted to copy, distribute and/or modify this document +under the terms of the GNU Free Documentation License, Version 1.1 +or any later version published by the Free Software Foundation; +with no Invariant Sections, with no Front-Cover Texts, and with no +Back-Cover Texts. A copy of the license is included in the +section entitled "GNU Free Documentation License". - Permission is granted to copy, distribute and/or modify this document - under the terms of the GNU Free Documentation License, Version 1.1 - or any later version published by the Free Software Foundation; - with no Invariant Sections, with no Front-Cover Texts, and with no - Back-Cover Texts. A copy of the license is included in the - section entitled "GNU Free Documentation License". +@c man end @ignore Permission is granted to process this file through Tex and print the @@ -63,7 +66,7 @@ Copyright @copyright{} 1988, 92, 97, 98, 99, 2000 Free Software Foundation, Inc. @end titlepage -@ifinfo +@ifnottex @node Top @top Profiling a Program: Where Does It Spend Its Time? @@ -91,11 +94,107 @@ section entitled "GNU Free Documentation License". * Details:: Details of how profiling is done * GNU Free Documentation License:: GNU Free Documentation License @end menu -@end ifinfo +@end ifnottex @node Introduction @chapter Introduction to Profiling +@ifset man +@c man title gprof display call graph profile data + +@smallexample +@c man begin SYNOPSIS +gprof [ -[abcDhilLsTvwxyz] ] [ -[ACeEfFJnNOpPqQZ][@var{name}] ] + [ -I @var{dirs} ] [ -d[@var{num}] ] [ -k @var{from/to} ] + [ -m @var{min-count} ] [ -t @var{table-length} ] + [ --[no-]annotated-source[=@var{name}] ] + [ --[no-]exec-counts[=@var{name}] ] + [ --[no-]flat-profile[=@var{name}] ] [ --[no-]graph[=@var{name}] ] + [ --[no-]time=@var{name}] [ --all-lines ] [ --brief ] + [ --debug[=@var{level}] ] [ --function-ordering ] + [ --file-ordering ] [ --directory-path=@var{dirs} ] + [ --display-unused-functions ] [ --file-format=@var{name} ] + [ --file-info ] [ --help ] [ --line ] [ --min-count=@var{n} ] + [ --no-static ] [ --print-path ] [ --separate-files ] + [ --static-call-graph ] [ --sum ] [ --table-length=@var{len} ] + [ --traditional ] [ --version ] [ --width=@var{n} ] + [ --ignore-non-functions ] [ --demangle[=@var{STYLE}] ] + [ --no-demangle ] [ @var{image-file} ] [ @var{profile-file} @dots{} ] +@c man end +@end smallexample + +@c man begin DESCRIPTION +@code{gprof} produces an execution profile of C, Pascal, or Fortran77 +programs. The effect of called routines is incorporated in the profile +of each caller. The profile data is taken from the call graph profile file +(@file{gmon.out} default) which is created by programs +that are compiled with the @samp{-pg} option of +@code{cc}, @code{pc}, and @code{f77}. +The @samp{-pg} option also links in versions of the library routines +that are compiled for profiling. @code{Gprof} reads the given object +file (the default is @code{a.out}) and establishes the relation between +its symbol table and the call graph profile from @file{gmon.out}. +If more than one profile file is specified, the @code{gprof} +output shows the sum of the profile information in the given profile files. + +@code{Gprof} calculates the amount of time spent in each routine. +Next, these times are propagated along the edges of the call graph. +Cycles are discovered, and calls into a cycle are made to share the time +of the cycle. + +@c man end + +@c man begin BUGS +The granularity of the sampling is shown, but remains +statistical at best. +We assume that the time for each execution of a function +can be expressed by the total time for the function divided +by the number of times the function is called. +Thus the time propagated along the call graph arcs to the function's +parents is directly proportional to the number of times that +arc is traversed. + +Parents that are not themselves profiled will have the time of +their profiled children propagated to them, but they will appear +to be spontaneously invoked in the call graph listing, and will +not have their time propagated further. +Similarly, signal catchers, even though profiled, will appear +to be spontaneous (although for more obscure reasons). +Any profiled children of signal catchers should have their times +propagated properly, unless the signal catcher was invoked during +the execution of the profiling routine, in which case all is lost. + +The profiled program must call @code{exit}(2) +or return normally for the profiling information to be saved +in the @file{gmon.out} file. +@c man end + +@c man begin FILES +@table @code +@item @file{a.out} +the namelist and text space. +@item @file{gmon.out} +dynamic call graph and profile. +@item @file{gmon.sum} +summarized dynamic call graph and profile. +@end table +@c man end + +@c man begin SEEALSO +monitor(3), profil(2), cc(1), prof(1), and the Info entry for @file{gprof}. + +``An Execution Profiler for Modular Programs'', +by S. Graham, P. Kessler, M. McKusick; +Software - Practice and Experience, +Vol. 13, pp. 671-685, 1983. + +``gprof: A Call Graph Execution Profiler'', +by S. Graham, P. Kessler, M. McKusick; +Proceedings of the SIGPLAN '82 Symposium on Compiler Construction, +SIGPLAN Notices, Vol. 17, No 6, pp. 120-126, June 1982. +@c man end +@end ifset + Profiling allows you to learn where your program spent its time and which functions called which other functions while it was executing. This information can show you which pieces of your program are slower than you @@ -129,6 +228,8 @@ You must run @code{gprof} to analyze the profile data. The next three chapters explain these steps in greater detail. +@c man begin DESCRIPTION + Several forms of output are available from the analysis. The @dfn{flat profile} shows how much time your program spent in each function, @@ -145,6 +246,7 @@ lot of time. @xref{Call Graph}. The @dfn{annotated source} listing is a copy of the program's source code, labeled with the number of times each line of the program was executed. @xref{Annotated Source}. +@c man end To better understand how profiling works, you may wish to read a description of its implementation. @@ -255,7 +357,21 @@ appearance of a human-readable @file{bb.out} means the basic-block counts didn't get written into @file{gmon.out}. The Perl script @code{bbconv.pl}, included with the @code{gprof} source distribution, will convert a @file{bb.out} file into -a format readable by @code{gprof}. +a format readable by @code{gprof}. Invoke it like this: + +@smallexample +bbconv.pl < bb.out > @var{bh-data} +@end smallexample + +This translates the information in @file{bb.out} into a form that +@code{gprof} can understand. But you still need to tell @code{gprof} +about the existence of this translated information. To do that, include +@var{bb-data} on the @code{gprof} command line, @emph{along with +@file{gmon.out}}, like this: + +@smallexample +gprof @var{options} @var{executable-file} gmon.out @var{bb-data} [@var{yet-more-profile-data-files}@dots{}] [> @var{outfile}] +@end smallexample @node Invoking @chapter @code{gprof} Command Summary @@ -297,6 +413,7 @@ The order of these options does not matter. @node Output Options,Analysis Options,,Invoking @section Output Options +@c man begin OPTIONS These options specify which of several output formats @code{gprof} should produce. @@ -635,6 +752,8 @@ may be given; only one @var{function_name} may be indicated with each @end table +@c man end + Note that only one function can be specified with each @code{-e}, @code{-E}, @code{-f} or @code{-F} option. To specify more than one function, use multiple options. For example, this command: @@ -1731,9 +1850,9 @@ format. The new file format is defined in header file @file{gmon_out.h}. It consists of a header containing the magic cookie and a version number, as well as some spare bytes available for future extensions. All data -in a profile data file is in the native format of the host on which -the profile was collected. @sc{gnu} @code{gprof} adapts automatically to the -byte-order in use. +in a profile data file is in the native format of the target for which +the profile was collected. @sc{gnu} @code{gprof} adapts automatically +to the byte-order in use. In the new file format, the header is followed by a sequence of records. Currently, there are three different record types: histogram diff --git a/gnu/usr.bin/binutils/gprof/hertz.c b/gnu/usr.bin/binutils/gprof/hertz.c index 1998d4b7b72..6fa1db49ce2 100644 --- a/gnu/usr.bin/binutils/gprof/hertz.c +++ b/gnu/usr.bin/binutils/gprof/hertz.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 1983, 1993, 2001 + * Copyright (c) 1983, 1993 * The Regents of the University of California. All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -26,6 +26,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ +#include "gprof.h" #include "hertz.h" diff --git a/gnu/usr.bin/binutils/gprof/hertz.h b/gnu/usr.bin/binutils/gprof/hertz.h index fc30a1f9d78..7f8b3ee58b2 100644 --- a/gnu/usr.bin/binutils/gprof/hertz.h +++ b/gnu/usr.bin/binutils/gprof/hertz.h @@ -1,8 +1,6 @@ #ifndef hertz_h #define hertz_h -#include "gprof.h" - #define HZ_WRONG 0 /* impossible clock frequency */ /* diff --git a/gnu/usr.bin/binutils/gprof/hist.c b/gnu/usr.bin/binutils/gprof/hist.c index ed360cdc8b6..bfa34eebf08 100644 --- a/gnu/usr.bin/binutils/gprof/hist.c +++ b/gnu/usr.bin/binutils/gprof/hist.c @@ -1,6 +1,6 @@ /* hist.c - Histogram related operations. - Copyright 2000, 2001 Free Software Foundation, Inc. + Copyright 2000, 2001, 2002 Free Software Foundation, Inc. This file is part of GNU Binutils. @@ -19,20 +19,24 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include <stdio.h> #include "libiberty.h" #include "gprof.h" +#include "search_list.h" +#include "source.h" +#include "symtab.h" #include "corefile.h" #include "gmon_io.h" #include "gmon_out.h" #include "hist.h" -#include "symtab.h" #include "sym_ids.h" #include "utils.h" #define UNITS_TO_CODE (offset_to_code / sizeof(UNIT)) static void scale_and_align_entries PARAMS ((void)); +static void print_header PARAMS ((int)); +static void print_line PARAMS ((Sym *, double)); +static int cmp_time PARAMS ((const PTR, const PTR)); /* Declarations of automatically generated functions to output blurbs. */ extern void flat_blurb PARAMS ((FILE * fp)); @@ -76,7 +80,9 @@ SItab[] = is provided for formatting error messages only. */ void -DEFUN (hist_read_rec, (ifp, filename), FILE * ifp AND const char *filename) +hist_read_rec (ifp, filename) + FILE * ifp; + const char *filename; { bfd_vma n_lowpc, n_highpc; int i, ncnt, profrate; @@ -151,7 +157,9 @@ DEFUN (hist_read_rec, (ifp, filename), FILE * ifp AND const char *filename) of OFP and is provided for formatting error-messages only. */ void -DEFUN (hist_write_hist, (ofp, filename), FILE * ofp AND const char *filename) +hist_write_hist (ofp, filename) + FILE * ofp; + const char *filename; { UNIT count; int i; @@ -172,7 +180,7 @@ DEFUN (hist_write_hist, (ofp, filename), FILE * ofp AND const char *filename) for (i = 0; i < hist_num_bins; ++i) { - bfd_put_16 (core_bfd, hist_sample[i], (bfd_byte *) & count[0]); + bfd_put_16 (core_bfd, (bfd_vma) hist_sample[i], (bfd_byte *) &count[0]); if (fwrite (&count[0], sizeof (count), 1, ofp) != 1) { @@ -254,7 +262,7 @@ scale_and_align_entries () cases, above). */ void -DEFUN_VOID (hist_assign_samples) +hist_assign_samples () { bfd_vma bin_low_pc, bin_high_pc; bfd_vma sym_low_pc, sym_high_pc; @@ -343,7 +351,8 @@ DEFUN_VOID (hist_assign_samples) /* Print header for flag histogram profile. */ static void -DEFUN (print_header, (prefix), const char prefix) +print_header (prefix) + int prefix; { char unit[64]; @@ -382,7 +391,9 @@ DEFUN (print_header, (prefix), const char prefix) static void -DEFUN (print_line, (sym, scale), Sym * sym AND double scale) +print_line (sym, scale) + Sym *sym; + double scale; { if (ignore_zeros && sym->ncalls == 0 && sym->hist.time == 0) return; @@ -419,7 +430,9 @@ DEFUN (print_line, (sym, scale), Sym * sym AND double scale) lexicographic order of the function names. */ static int -DEFUN (cmp_time, (lp, rp), const PTR lp AND const PTR rp) +cmp_time (lp, rp) + const PTR lp; + const PTR rp; { const Sym *left = *(const Sym **) lp; const Sym *right = *(const Sym **) rp; @@ -446,11 +459,11 @@ DEFUN (cmp_time, (lp, rp), const PTR lp AND const PTR rp) /* Print the flat histogram profile. */ void -DEFUN_VOID (hist_print) +hist_print () { Sym **time_sorted_syms, *top_dog, *sym; unsigned int index; - int log_scale; + unsigned log_scale; double top_time, time; bfd_vma addr; @@ -515,11 +528,12 @@ DEFUN_VOID (hist_print) { top_time /= hz; - while (SItab[log_scale].scale * top_time < 1000.0 - && ((size_t) log_scale - < sizeof (SItab) / sizeof (SItab[0]) - 1)) + for (log_scale = 0; log_scale < ARRAY_SIZE (SItab); log_scale ++) { - ++log_scale; + double scaled_value = SItab[log_scale].scale * top_time; + + if (scaled_value >= 1.0 && scaled_value < 1000.0) + break; } } } diff --git a/gnu/usr.bin/binutils/gprof/hist.h b/gnu/usr.bin/binutils/gprof/hist.h index ea395cd06c2..fe4362bdec0 100644 --- a/gnu/usr.bin/binutils/gprof/hist.h +++ b/gnu/usr.bin/binutils/gprof/hist.h @@ -21,8 +21,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef hist_h #define hist_h -#include "bfd.h" - extern bfd_vma s_lowpc; /* Lowpc from the profile file. */ extern bfd_vma s_highpc; /* Highpc from the profile file. */ extern bfd_vma lowpc, highpc; /* Range profiled, in UNIT's. */ diff --git a/gnu/usr.bin/binutils/gprof/i386.c b/gnu/usr.bin/binutils/gprof/i386.c index 3f10ae0bd97..0fcaa78a719 100644 --- a/gnu/usr.bin/binutils/gprof/i386.c +++ b/gnu/usr.bin/binutils/gprof/i386.c @@ -27,14 +27,19 @@ * SUCH DAMAGE. */ #include "gprof.h" +#include "search_list.h" +#include "source.h" +#include "symtab.h" #include "cg_arcs.h" #include "corefile.h" #include "hist.h" -#include "symtab.h" +static int i386_iscall PARAMS ((unsigned char *)); +void i386_find_call PARAMS ((Sym *, bfd_vma, bfd_vma)); -int -DEFUN (i386_iscall, (ip), unsigned char *ip) +static int +i386_iscall (ip) + unsigned char *ip; { if (*ip == 0xe8) return 1; @@ -50,7 +55,7 @@ i386_find_call (parent, p_lowpc, p_highpc) { unsigned char *instructp; Sym *child; - bfd_vma destpc, delta; + bfd_vma pc, destpc; if (core_text_space == 0) { @@ -68,25 +73,20 @@ i386_find_call (parent, p_lowpc, p_highpc) parent->name, (unsigned long) p_lowpc, (unsigned long) p_highpc)); - delta = (bfd_vma) core_text_space - core_text_sect->vma; - - for (instructp = (unsigned char *) (p_lowpc + delta); - instructp < (unsigned char *) (p_highpc + delta); - instructp ++) + for (pc = p_lowpc; pc < p_highpc; ++pc) { + instructp = (unsigned char *) core_text_space + pc - core_text_sect->vma; if (i386_iscall (instructp)) { DBG (CALLDEBUG, - printf ("[findcall]\t0x%lx:call", - (unsigned long) (instructp - (unsigned char *) delta))); + printf ("[findcall]\t0x%lx:call", (unsigned long) pc)); /* * regular pc relative addressing * check that this is the address of * a function. */ - destpc = ((bfd_vma) bfd_get_32 (core_bfd, instructp + 1) - + (bfd_vma) instructp - (bfd_vma) delta + 5); + destpc = bfd_get_32 (core_bfd, instructp + 1) + pc + 5; if (destpc >= s_lowpc && destpc <= s_highpc) { child = sym_lookup (&symtab, destpc); diff --git a/gnu/usr.bin/binutils/gprof/search_list.c b/gnu/usr.bin/binutils/gprof/search_list.c index 743fbdac608..50b4cf2e3d8 100644 --- a/gnu/usr.bin/binutils/gprof/search_list.c +++ b/gnu/usr.bin/binutils/gprof/search_list.c @@ -1,6 +1,6 @@ /* search-list.c - Copyright 2000, 2001 Free Software Foundation, Inc. + Copyright 2000, 2001, 2002 Free Software Foundation, Inc. This file is part of GNU Binutils. @@ -25,12 +25,13 @@ void -DEFUN (search_list_append, (list, paths), - Search_List * list AND const char *paths) +search_list_append (list, paths) + Search_List *list; + const char *paths; { Search_List_Elem *new_el; const char *beg, *colon; - int len; + unsigned int len; colon = paths - 1; do diff --git a/gnu/usr.bin/binutils/gprof/source.c b/gnu/usr.bin/binutils/gprof/source.c index 7b9401f60ad..4074b2ba0cd 100644 --- a/gnu/usr.bin/binutils/gprof/source.c +++ b/gnu/usr.bin/binutils/gprof/source.c @@ -1,6 +1,6 @@ /* source.c - Keep track of source files. - Copyright 2000, 2001 Free Software Foundation, Inc. + Copyright 2000, 2001, 2002 Free Software Foundation, Inc. This file is part of GNU Binutils. @@ -28,14 +28,15 @@ #define EXT_ANNO "-ann" /* Postfix of annotated files. */ /* Default option values. */ -bool create_annotation_files = FALSE; +bfd_boolean create_annotation_files = FALSE; Search_List src_search_list = {0, 0}; Source_File *first_src_file = 0; Source_File * -DEFUN (source_file_lookup_path, (path), const char *path) +source_file_lookup_path (path) + const char *path; { Source_File *sf; @@ -62,7 +63,8 @@ DEFUN (source_file_lookup_path, (path), const char *path) Source_File * -DEFUN (source_file_lookup_name, (filename), const char *filename) +source_file_lookup_name (filename) + const char *filename; { const char *fname; Source_File *sf; @@ -89,14 +91,15 @@ DEFUN (source_file_lookup_name, (filename), const char *filename) FILE * -DEFUN (annotate_source, (sf, max_width, annote, arg), - Source_File * sf AND int max_width - AND void (*annote) PARAMS ((char *buf, int w, int l, void *arg)) - AND void *arg) +annotate_source (sf, max_width, annote, arg) + Source_File *sf; + unsigned int max_width; + void (*annote) PARAMS ((char *, unsigned int, int, void *)); + void *arg; { - static bool first_file = TRUE; + static bfd_boolean first_file = TRUE; int i, line_num, nread; - bool new_line; + bfd_boolean new_line; char buf[8192]; char fname[PATH_MAX]; char *annotation, *name_only; diff --git a/gnu/usr.bin/binutils/gprof/source.h b/gnu/usr.bin/binutils/gprof/source.h index 58a4e976a1b..53eac5eca73 100644 --- a/gnu/usr.bin/binutils/gprof/source.h +++ b/gnu/usr.bin/binutils/gprof/source.h @@ -1,6 +1,6 @@ /* source.h - Copyright 2000, 2001 Free Software Foundation, Inc. + Copyright 2000, 2001, 2002 Free Software Foundation, Inc. This file is part of GNU Binutils. @@ -21,10 +21,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef source_h #define source_h -#include <stdio.h> -#include "gprof.h" -#include "search_list.h" - typedef struct source_file { struct source_file *next; @@ -37,7 +33,9 @@ typedef struct source_file Source_File; /* Options. */ -extern bool create_annotation_files; /* Create annotated output files? */ + +/* Create annotated output files? */ +extern bfd_boolean create_annotation_files; /* List of directories to search for source files. */ extern Search_List src_search_list; @@ -57,8 +55,8 @@ extern Source_File *source_file_lookup_name PARAMS ((const char *)); Returns a pointer to the output file (which maybe stdout) such that summary statistics can be printed. If the returned file is not stdout, it should be closed when done with it. */ -extern FILE *annotate_source PARAMS ((Source_File * sf, int max_width, - void (*annote) (char *b, int w, int l, - void *arg), - void *arg)); +extern FILE *annotate_source + PARAMS ((Source_File *sf, unsigned int max_width, + void (*annote) (char *, unsigned int, int, PTR arg), + PTR arg)); #endif /* source_h */ diff --git a/gnu/usr.bin/binutils/gprof/sparc.c b/gnu/usr.bin/binutils/gprof/sparc.c index 233a3e24af2..7fb9b195744 100644 --- a/gnu/usr.bin/binutils/gprof/sparc.c +++ b/gnu/usr.bin/binutils/gprof/sparc.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 1983, 1993, 2001 + * Copyright (c) 1983, 1993 * The Regents of the University of California. All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -27,28 +27,30 @@ * SUCH DAMAGE. */ #include "gprof.h" +#include "search_list.h" +#include "source.h" +#include "symtab.h" #include "cg_arcs.h" #include "corefile.h" #include "hist.h" -#include "symtab.h" /* * opcode of the `callf' instruction */ #define CALL (0xc0000000) +void sparc_find_call PARAMS ((Sym *, bfd_vma, bfd_vma)); + void sparc_find_call (parent, p_lowpc, p_highpc) Sym *parent; bfd_vma p_lowpc; bfd_vma p_highpc; { - bfd_vma dest_pc, delta; - unsigned int *instr; + bfd_vma pc, dest_pc; + unsigned int insn; Sym *child; - delta = (bfd_vma) core_text_space - core_text_sect->vma; - if (core_text_space == 0) { return; @@ -64,20 +66,20 @@ sparc_find_call (parent, p_lowpc, p_highpc) DBG (CALLDEBUG, printf ("[find_call] %s: 0x%lx to 0x%lx\n", parent->name, (unsigned long) p_lowpc, (unsigned long) p_highpc)); - for (instr = (unsigned int *) (((p_lowpc + delta) + 3) &~ 3); - instr < (unsigned int *) (p_highpc + delta); - ++instr) + for (pc = (p_lowpc + 3) & ~(bfd_vma) 3; pc < p_highpc; pc += 4) { - if ((*instr & CALL)) + insn = bfd_get_32 (core_bfd, ((unsigned char *) core_text_space + + pc - core_text_sect->vma)); + if (insn & CALL) { DBG (CALLDEBUG, - printf ("[find_call] 0x%lx: callf", - (unsigned long) instr - delta)); + printf ("[find_call] 0x%lx: callf", (unsigned long) pc)); /* * Regular pc relative addressing check that this is the * address of a function. */ - dest_pc = ((bfd_vma) (instr + (*instr & ~CALL))) - delta; + dest_pc = pc + (((bfd_signed_vma) (insn & 0x3fffffff) + ^ 0x20000000) - 0x20000000); if (dest_pc >= s_lowpc && dest_pc <= s_highpc) { child = sym_lookup (&symtab, dest_pc); diff --git a/gnu/usr.bin/binutils/gprof/sym_ids.c b/gnu/usr.bin/binutils/gprof/sym_ids.c index f98ccbfe55c..f75088a30ea 100644 --- a/gnu/usr.bin/binutils/gprof/sym_ids.c +++ b/gnu/usr.bin/binutils/gprof/sym_ids.c @@ -1,6 +1,6 @@ /* sym_ids.c - Copyright 2000, 2001 Free Software Foundation, Inc. + Copyright 2000, 2001, 2002 Free Software Foundation, Inc. This file is part of GNU Binutils. @@ -19,9 +19,12 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include <ctype.h> - #include "libiberty.h" +#include "safe-ctype.h" +#include "gprof.h" +#include "search_list.h" +#include "source.h" +#include "symtab.h" #include "cg_arcs.h" #include "sym_ids.h" @@ -30,7 +33,7 @@ struct sym_id struct sym_id *next; char *spec; /* Parsing modifies this. */ Table_Id which_table; - bool has_right; + bfd_boolean has_right; struct match { @@ -43,6 +46,16 @@ struct sym_id } *id_list; +static void parse_spec + PARAMS ((char *, Sym *)); +static void parse_id + PARAMS ((struct sym_id *)); +static bfd_boolean match + PARAMS ((Sym *, Sym *)); +static void extend_match + PARAMS ((struct match *, Sym *, Sym_Table *, bfd_boolean)); + + Sym_Table syms[NUM_TABLES]; #ifdef DEBUG @@ -71,8 +84,9 @@ static Source_File non_existent_file = void -DEFUN (sym_id_add, (spec, which_table), - const char *spec AND Table_Id which_table) +sym_id_add (spec, which_table) + const char *spec; + Table_Id which_table; { struct sym_id *id; int len = strlen (spec); @@ -100,7 +114,9 @@ DEFUN (sym_id_add, (spec, which_table), FILENAME not containing a dot can be specified by FILENAME. */ static void -DEFUN (parse_spec, (spec, sym), char *spec AND Sym * sym) +parse_spec (spec, sym) + char *spec; + Sym *sym; { char *colon; @@ -123,7 +139,7 @@ DEFUN (parse_spec, (spec, sym), char *spec AND Sym * sym) if (strlen (spec)) { - if (isdigit ((unsigned char) spec[0])) + if (ISDIGIT (spec[0])) sym->line_num = atoi (spec); else sym->name = spec; @@ -139,7 +155,7 @@ DEFUN (parse_spec, (spec, sym), char *spec AND Sym * sym) if (!sym->file) sym->file = &non_existent_file; } - else if (isdigit ((unsigned char) *spec)) + else if (ISDIGIT (*spec)) { sym->line_num = atoi (spec); } @@ -155,7 +171,8 @@ DEFUN (parse_spec, (spec, sym), char *spec AND Sym * sym) by parse_spec(). */ static void -DEFUN (parse_id, (id), struct sym_id *id) +parse_id (id) + struct sym_id *id; { char *slash; @@ -203,8 +220,10 @@ DEFUN (parse_id, (id), struct sym_id *id) /* Return TRUE iff PATTERN matches SYM. */ -static bool -DEFUN (match, (pattern, sym), Sym * pattern AND Sym * sym) +static bfd_boolean +match (pattern, sym) + Sym *pattern; + Sym *sym; { return (pattern->file ? pattern->file == sym->file : TRUE) && (pattern->line_num ? pattern->line_num == sym->line_num : TRUE) @@ -216,8 +235,11 @@ DEFUN (match, (pattern, sym), Sym * pattern AND Sym * sym) static void -DEFUN (extend_match, (m, sym, tab, second_pass), - struct match *m AND Sym * sym AND Sym_Table * tab AND bool second_pass) +extend_match (m, sym, tab, second_pass) + struct match *m; + Sym *sym; + Sym_Table *tab; + bfd_boolean second_pass; { if (m->prev_match != sym - 1) { @@ -252,7 +274,7 @@ DEFUN (extend_match, (m, sym, tab, second_pass), requests---you get what you ask for! */ void -DEFUN_VOID (sym_id_parse) +sym_id_parse () { Sym *sym, *left, *right; struct sym_id *id; @@ -350,13 +372,15 @@ DEFUN_VOID (sym_id_parse) time requesting -k a/b. Fortunately, those symbol tables don't get very big (the user has to type them!), so a linear search is probably tolerable. */ -bool -DEFUN (sym_id_arc_is_present, (symtab, from, to), - Sym_Table * symtab AND Sym * from AND Sym * to) +bfd_boolean +sym_id_arc_is_present (sym_tab, from, to) + Sym_Table *sym_tab; + Sym *from; + Sym *to; { Sym *sym; - for (sym = symtab->base; sym < symtab->limit; ++sym) + for (sym = sym_tab->base; sym < sym_tab->limit; ++sym) { if (from->addr >= sym->addr && from->addr <= sym->end_addr && arc_lookup (sym, to)) diff --git a/gnu/usr.bin/binutils/gprof/sym_ids.h b/gnu/usr.bin/binutils/gprof/sym_ids.h index 4cef81d09c6..634ac969de9 100644 --- a/gnu/usr.bin/binutils/gprof/sym_ids.h +++ b/gnu/usr.bin/binutils/gprof/sym_ids.h @@ -1,6 +1,6 @@ /* sym_ids.h - Copyright 2000, 2001 Free Software Foundation, Inc. + Copyright 2000, 2001, 2002 Free Software Foundation, Inc. This file is part of GNU Binutils. @@ -21,8 +21,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef sym_ids_h #define sym_ids_h -#include "symtab.h" - typedef enum { INCL_GRAPH = 0, EXCL_GRAPH, @@ -37,8 +35,8 @@ Table_Id; extern Sym_Table syms[NUM_TABLES]; -extern void sym_id_add PARAMS ((const char *, Table_Id)); -extern void sym_id_parse PARAMS ((void)); -extern bool sym_id_arc_is_present PARAMS ((Sym_Table *, Sym *, Sym *)); +extern void sym_id_add PARAMS ((const char *, Table_Id)); +extern void sym_id_parse PARAMS ((void)); +extern bfd_boolean sym_id_arc_is_present PARAMS ((Sym_Table *, Sym *, Sym *)); #endif /* sym_ids_h */ diff --git a/gnu/usr.bin/binutils/gprof/symtab.c b/gnu/usr.bin/binutils/gprof/symtab.c index 6b5a093d067..c4ce7ed2159 100644 --- a/gnu/usr.bin/binutils/gprof/symtab.c +++ b/gnu/usr.bin/binutils/gprof/symtab.c @@ -1,6 +1,6 @@ /* symtab.c - Copyright 2000, 2001 Free Software Foundation, Inc. + Copyright 2000, 2001, 2002 Free Software Foundation, Inc. This file is part of GNU Binutils. @@ -20,9 +20,13 @@ 02111-1307, USA. */ #include "gprof.h" +#include "search_list.h" +#include "source.h" +#include "symtab.h" #include "cg_arcs.h" #include "corefile.h" -#include "symtab.h" + +static int cmp_addr PARAMS ((const PTR, const PTR)); Sym_Table symtab; @@ -30,7 +34,8 @@ Sym_Table symtab; /* Initialize a symbol (so it's empty). */ void -DEFUN (sym_init, (sym), Sym * sym) +sym_init (sym) + Sym *sym; { memset (sym, 0, sizeof (*sym)); @@ -54,10 +59,12 @@ DEFUN (sym_init, (sym), Sym * sym) the global symbol survives. */ static int -DEFUN (cmp_addr, (lp, rp), const PTR lp AND const PTR rp) +cmp_addr (lp, rp) + const PTR lp; + const PTR rp; { - Sym *left = (Sym *) lp; - Sym *right = (Sym *) rp; + const Sym *left = (const Sym *) lp; + const Sym *right = (const Sym *) rp; if (left->addr > right->addr) return 1; @@ -72,7 +79,8 @@ DEFUN (cmp_addr, (lp, rp), const PTR lp AND const PTR rp) void -DEFUN (symtab_finalize, (tab), Sym_Table * tab) +symtab_finalize (tab) + Sym_Table *tab; { Sym *src, *dst; bfd_vma prev_addr; @@ -169,7 +177,9 @@ DEFUN (symtab_finalize, (tab), Sym_Table * tab) #ifdef DEBUG Sym * -DEFUN (dbg_sym_lookup, (symtab, address), Sym_Table * symtab AND bfd_vma address) +dbg_sym_lookup (sym_tab, address) + Sym_Table *sym_tab; + bfd_vma address; { long low, mid, high; Sym *sym; @@ -177,8 +187,8 @@ DEFUN (dbg_sym_lookup, (symtab, address), Sym_Table * symtab AND bfd_vma address fprintf (stderr, "[dbg_sym_lookup] address 0x%lx\n", (unsigned long) address); - sym = symtab->base; - for (low = 0, high = symtab->len - 1; low != high;) + sym = sym_tab->base; + for (low = 0, high = sym_tab->len - 1; low != high;) { mid = (high + low) >> 1; @@ -208,7 +218,9 @@ DEFUN (dbg_sym_lookup, (symtab, address), Sym_Table * symtab AND bfd_vma address /* Look up an address in the symbol-table that is sorted by address. If address does not hit any symbol, 0 is returned. */ Sym * -DEFUN (sym_lookup, (symtab, address), Sym_Table * symtab AND bfd_vma address) +sym_lookup (sym_tab, address) + Sym_Table *sym_tab; + bfd_vma address; { long low, high; long mid = -1; @@ -217,11 +229,11 @@ DEFUN (sym_lookup, (symtab, address), Sym_Table * symtab AND bfd_vma address) int probes = 0; #endif /* DEBUG */ - if (!symtab->len) + if (!sym_tab->len) return 0; - sym = symtab->base; - for (low = 0, high = symtab->len - 1; low != high;) + sym = sym_tab->base; + for (low = 0, high = sym_tab->len - 1; low != high;) { DBG (LOOKUPDEBUG, ++probes); mid = (high + low) / 2; @@ -238,7 +250,7 @@ DEFUN (sym_lookup, (symtab, address), Sym_Table * symtab AND bfd_vma address) { DBG (LOOKUPDEBUG, printf ("[sym_lookup] %d probes (symtab->len=%u)\n", - probes, symtab->len - 1)); + probes, sym_tab->len - 1)); return &sym[mid]; } } @@ -259,7 +271,7 @@ DEFUN (sym_lookup, (symtab, address), Sym_Table * symtab AND bfd_vma address) else { DBG (LOOKUPDEBUG, printf ("[sym_lookup] %d (%u) probes, fall off\n", - probes, symtab->len - 1)); + probes, sym_tab->len - 1)); return &sym[mid + 1]; } } diff --git a/gnu/usr.bin/binutils/gprof/symtab.h b/gnu/usr.bin/binutils/gprof/symtab.h index 8aa9ee534f2..4ff507d1876 100644 --- a/gnu/usr.bin/binutils/gprof/symtab.h +++ b/gnu/usr.bin/binutils/gprof/symtab.h @@ -1,6 +1,6 @@ /* symtab.h - Copyright 2000, 2001 Free Software Foundation, Inc. + Copyright 2000, 2001, 2002 Free Software Foundation, Inc. This file is part of GNU Binutils. @@ -21,9 +21,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef symtab_h #define symtab_h -#include "bfd.h" -#include "gprof.h" - /* For a profile to be intelligible to a human user, it is necessary to map code-addresses into source-code information. Source-code information can be any combination of: (i) function-name, (ii) @@ -32,8 +29,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ The symbol table is used to map addresses into source-code information. */ -#include "source.h" - #define NBBS 10 /* Symbol-entry. For each external in the specified file we gather @@ -82,7 +77,7 @@ typedef struct sym double child_time; /* Cumulative ticks in children. */ int index; /* Index in the graph list. */ int top_order; /* Graph call chain top-sort order. */ - bool print_flag; /* Should this be printed? */ + bfd_boolean print_flag; /* Should this be printed? */ struct { double fract; /* What % of time propagates. */ @@ -118,6 +113,9 @@ extern Sym_Table symtab; /* The symbol table. */ extern void sym_init PARAMS ((Sym *)); extern void symtab_finalize PARAMS ((Sym_Table *)); +#ifdef DEBUG +extern Sym *dbg_sym_lookup PARAMS ((Sym_Table *, bfd_vma)); +#endif extern Sym *sym_lookup PARAMS ((Sym_Table *, bfd_vma)); extern void find_call PARAMS ((Sym *, bfd_vma, bfd_vma)); diff --git a/gnu/usr.bin/binutils/gprof/tahoe.c b/gnu/usr.bin/binutils/gprof/tahoe.c index 84cc2133ea3..1e7da7df0ac 100644 --- a/gnu/usr.bin/binutils/gprof/tahoe.c +++ b/gnu/usr.bin/binutils/gprof/tahoe.c @@ -27,10 +27,12 @@ * SUCH DAMAGE. */ #include "gprof.h" +#include "search_list.h" +#include "source.h" +#include "symtab.h" #include "cg_arcs.h" #include "corefile.h" #include "hist.h" -#include "symtab.h" /* * opcode of the `callf' instruction @@ -54,16 +56,21 @@ typedef enum tahoe_opermodes tahoe_operandenum; /* * A symbol to be the child of indirect callf: */ -Sym indirectchild; +static Sym indirectchild; +static tahoe_operandenum tahoe_operandmode PARAMS ((unsigned char *)); +static char *tahoe_operandname PARAMS ((tahoe_operandenum)); +static long tahoe_operandlength PARAMS ((unsigned char *)); +static bfd_signed_vma tahoe_offset PARAMS ((unsigned char *)); +void tahoe_find_call PARAMS ((Sym *, bfd_vma, bfd_vma)); -tahoe_operandenum +static tahoe_operandenum tahoe_operandmode (modep) unsigned char *modep; { - long usesreg = ((long) *modep) & 0xf; + long usesreg = *modep & 0xf; - switch (((long) *modep) >> 4) + switch ((*modep >> 4) & 0xf) { case 0: case 1: @@ -99,7 +106,7 @@ tahoe_operandmode (modep) abort (); } -char * +static char * tahoe_operandname (mode) tahoe_operandenum mode; { @@ -153,7 +160,7 @@ tahoe_operandname (mode) abort (); } -long +static long tahoe_operandlength (modep) unsigned char *modep; { @@ -191,34 +198,24 @@ tahoe_operandlength (modep) abort (); } -bfd_vma -tahoe_reladdr (modep) - char *modep; +static bfd_signed_vma +tahoe_offset (modep) + unsigned char *modep; { tahoe_operandenum mode = tahoe_operandmode (modep); - char *cp; - short *sp; - long *lp; - int i; - long value = 0; - cp = modep; - ++cp; /* skip over the mode */ + ++modep; /* skip over the mode */ switch (mode) { default: fprintf (stderr, "[reladdr] not relative address\n"); - return (bfd_vma) modep; + return 0; case byterel: - return (bfd_vma) (cp + sizeof *cp + *cp); + return 1 + bfd_get_signed_8 (core_bfd, modep); case wordrel: - for (i = 0; (size_t) i < sizeof *sp; i++) - value = (value << 8) + (cp[i] & 0xff); - return (bfd_vma) (cp + sizeof *sp + value); + return 2 + bfd_get_signed_16 (core_bfd, modep); case longrel: - for (i = 0; (size_t) i < sizeof *lp; i++) - value = (value << 8) + (cp[i] & 0xff); - return (bfd_vma) (cp + sizeof *lp + value); + return 4 + bfd_get_signed_32 (core_bfd, modep); } } @@ -233,8 +230,8 @@ tahoe_find_call (parent, p_lowpc, p_highpc) Sym *child; tahoe_operandenum mode; tahoe_operandenum firstmode; - bfd_vma destpc; - static bool inited = FALSE; + bfd_vma pc, destpc; + static bfd_boolean inited = FALSE; if (!inited) { @@ -259,21 +256,19 @@ tahoe_find_call (parent, p_lowpc, p_highpc) DBG (CALLDEBUG, printf ("[findcall] %s: 0x%lx to 0x%lx\n", parent->name, (unsigned long) p_lowpc, (unsigned long) p_highpc)); - for (instructp = (unsigned char *) core_text_space + p_lowpc; - instructp < (unsigned char *) core_text_space + p_highpc; - instructp += length) + for (pc = p_lowpc; pc < p_highpc; pc += length) { length = 1; - if (*instructp == CALLF) + instructp = ((unsigned char *) core_text_space + + pc - core_text_sect->vma); + if ((*instructp & 0xff) == CALLF) { /* * maybe a callf, better check it out. * skip the count of the number of arguments. */ DBG (CALLDEBUG, printf ("[findcall]\t0x%lx:callf", - ((unsigned long) - (instructp - - (unsigned char *) core_text_space)))); + (unsigned long) pc)); firstmode = tahoe_operandmode (instructp + length); switch (firstmode) { @@ -317,8 +312,7 @@ tahoe_find_call (parent, p_lowpc, p_highpc) * check that this is the address of * a function. */ - destpc = tahoe_reladdr (instructp + length) - - (bfd_vma) core_text_space; + destpc = pc + tahoe_offset (instructp + length); if (destpc >= s_lowpc && destpc <= s_highpc) { child = sym_lookup (&symtab, destpc); diff --git a/gnu/usr.bin/binutils/gprof/utils.c b/gnu/usr.bin/binutils/gprof/utils.c index 143ad90173d..0f54a61fd11 100644 --- a/gnu/usr.bin/binutils/gprof/utils.c +++ b/gnu/usr.bin/binutils/gprof/utils.c @@ -26,17 +26,21 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ -#include <demangle.h> +#include "demangle.h" #include "gprof.h" -#include "cg_arcs.h" +#include "search_list.h" +#include "source.h" #include "symtab.h" +#include "cg_arcs.h" +#include "utils.h" /* * Print name of symbol. Return number of characters printed. */ int -DEFUN (print_name_only, (self), Sym * self) +print_name_only (self) + Sym *self; { const char *name = self->name; const char *filename; @@ -95,7 +99,8 @@ DEFUN (print_name_only, (self), Sym * self) void -DEFUN (print_name, (self), Sym * self) +print_name (self) + Sym *self; { print_name_only (self); diff --git a/gnu/usr.bin/binutils/gprof/vax.c b/gnu/usr.bin/binutils/gprof/vax.c index 4012eced0ce..56f5f4f0ceb 100644 --- a/gnu/usr.bin/binutils/gprof/vax.c +++ b/gnu/usr.bin/binutils/gprof/vax.c @@ -27,10 +27,12 @@ * SUCH DAMAGE. */ #include "gprof.h" +#include "search_list.h" +#include "source.h" +#include "symtab.h" #include "cg_arcs.h" #include "corefile.h" #include "hist.h" -#include "symtab.h" /* * opcode of the `calls' instruction @@ -51,25 +53,34 @@ enum opermodes }; typedef enum opermodes operandenum; +#if 0 +/* Here to document only. We can't use this when cross compiling as + the bitfield layout might not be the same as native. */ struct modebyte { unsigned int regfield:4; unsigned int modefield:4; }; +#endif /* * A symbol to be the child of indirect calls: */ -Sym indirectchild; +static Sym indirectchild; +static operandenum vax_operandmode PARAMS ((unsigned char *)); +static char *vax_operandname PARAMS ((operandenum)); +static long vax_operandlength PARAMS ((unsigned char *)); +static bfd_signed_vma vax_offset PARAMS ((unsigned char *)); +void vax_find_call PARAMS ((Sym *, bfd_vma, bfd_vma)); static operandenum vax_operandmode (modep) - struct modebyte *modep; + unsigned char *modep; { - long usesreg = modep->regfield; + int usesreg = *modep & 0xf; - switch (modep->modefield) + switch ((*modep >> 4) & 0xf) { case 0: case 1: @@ -161,7 +172,7 @@ vax_operandname (mode) static long vax_operandlength (modep) - struct modebyte *modep; + unsigned char *modep; { switch (vax_operandmode (modep)) @@ -191,36 +202,30 @@ vax_operandlength (modep) case longreldef: return 5; case indexed: - return 1 + vax_operandlength ((struct modebyte *) ((char *) modep) + 1); + return 1 + vax_operandlength (modep + 1); } /* NOTREACHED */ abort (); } -static bfd_vma -vax_reladdr (modep) - struct modebyte *modep; +static bfd_signed_vma +vax_offset (modep) + unsigned char *modep; { operandenum mode = vax_operandmode (modep); - char *cp; - short *sp; - long *lp; - cp = (char *) modep; - ++cp; /* skip over the mode */ + ++modep; /* skip over the mode */ switch (mode) { default: fprintf (stderr, "[reladdr] not relative address\n"); - return (bfd_vma) modep; + return 0; case byterel: - return (bfd_vma) (cp + sizeof *cp + *cp); + return 1 + bfd_get_signed_8 (core_bfd, modep); case wordrel: - sp = (short *) cp; - return (bfd_vma) (cp + sizeof *sp + *sp); + return 2 + bfd_get_signed_16 (core_bfd, modep); case longrel: - lp = (long *) cp; - return (bfd_vma) (cp + sizeof *lp + *lp); + return 4 + bfd_get_signed_32 (core_bfd, modep); } } @@ -236,8 +241,8 @@ vax_find_call (parent, p_lowpc, p_highpc) Sym *child; operandenum mode; operandenum firstmode; - bfd_vma destpc; - static bool inited = FALSE; + bfd_vma pc, destpc; + static bfd_boolean inited = FALSE; if (!inited) { @@ -262,22 +267,20 @@ vax_find_call (parent, p_lowpc, p_highpc) DBG (CALLDEBUG, printf ("[findcall] %s: 0x%lx to 0x%lx\n", parent->name, (unsigned long) p_lowpc, (unsigned long) p_highpc)); - for (instructp = (unsigned char *) core_text_space + p_lowpc; - instructp < (unsigned char *) core_text_space + p_highpc; - instructp += length) + for (pc = p_lowpc; pc < p_highpc; pc += length) { length = 1; - if (*instructp == CALLS) + instructp = ((unsigned char *) core_text_space + + pc - core_text_sect->vma); + if ((*instructp & 0xff) == CALLS) { /* * maybe a calls, better check it out. * skip the count of the number of arguments. */ DBG (CALLDEBUG, - printf ("[findcall]\t0x%lx:calls", - ((unsigned long) - (instructp - (unsigned char *) core_text_space)))); - firstmode = vax_operandmode ((struct modebyte *) (instructp + length)); + printf ("[findcall]\t0x%lx:calls", (unsigned long) pc)); + firstmode = vax_operandmode (instructp + length); switch (firstmode) { case literal: @@ -286,8 +289,8 @@ vax_find_call (parent, p_lowpc, p_highpc) default: goto botched; } - length += vax_operandlength ((struct modebyte *) (instructp + length)); - mode = vax_operandmode ((struct modebyte *) (instructp + length)); + length += vax_operandlength (instructp + length); + mode = vax_operandmode (instructp + length); DBG (CALLDEBUG, printf ("\tfirst operand is %s", vax_operandname (firstmode)); printf ("\tsecond operand is %s\n", vax_operandname (mode))); @@ -309,8 +312,7 @@ vax_find_call (parent, p_lowpc, p_highpc) * e.g. arrays of pointers to functions???] */ arc_add (parent, &indirectchild, (unsigned long) 0); - length += vax_operandlength ( - (struct modebyte *) (instructp + length)); + length += vax_operandlength (instructp + length); continue; case byterel: case wordrel: @@ -320,8 +322,7 @@ vax_find_call (parent, p_lowpc, p_highpc) * check that this is the address of * a function. */ - destpc = vax_reladdr ((struct modebyte *) (instructp + length)) - - (bfd_vma) core_text_space; + destpc = pc + vax_offset (instructp + length); if (destpc >= s_lowpc && destpc <= s_highpc) { child = sym_lookup (&symtab, destpc); @@ -338,8 +339,7 @@ vax_find_call (parent, p_lowpc, p_highpc) * a hit */ arc_add (parent, child, (unsigned long) 0); - length += vax_operandlength ((struct modebyte *) - (instructp + length)); + length += vax_operandlength (instructp + length); continue; } goto botched; |