From 80a80acc712105b921cefc9dd74346036b330c0f Mon Sep 17 00:00:00 2001 From: "Peter B. Kessler" Date: Tue, 26 Oct 1982 22:51:38 -0800 Subject: [PATCH] when propagating fractions, don't count yourself as a parent. SCCS-vsn: usr.bin/gprof/arcs.c 1.12 --- usr/src/usr.bin/gprof/arcs.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/usr/src/usr.bin/gprof/arcs.c b/usr/src/usr.bin/gprof/arcs.c index 1dff872398..beb3156a61 100644 --- a/usr/src/usr.bin/gprof/arcs.c +++ b/usr/src/usr.bin/gprof/arcs.c @@ -1,5 +1,5 @@ #ifndef lint - static char *sccsid = "@(#)arcs.c 1.11 (Berkeley) %G%"; + static char *sccsid = "@(#)arcs.c 1.12 (Berkeley) %G%"; #endif lint #include "gprof.h" @@ -447,8 +447,8 @@ doflags() printname( childp ); printf( " ends up with printflag %d and propfraction %f\n" , childp -> printflag , childp -> propfraction ); - printf( "time %f propself %f\n" , - childp -> time , childp -> propself ); + printf( "time %f propself %f printtime %f\n" , + childp -> time , childp -> propself , printtime ); } # endif DEBUG } @@ -478,6 +478,9 @@ inheritflags( childp ) childp -> propfraction = 0.0; for (arcp = childp -> parents ; arcp ; arcp = arcp -> arc_parentlist) { parentp = arcp -> arc_parentp; + if ( childp == parentp ) { + continue; + } childp -> printflag |= parentp -> printflag; childp -> propfraction += parentp -> propfraction * ( ( (double) arcp -> arc_count ) -- 2.20.1