[Midnightbsd-cvs] src [11538] trunk/usr.bin/gprof: sync with freebsd.
laffer1 at midnightbsd.org
laffer1 at midnightbsd.org
Sat Jul 7 16:35:10 EDT 2018
Revision: 11538
http://svnweb.midnightbsd.org/src/?rev=11538
Author: laffer1
Date: 2018-07-07 16:35:09 -0400 (Sat, 07 Jul 2018)
Log Message:
-----------
sync with freebsd.
Modified Paths:
--------------
trunk/usr.bin/gprof/Makefile
trunk/usr.bin/gprof/amd64.h
trunk/usr.bin/gprof/aout.c
trunk/usr.bin/gprof/arcs.c
trunk/usr.bin/gprof/arm.h
trunk/usr.bin/gprof/dfn.c
trunk/usr.bin/gprof/elf.c
trunk/usr.bin/gprof/gprof.1
trunk/usr.bin/gprof/gprof.c
trunk/usr.bin/gprof/gprof.h
trunk/usr.bin/gprof/hertz.c
trunk/usr.bin/gprof/i386.h
trunk/usr.bin/gprof/ia64.h
trunk/usr.bin/gprof/kernel.c
trunk/usr.bin/gprof/lookup.c
trunk/usr.bin/gprof/mips.h
trunk/usr.bin/gprof/pathnames.h
trunk/usr.bin/gprof/powerpc.h
trunk/usr.bin/gprof/printgprof.c
trunk/usr.bin/gprof/printlist.c
trunk/usr.bin/gprof/sparc64.h
Property Changed:
----------------
trunk/usr.bin/gprof/gprof.1
Modified: trunk/usr.bin/gprof/Makefile
===================================================================
--- trunk/usr.bin/gprof/Makefile 2018-07-07 20:34:50 UTC (rev 11537)
+++ trunk/usr.bin/gprof/Makefile 2018-07-07 20:35:09 UTC (rev 11538)
@@ -1,5 +1,6 @@
+# $MidnightBSD$
# @(#)Makefile 8.1 (Berkeley) 6/29/93
-# $MidnightBSD$
+# $FreeBSD: stable/10/usr.bin/gprof/Makefile 201386 2010-01-02 10:27:05Z ed $
PROG= gprof
SRCS= gprof.c aout.c arcs.c dfn.c elf.c lookup.c hertz.c \
Modified: trunk/usr.bin/gprof/amd64.h
===================================================================
--- trunk/usr.bin/gprof/amd64.h 2018-07-07 20:34:50 UTC (rev 11537)
+++ trunk/usr.bin/gprof/amd64.h 2018-07-07 20:35:09 UTC (rev 11538)
@@ -1,3 +1,4 @@
+/* $MidnightBSD$ */
/*-
* Copyright (c) 1991, 1993
* The Regents of the University of California. All rights reserved.
@@ -27,7 +28,7 @@
* SUCH DAMAGE.
*
* @(#)i386.h 8.1 (Berkeley) 6/6/93
- * $MidnightBSD$
+ * $FreeBSD: stable/10/usr.bin/gprof/amd64.h 216370 2010-12-11 08:32:16Z joel $
*/
/*
Modified: trunk/usr.bin/gprof/aout.c
===================================================================
--- trunk/usr.bin/gprof/aout.c 2018-07-07 20:34:50 UTC (rev 11537)
+++ trunk/usr.bin/gprof/aout.c 2018-07-07 20:35:09 UTC (rev 11538)
@@ -1,3 +1,4 @@
+/* $MidnightBSD$ */
/*-
* Copyright (c) 1983, 1993
* The Regents of the University of California. All rights reserved.
@@ -35,7 +36,7 @@
#endif
#include <sys/cdefs.h>
-__MBSDID("$MidnightBSD$");
+__FBSDID("$FreeBSD: stable/10/usr.bin/gprof/aout.c 246783 2013-02-14 08:16:03Z charnier $");
#include <netinet/in.h>
@@ -68,7 +69,6 @@
aout_getnfile(const char *filename, char ***defaultEs)
{
FILE *nfile;
- int valcmp();
nfile = fopen( filename ,"r");
if (nfile == NULL)
Modified: trunk/usr.bin/gprof/arcs.c
===================================================================
--- trunk/usr.bin/gprof/arcs.c 2018-07-07 20:34:50 UTC (rev 11537)
+++ trunk/usr.bin/gprof/arcs.c 2018-07-07 20:35:09 UTC (rev 11538)
@@ -1,3 +1,4 @@
+/* $MidnightBSD$ */
/*
* Copyright (c) 1983, 1993
* The Regents of the University of California. All rights reserved.
@@ -34,7 +35,7 @@
#endif
#include <sys/cdefs.h>
-__MBSDID("$MidnightBSD$");
+__FBSDID("$FreeBSD: stable/10/usr.bin/gprof/arcs.c 246783 2013-02-14 08:16:03Z charnier $");
#include <err.h>
#include "gprof.h"
@@ -46,14 +47,13 @@
int oldcycle;
#endif /* DEBUG */
+int topcmp(const void *, const void *);
+
/*
* add (or just increment) an arc
*/
void
-addarc( parentp , childp , count )
- nltype *parentp;
- nltype *childp;
- long count;
+addarc(nltype *parentp, nltype *childp, long count)
{
arctype *arcp;
@@ -106,15 +106,16 @@
nltype **topsortnlp;
int
-topcmp( npp1 , npp2 )
- nltype **npp1;
- nltype **npp2;
+topcmp(const void *v1, const void *v2)
{
+ const nltype **npp1 = (const nltype **)v1;
+ const nltype **npp2 = (const nltype **)v2;
+
return (*npp1) -> toporder - (*npp2) -> toporder;
}
nltype **
-doarcs()
+doarcs(void)
{
nltype *parentp, **timesortnlp;
arctype *arcp;
@@ -252,7 +253,7 @@
}
void
-dotime()
+dotime(void)
{
int index;
@@ -263,8 +264,7 @@
}
void
-timepropagate( parentp )
- nltype *parentp;
+timepropagate(nltype *parentp)
{
arctype *arcp;
nltype *childp;
@@ -352,7 +352,7 @@
}
void
-cyclelink()
+cyclelink(void)
{
register nltype *nlp;
register nltype *cyclenlp;
@@ -445,7 +445,7 @@
* analyze cycles to determine breakup
*/
bool
-cycleanalyze()
+cycleanalyze(void)
{
arctype **cyclestack;
arctype **stkp;
@@ -521,10 +521,7 @@
}
bool
-descend( node , stkstart , stkp )
- nltype *node;
- arctype **stkstart;
- arctype **stkp;
+descend(nltype *node, arctype **stkstart, arctype **stkp)
{
arctype *arcp;
bool ret;
@@ -556,9 +553,7 @@
}
bool
-addcycle( stkstart , stkend )
- arctype **stkstart;
- arctype **stkend;
+addcycle(arctype **stkstart, arctype **stkend)
{
arctype **arcpp;
arctype **stkloc;
@@ -632,7 +627,7 @@
}
void
-compresslist()
+compresslist(void)
{
cltype *clp;
cltype **prev;
@@ -748,8 +743,7 @@
#ifdef DEBUG
void
-printsubcycle( clp )
- cltype *clp;
+printsubcycle(cltype *clp)
{
arctype **arcpp;
arctype **endlist;
@@ -764,7 +758,7 @@
#endif /* DEBUG */
void
-cycletime()
+cycletime(void)
{
int cycle;
nltype *cyclenlp;
@@ -794,7 +788,7 @@
* and while we're here, sum time for functions.
*/
void
-doflags()
+doflags(void)
{
int index;
nltype *childp;
@@ -889,8 +883,7 @@
* similarly, deal with propagation fractions from parents.
*/
void
-inheritflags( childp )
- nltype *childp;
+inheritflags(nltype *childp)
{
nltype *headp;
arctype *arcp;
Modified: trunk/usr.bin/gprof/arm.h
===================================================================
--- trunk/usr.bin/gprof/arm.h 2018-07-07 20:34:50 UTC (rev 11537)
+++ trunk/usr.bin/gprof/arm.h 2018-07-07 20:35:09 UTC (rev 11538)
@@ -1,3 +1,4 @@
+/* $MidnightBSD$ */
/*-
* Copyright (c) 1991, 1993
* The Regents of the University of California. All rights reserved.
@@ -27,7 +28,7 @@
* SUCH DAMAGE.
*
* @(#)i386.h 8.1 (Berkeley) 6/6/93
- * $MidnightBSD$
+ * $FreeBSD: stable/10/usr.bin/gprof/arm.h 216370 2010-12-11 08:32:16Z joel $
*/
/*
Modified: trunk/usr.bin/gprof/dfn.c
===================================================================
--- trunk/usr.bin/gprof/dfn.c 2018-07-07 20:34:50 UTC (rev 11537)
+++ trunk/usr.bin/gprof/dfn.c 2018-07-07 20:35:09 UTC (rev 11538)
@@ -1,3 +1,4 @@
+/* $MidnightBSD$ */
/*
* Copyright (c) 1983, 1993
* The Regents of the University of California. All rights reserved.
@@ -34,7 +35,7 @@
#endif
#include <sys/cdefs.h>
-__MBSDID("$MidnightBSD$");
+__FBSDID("$FreeBSD: stable/10/usr.bin/gprof/dfn.c 246783 2013-02-14 08:16:03Z charnier $");
#include <err.h>
#include "gprof.h"
@@ -52,7 +53,7 @@
int dfn_counter;
void
-dfn_init()
+dfn_init(void)
{
dfn_depth = 0;
@@ -63,8 +64,7 @@
* given this parent, depth first number its children.
*/
void
-dfn( parentp )
- nltype *parentp;
+dfn(nltype *parentp)
{
arctype *arcp;
@@ -110,8 +110,7 @@
* push a parent onto the stack and mark it busy
*/
void
-dfn_pre_visit( parentp )
- nltype *parentp;
+dfn_pre_visit(nltype *parentp)
{
dfn_depth += 1;
@@ -133,8 +132,7 @@
* are we already numbered?
*/
bool
-dfn_numbered( childp )
- nltype *childp;
+dfn_numbered(nltype *childp)
{
return ( childp -> toporder != DFN_NAN && childp -> toporder != DFN_BUSY );
@@ -144,8 +142,7 @@
* are we already busy?
*/
bool
-dfn_busy( childp )
- nltype *childp;
+dfn_busy(nltype *childp)
{
if ( childp -> toporder == DFN_NAN ) {
@@ -158,8 +155,7 @@
* MISSING: an explanation
*/
void
-dfn_findcycle( childp )
- nltype *childp;
+dfn_findcycle(nltype *childp)
{
int cycletop;
nltype *cycleheadp;
@@ -267,8 +263,7 @@
* for lint: ARGSUSED
*/
void
-dfn_self_cycle( parentp )
- nltype *parentp;
+dfn_self_cycle(nltype *parentp)
{
/*
* since we are taking out self-cycles elsewhere
@@ -289,8 +284,7 @@
* and pop it off the stack
*/
void
-dfn_post_visit( parentp )
- nltype *parentp;
+dfn_post_visit(nltype *parentp)
{
nltype *memberp;
Modified: trunk/usr.bin/gprof/elf.c
===================================================================
--- trunk/usr.bin/gprof/elf.c 2018-07-07 20:34:50 UTC (rev 11537)
+++ trunk/usr.bin/gprof/elf.c 2018-07-07 20:35:09 UTC (rev 11538)
@@ -1,3 +1,4 @@
+/* $MidnightBSD$ */
/*-
* Copyright (c) 1983, 1993
* The Regents of the University of California. All rights reserved.
@@ -35,7 +36,7 @@
#endif
#include <sys/cdefs.h>
-__MBSDID("$MidnightBSD$");
+__FBSDID("$FreeBSD: stable/10/usr.bin/gprof/elf.c 216370 2010-12-11 08:32:16Z joel $");
#include <sys/types.h>
#include <sys/mman.h>
Modified: trunk/usr.bin/gprof/gprof.1
===================================================================
--- trunk/usr.bin/gprof/gprof.1 2018-07-07 20:34:50 UTC (rev 11537)
+++ trunk/usr.bin/gprof/gprof.1 2018-07-07 20:35:09 UTC (rev 11538)
@@ -1,3 +1,4 @@
+.\" $MidnightBSD$
.\" Copyright (c) 1983, 1990, 1993
.\" The Regents of the University of California. All rights reserved.
.\"
@@ -26,7 +27,7 @@
.\" SUCH DAMAGE.
.\"
.\" @(#)gprof.1 8.1 (Berkeley) 6/6/93
-.\" $MidnightBSD$
+.\" $FreeBSD: stable/10/usr.bin/gprof/gprof.1 235211 2012-05-10 02:07:00Z gjb $
.\"
.Dd December 25, 2008
.Dt GPROF 1
Property changes on: trunk/usr.bin/gprof/gprof.1
___________________________________________________________________
Added: svn:keywords
## -0,0 +1 ##
+MidnightBSD=%H
\ No newline at end of property
Modified: trunk/usr.bin/gprof/gprof.c
===================================================================
--- trunk/usr.bin/gprof/gprof.c 2018-07-07 20:34:50 UTC (rev 11537)
+++ trunk/usr.bin/gprof/gprof.c 2018-07-07 20:35:09 UTC (rev 11538)
@@ -1,3 +1,4 @@
+/* $MidnightBSD$ */
/*
* Copyright (c) 1983, 1993
* The Regents of the University of California. All rights reserved.
@@ -40,7 +41,7 @@
#endif
#include <sys/cdefs.h>
-__MBSDID("$MidnightBSD$");
+__FBSDID("$FreeBSD: stable/10/usr.bin/gprof/gprof.c 246783 2013-02-14 08:16:03Z charnier $");
#include <err.h>
#include <limits.h>
@@ -51,15 +52,12 @@
static int valcmp(const void *, const void *);
-
static struct gmonhdr gmonhdr;
static int lflag;
static int Lflag;
int
-main(argc, argv)
- int argc;
- char **argv;
+main(int argc, char **argv)
{
char **sp;
nltype **timesortnlp;
@@ -233,11 +231,9 @@
* and the arcs.
*/
void
-getpfile(filename)
- char *filename;
+getpfile(char *filename)
{
FILE *pfile;
- FILE *openpfile();
struct rawarc arc;
pfile = openpfile(filename);
@@ -262,8 +258,7 @@
}
FILE *
-openpfile(filename)
- char *filename;
+openpfile(char *filename)
{
struct gmonhdr tmp;
FILE *pfile;
@@ -322,8 +317,7 @@
}
void
-tally( rawp )
- struct rawarc *rawp;
+tally(struct rawarc *rawp)
{
nltype *parentp;
nltype *childp;
@@ -351,8 +345,7 @@
* dump out the gmon.sum file
*/
void
-dumpsum( sumfile )
- char *sumfile;
+dumpsum(const char *sumfile)
{
register nltype *nlp;
register arctype *arcp;
@@ -393,9 +386,7 @@
}
static int
-valcmp(v1, v2)
- const void *v1;
- const void *v2;
+valcmp(const void *v1, const void *v2)
{
const nltype *p1 = (const nltype *)v1;
const nltype *p2 = (const nltype *)v2;
@@ -410,8 +401,7 @@
}
void
-readsamples(pfile)
- FILE *pfile;
+readsamples(FILE *pfile)
{
int i;
intmax_t sample;
@@ -491,11 +481,11 @@
* have any overlap (the two end cases, above).
*/
void
-asgnsamples()
+asgnsamples(void)
{
register int j;
double ccnt;
- double time;
+ double thetime;
unsigned long pcl, pch;
register int i;
unsigned long overlap;
@@ -511,7 +501,7 @@
continue;
pcl = lowpc + (unsigned long)(scale * i);
pch = lowpc + (unsigned long)(scale * (i + 1));
- time = ccnt;
+ thetime = ccnt;
# ifdef DEBUG
if ( debug & SAMPLEDEBUG ) {
printf( "[asgnsamples] pcl 0x%lx pch 0x%lx ccnt %.0f\n" ,
@@ -518,7 +508,7 @@
pcl , pch , ccnt );
}
# endif /* DEBUG */
- totime += time;
+ totime += thetime;
for (j = j - 1; j < nname; j++) {
svalue0 = nl[j].svalue;
svalue1 = nl[j+1].svalue;
@@ -541,10 +531,10 @@
printf("[asgnsamples] (0x%lx->0x%lx-0x%lx) %s gets %f ticks %lu overlap\n",
nl[j].value / HISTORICAL_SCALE_2,
svalue0, svalue1, nl[j].name,
- overlap * time / scale, overlap);
+ overlap * thetime / scale, overlap);
}
# endif /* DEBUG */
- nl[j].time += overlap * time / scale;
+ nl[j].time += overlap * thetime / scale;
}
}
}
@@ -557,8 +547,7 @@
unsigned long
-min(a, b)
- unsigned long a,b;
+min(unsigned long a, unsigned long b)
{
if (a<b)
return(a);
@@ -566,8 +555,7 @@
}
unsigned long
-max(a, b)
- unsigned long a,b;
+max(unsigned long a, unsigned long b)
{
if (a>b)
return(a);
@@ -581,7 +569,7 @@
* for a routine is in the next bucket.
*/
void
-alignentries()
+alignentries(void)
{
register struct nl *nlp;
unsigned long bucket_of_entry;
Modified: trunk/usr.bin/gprof/gprof.h
===================================================================
--- trunk/usr.bin/gprof/gprof.h 2018-07-07 20:34:50 UTC (rev 11537)
+++ trunk/usr.bin/gprof/gprof.h 2018-07-07 20:35:09 UTC (rev 11538)
@@ -1,3 +1,4 @@
+/* $MidnightBSD$ */
/*
* Copyright (c) 1983, 1993
* The Regents of the University of California. All rights reserved.
@@ -27,7 +28,7 @@
* SUCH DAMAGE.
*
* @(#)gprof.h 8.1 (Berkeley) 6/6/93
- * $MidnightBSD$
+ * $FreeBSD: stable/10/usr.bin/gprof/gprof.h 246783 2013-02-14 08:16:03Z charnier $
*/
#include <sys/types.h>
@@ -258,8 +259,8 @@
void addlist(struct stringlist *, char *);
void alignentries(void);
int aout_getnfile(const char *, char ***);
-int arccmp();
-arctype *arclookup();
+int arccmp(arctype *, arctype *);
+arctype *arclookup(nltype *, nltype *);
void asgnsamples(void);
void compresslist(void);
bool cycleanalyze(void);
@@ -267,25 +268,23 @@
void cycletime(void);
bool descend(nltype *, arctype **, arctype **);
void dfn(nltype *);
-bool dfn_busy();
+bool dfn_busy(nltype *);
void dfn_findcycle(nltype *);
void dfn_init(void);
-bool dfn_numbered();
+bool dfn_numbered(nltype *);
void dfn_post_visit(nltype *);
void dfn_pre_visit(nltype *);
void dfn_self_cycle(nltype *);
-nltype **doarcs();
+nltype **doarcs(void);
void doflags(void);
void dotime(void);
-void dumpsum(char *);
+void dumpsum(const char *);
int elf_getnfile(const char *, char ***);
void flatprofheader(void);
void flatprofline(nltype *);
void getpfile(char *);
-/*
- gprofheader();
- gprofline();
-*/
+void gprofheader(void);
+void gprofline(register nltype *);
int hertz(void);
void inheritflags(nltype *);
int kernel_getnfile(const char *, char ***);
@@ -292,16 +291,13 @@
/*
main();
*/
-unsigned long max();
-int membercmp();
-unsigned long min();
-nltype *nllookup();
+unsigned long max(unsigned long, unsigned long);
+int membercmp(nltype *, nltype *);
+unsigned long min(unsigned long, unsigned long);
+nltype *nllookup(unsigned long);
bool onlist(struct stringlist *, const char *);
-FILE *openpfile();
-long operandlength();
-operandenum operandmode();
-char *operandname();
-void printblurb(char *);
+FILE *openpfile(char *);
+void printblurb(const char *);
void printchildren(nltype *);
void printcycle(nltype *);
void printgprof(nltype **);
@@ -312,13 +308,12 @@
void printprof(void);
void printsubcycle(cltype *);
void readsamples(FILE *);
-unsigned long reladdr();
void sortchildren(nltype *);
void sortmembers(nltype *);
void sortparents(nltype *);
void tally(struct rawarc *);
void timepropagate(nltype *);
-int totalcmp();
+int totalcmp(const void *, const void *);
#define LESSTHAN -1
#define EQUALTO 0
Modified: trunk/usr.bin/gprof/hertz.c
===================================================================
--- trunk/usr.bin/gprof/hertz.c 2018-07-07 20:34:50 UTC (rev 11537)
+++ trunk/usr.bin/gprof/hertz.c 2018-07-07 20:35:09 UTC (rev 11538)
@@ -1,3 +1,4 @@
+/* $MidnightBSD$ */
/*
* Copyright (c) 1983, 1993
* The Regents of the University of California. All rights reserved.
@@ -34,7 +35,7 @@
#endif
#include <sys/cdefs.h>
-__MBSDID("$MidnightBSD$");
+__FBSDID("$FreeBSD: stable/10/usr.bin/gprof/hertz.c 246783 2013-02-14 08:16:03Z charnier $");
#include <sys/time.h>
@@ -44,6 +45,8 @@
*/
#define HZ_WRONG 0
+int hertz(void);
+
int
hertz(void)
{
Modified: trunk/usr.bin/gprof/i386.h
===================================================================
--- trunk/usr.bin/gprof/i386.h 2018-07-07 20:34:50 UTC (rev 11537)
+++ trunk/usr.bin/gprof/i386.h 2018-07-07 20:35:09 UTC (rev 11538)
@@ -1,3 +1,4 @@
+/* $MidnightBSD$ */
/*-
* Copyright (c) 1991, 1993
* The Regents of the University of California. All rights reserved.
@@ -27,7 +28,7 @@
* SUCH DAMAGE.
*
* @(#)i386.h 8.1 (Berkeley) 6/6/93
- * $MidnightBSD$
+ * $FreeBSD: stable/10/usr.bin/gprof/i386.h 216370 2010-12-11 08:32:16Z joel $
*/
/*
Modified: trunk/usr.bin/gprof/ia64.h
===================================================================
--- trunk/usr.bin/gprof/ia64.h 2018-07-07 20:34:50 UTC (rev 11537)
+++ trunk/usr.bin/gprof/ia64.h 2018-07-07 20:35:09 UTC (rev 11538)
@@ -1,3 +1,4 @@
+/* $MidnightBSD$ */
/*-
* Copyright (c) 1991, 1993
* The Regents of the University of California. All rights reserved.
@@ -27,7 +28,7 @@
* SUCH DAMAGE.
*
* @(#)i386.h 8.1 (Berkeley) 6/6/93
- * $MidnightBSD$
+ * $FreeBSD: stable/10/usr.bin/gprof/ia64.h 216370 2010-12-11 08:32:16Z joel $
*/
/*
Modified: trunk/usr.bin/gprof/kernel.c
===================================================================
--- trunk/usr.bin/gprof/kernel.c 2018-07-07 20:34:50 UTC (rev 11537)
+++ trunk/usr.bin/gprof/kernel.c 2018-07-07 20:35:09 UTC (rev 11538)
@@ -1,5 +1,6 @@
+/* $MidnightBSD$ */
#include <sys/cdefs.h>
-__MBSDID("$MidnightBSD$");
+__FBSDID("$FreeBSD: stable/10/usr.bin/gprof/kernel.c 246783 2013-02-14 08:16:03Z charnier $");
#include <sys/param.h>
#include <sys/linker.h>
@@ -16,7 +17,7 @@
static char *excludes[] = { ".mcount", "_mcleanup", NULL };
int
-kernel_getnfile(const char *unused, char ***defaultEs)
+kernel_getnfile(const char *unused __unused, char ***defaultEs)
{
char *namelist;
size_t len;
Modified: trunk/usr.bin/gprof/lookup.c
===================================================================
--- trunk/usr.bin/gprof/lookup.c 2018-07-07 20:34:50 UTC (rev 11537)
+++ trunk/usr.bin/gprof/lookup.c 2018-07-07 20:35:09 UTC (rev 11538)
@@ -1,3 +1,4 @@
+/* $MidnightBSD$ */
/*
* Copyright (c) 1983, 1993
* The Regents of the University of California. All rights reserved.
@@ -34,7 +35,7 @@
#endif
#include <sys/cdefs.h>
-__MBSDID("$MidnightBSD$");
+__FBSDID("$FreeBSD: stable/10/usr.bin/gprof/lookup.c 246783 2013-02-14 08:16:03Z charnier $");
#include "gprof.h"
@@ -44,8 +45,7 @@
* entry point.
*/
nltype *
-nllookup( address )
- unsigned long address;
+nllookup(unsigned long address)
{
register long low;
register long middle;
@@ -66,6 +66,12 @@
printf( "[nllookup] %d (%d) probes\n" , probes , nname-1 );
}
# endif /* DEBUG */
+#if defined(__arm__)
+ if (nl[middle].name[0] == '$' &&
+ nl[middle-1].value == nl[middle].value)
+ middle--;
+#endif
+
return &nl[ middle ];
}
if ( nl[ middle ].value > address ) {
@@ -84,9 +90,7 @@
}
arctype *
-arclookup( parentp , childp )
- nltype *parentp;
- nltype *childp;
+arclookup(nltype *parentp, nltype *childp)
{
arctype *arcp;
Modified: trunk/usr.bin/gprof/mips.h
===================================================================
--- trunk/usr.bin/gprof/mips.h 2018-07-07 20:34:50 UTC (rev 11537)
+++ trunk/usr.bin/gprof/mips.h 2018-07-07 20:35:09 UTC (rev 11538)
@@ -1,3 +1,4 @@
+/* $MidnightBSD$ */
/*-
* Copyright (c) 1992, 1993
* The Regents of the University of California. All rights reserved.
@@ -32,7 +33,7 @@
*
* @(#)mips.h 8.1 (Berkeley) 6/6/93
* From: @(#)sparc.h 5.1 (Berkeley) 7/8/92
- * $MidnightBSD$
+ * $FreeBSD: stable/10/usr.bin/gprof/mips.h 182681 2008-09-02 15:35:47Z obrien $
*/
/*
Modified: trunk/usr.bin/gprof/pathnames.h
===================================================================
--- trunk/usr.bin/gprof/pathnames.h 2018-07-07 20:34:50 UTC (rev 11537)
+++ trunk/usr.bin/gprof/pathnames.h 2018-07-07 20:35:09 UTC (rev 11538)
@@ -1,3 +1,4 @@
+/* $MidnightBSD$ */
/*
* Copyright (c) 1989, 1993
* The Regents of the University of California. All rights reserved.
@@ -27,7 +28,7 @@
* SUCH DAMAGE.
*
* @(#)pathnames.h 8.1 (Berkeley) 6/6/93
- * $MidnightBSD$
+ * $FreeBSD: stable/10/usr.bin/gprof/pathnames.h 216370 2010-12-11 08:32:16Z joel $
*/
#define _PATH_FLAT_BLURB "/usr/share/misc/gprof.flat"
Modified: trunk/usr.bin/gprof/powerpc.h
===================================================================
--- trunk/usr.bin/gprof/powerpc.h 2018-07-07 20:34:50 UTC (rev 11537)
+++ trunk/usr.bin/gprof/powerpc.h 2018-07-07 20:35:09 UTC (rev 11538)
@@ -1,3 +1,4 @@
+/* $MidnightBSD$ */
/*-
* Copyright (c) 1991, 1993
* The Regents of the University of California. All rights reserved.
@@ -27,7 +28,7 @@
* SUCH DAMAGE.
*
* @(#)i386.h 8.1 (Berkeley) 6/6/93
- * $MidnightBSD$
+ * $FreeBSD: stable/10/usr.bin/gprof/powerpc.h 216370 2010-12-11 08:32:16Z joel $
*/
/*
Modified: trunk/usr.bin/gprof/printgprof.c
===================================================================
--- trunk/usr.bin/gprof/printgprof.c 2018-07-07 20:34:50 UTC (rev 11537)
+++ trunk/usr.bin/gprof/printgprof.c 2018-07-07 20:35:09 UTC (rev 11538)
@@ -1,3 +1,4 @@
+/* $MidnightBSD$ */
/*
* Copyright (c) 1983, 1993
* The Regents of the University of California. All rights reserved.
@@ -34,7 +35,7 @@
#endif
#include <sys/cdefs.h>
-__MBSDID("$MidnightBSD$");
+__FBSDID("$FreeBSD: stable/10/usr.bin/gprof/printgprof.c 246783 2013-02-14 08:16:03Z charnier $");
#include <err.h>
#include <string.h>
@@ -42,12 +43,15 @@
#include "gprof.h"
#include "pathnames.h"
+int namecmp(const void *, const void *);
+int timecmp(const void *, const void *);
+
void
-printprof()
+printprof(void)
{
register nltype *np;
nltype **sortednlp;
- int index, timecmp();
+ int idx;
actime = 0.0;
printf( "\f\n" );
@@ -58,12 +62,12 @@
sortednlp = (nltype **) calloc( nname , sizeof(nltype *) );
if ( sortednlp == (nltype **) 0 )
errx( 1 , "[printprof] ran out of memory for time sorting" );
- for ( index = 0 ; index < nname ; index += 1 ) {
- sortednlp[ index ] = &nl[ index ];
+ for ( idx = 0 ; idx < nname ; idx += 1 ) {
+ sortednlp[ idx ] = &nl[ idx ];
}
qsort( sortednlp , nname , sizeof(nltype *) , timecmp );
- for ( index = 0 ; index < nname ; index += 1 ) {
- np = sortednlp[ index ];
+ for ( idx = 0 ; idx < nname ; idx += 1 ) {
+ np = sortednlp[ idx ];
flatprofline( np );
}
actime = 0.0;
@@ -71,9 +75,10 @@
}
int
-timecmp( npp1 , npp2 )
- nltype **npp1, **npp2;
+timecmp(const void *v1, const void *v2)
{
+ const nltype **npp1 = (const nltype **)v1;
+ const nltype **npp2 = (const nltype **)v2;
double timediff;
long calldiff;
@@ -94,7 +99,7 @@
* header for flatprofline
*/
void
-flatprofheader()
+flatprofheader(void)
{
if ( bflag ) {
@@ -122,8 +127,7 @@
}
void
-flatprofline( np )
- register nltype *np;
+flatprofline(register nltype *np)
{
if ( zflag == 0 && np -> ncall == 0 && np -> time == 0 &&
@@ -161,7 +165,7 @@
}
void
-gprofheader()
+gprofheader(void)
{
if ( bflag ) {
@@ -190,8 +194,7 @@
}
void
-gprofline( np )
- register nltype *np;
+gprofline(register nltype *np)
{
char kirkbuffer[ BUFSIZ ];
@@ -216,10 +219,9 @@
}
void
-printgprof(timesortnlp)
- nltype **timesortnlp;
+printgprof(nltype **timesortnlp)
{
- int index;
+ int idx;
nltype *parentp;
/*
@@ -226,8 +228,8 @@
* Print out the structured profiling list
*/
gprofheader();
- for ( index = 0 ; index < nname + ncycle ; index ++ ) {
- parentp = timesortnlp[ index ];
+ for ( idx = 0 ; idx < nname + ncycle ; idx ++ ) {
+ parentp = timesortnlp[ idx ];
if ( zflag == 0 &&
parentp -> ncall == 0 &&
parentp -> selfcalls == 0 &&
@@ -265,12 +267,12 @@
* all else being equal, sort by names.
*/
int
-totalcmp( npp1 , npp2 )
- nltype **npp1;
- nltype **npp2;
+totalcmp(const void *v1, const void *v2)
{
- register nltype *np1 = *npp1;
- register nltype *np2 = *npp2;
+ const nltype **npp1 = (const nltype **)v1;
+ const nltype **npp2 = (const nltype **)v2;
+ register const nltype *np1 = *npp1;
+ register const nltype *np2 = *npp2;
double diff;
diff = ( np1 -> propself + np1 -> propchild )
@@ -299,8 +301,7 @@
}
void
-printparents( childp )
- nltype *childp;
+printparents(nltype *childp)
{
nltype *parentp;
arctype *arcp;
@@ -344,8 +345,7 @@
}
void
-printchildren( parentp )
- nltype *parentp;
+printchildren(nltype *parentp)
{
nltype *childp;
arctype *arcp;
@@ -378,8 +378,7 @@
}
void
-printname( selfp )
- nltype *selfp;
+printname(nltype *selfp)
{
if ( selfp -> name != 0 ) {
@@ -406,8 +405,7 @@
}
void
-sortchildren( parentp )
- nltype *parentp;
+sortchildren(nltype *parentp)
{
arctype *arcp;
arctype *detachedp;
@@ -447,8 +445,7 @@
}
void
-sortparents( childp )
- nltype *childp;
+sortparents(nltype *childp)
{
arctype *arcp;
arctype *detachedp;
@@ -491,8 +488,7 @@
* print a cycle header
*/
void
-printcycle( cyclep )
- nltype *cyclep;
+printcycle(nltype *cyclep)
{
char kirkbuffer[ BUFSIZ ];
@@ -516,8 +512,7 @@
* print the members of a cycle
*/
void
-printmembers( cyclep )
- nltype *cyclep;
+printmembers(nltype *cyclep)
{
nltype *memberp;
@@ -541,8 +536,7 @@
* sort members of a cycle
*/
void
-sortmembers( cyclep )
- nltype *cyclep;
+sortmembers(nltype *cyclep)
{
nltype *todo;
nltype *doing;
@@ -572,9 +566,7 @@
* next is sort on ncalls + selfcalls.
*/
int
-membercmp( this , that )
- nltype *this;
- nltype *that;
+membercmp(nltype *this, nltype *that)
{
double thistime = this -> propself + this -> propchild;
double thattime = that -> propself + that -> propchild;
@@ -605,9 +597,7 @@
* arc count as minor key
*/
int
-arccmp( thisp , thatp )
- arctype *thisp;
- arctype *thatp;
+arccmp(arctype *thisp, arctype *thatp)
{
nltype *thisparentp = thisp -> arc_parentp;
nltype *thischildp = thisp -> arc_childp;
@@ -684,8 +674,7 @@
}
void
-printblurb( blurbname )
- char *blurbname;
+printblurb(const char *blurbname)
{
FILE *blurbfile;
int input;
@@ -702,18 +691,20 @@
}
int
-namecmp( npp1 , npp2 )
- nltype **npp1, **npp2;
+namecmp(const void *v1, const void *v2)
{
+ const nltype **npp1 = (const nltype **)v1;
+ const nltype **npp2 = (const nltype **)v2;
+
return( strcmp( (*npp1) -> name , (*npp2) -> name ) );
}
void
-printindex()
+printindex(void)
{
nltype **namesortnlp;
register nltype *nlp;
- int index, nnames, todo, i, j;
+ int idx, nnames, todo, i, j;
char peterbuffer[ BUFSIZ ];
/*
@@ -723,19 +714,19 @@
namesortnlp = (nltype **) calloc( nname + ncycle , sizeof(nltype *) );
if ( namesortnlp == (nltype **) 0 )
errx( 1 , "ran out of memory for sorting");
- for ( index = 0 , nnames = 0 ; index < nname ; index++ ) {
- if ( zflag == 0 && nl[index].ncall == 0 && nl[index].time == 0 )
+ for ( idx = 0 , nnames = 0 ; idx < nname ; idx++ ) {
+ if ( zflag == 0 && nl[idx].ncall == 0 && nl[idx].time == 0 )
continue;
- namesortnlp[nnames++] = &nl[index];
+ namesortnlp[nnames++] = &nl[idx];
}
qsort( namesortnlp , nnames , sizeof(nltype *) , namecmp );
- for ( index = 1 , todo = nnames ; index <= ncycle ; index++ ) {
- namesortnlp[todo++] = &cyclenl[index];
+ for ( idx = 1 , todo = nnames ; idx <= ncycle ; idx++ ) {
+ namesortnlp[todo++] = &cyclenl[idx];
}
printf( "\f\nIndex by function name\n\n" );
- index = ( todo + 2 ) / 3;
- for ( i = 0; i < index ; i++ ) {
- for ( j = i; j < todo ; j += index ) {
+ idx = ( todo + 2 ) / 3;
+ for ( i = 0; i < idx ; i++ ) {
+ for ( j = i; j < todo ; j += idx ) {
nlp = namesortnlp[ j ];
if ( nlp -> printflag ) {
sprintf( peterbuffer , "[%d]" , nlp -> index );
Modified: trunk/usr.bin/gprof/printlist.c
===================================================================
--- trunk/usr.bin/gprof/printlist.c 2018-07-07 20:34:50 UTC (rev 11537)
+++ trunk/usr.bin/gprof/printlist.c 2018-07-07 20:35:09 UTC (rev 11538)
@@ -1,3 +1,4 @@
+/* $MidnightBSD$ */
/*
* Copyright (c) 1983, 1993
* The Regents of the University of California. All rights reserved.
@@ -34,7 +35,7 @@
#endif
#include <sys/cdefs.h>
-__MBSDID("$MidnightBSD$");
+__FBSDID("$FreeBSD: stable/10/usr.bin/gprof/printlist.c 246783 2013-02-14 08:16:03Z charnier $");
#include <err.h>
#include <string.h>
@@ -61,9 +62,7 @@
struct stringlist *Elist = &Ehead;
void
-addlist( listp , funcname )
- struct stringlist *listp;
- char *funcname;
+addlist(struct stringlist *listp, char *funcname)
{
struct stringlist *slp;
@@ -76,9 +75,7 @@
}
bool
-onlist( listp , funcname )
- struct stringlist *listp;
- const char *funcname;
+onlist(struct stringlist *listp, const char *funcname)
{
struct stringlist *slp;
Modified: trunk/usr.bin/gprof/sparc64.h
===================================================================
--- trunk/usr.bin/gprof/sparc64.h 2018-07-07 20:34:50 UTC (rev 11537)
+++ trunk/usr.bin/gprof/sparc64.h 2018-07-07 20:35:09 UTC (rev 11538)
@@ -1,3 +1,4 @@
+/* $MidnightBSD$ */
/*-
* Copyright (c) 1991, 1993
* The Regents of the University of California. All rights reserved.
@@ -27,7 +28,7 @@
* SUCH DAMAGE.
*
* @(#)i386.h 8.1 (Berkeley) 6/6/93
- * $MidnightBSD$
+ * $FreeBSD: stable/10/usr.bin/gprof/sparc64.h 216370 2010-12-11 08:32:16Z joel $
*/
/*
More information about the Midnightbsd-cvs
mailing list