date and time created 83/08/13 16:28:17 by sam
[unix-history] / usr / src / old / prof / prof.c
index c14f302..7f1b003 100644 (file)
@@ -1,5 +1,5 @@
 #ifndef lint
 #ifndef lint
-static char *sccsid = "@(#)prof.c      4.1 (Berkeley) %G%";
+static char *sccsid = "@(#)prof.c      4.3 (Berkeley) %G%";
 #endif
 /*
  * prof
 #endif
 /*
  * prof
@@ -10,6 +10,7 @@ static        char *sccsid = "@(#)prof.c      4.1 (Berkeley) %G%";
 #include <a.out.h>
 
 typedef        short UNIT;             /* unit of profiling */
 #include <a.out.h>
 
 typedef        short UNIT;             /* unit of profiling */
+#define        PCFUDGE         11
 #define        A_OUTNAME       "a.out"
 #define        MON_OUTNAME     "mon.out"
 #define        MON_SUMNAME     "mon.sum"
 #define        A_OUTNAME       "a.out"
 #define        MON_OUTNAME     "mon.out"
 #define        MON_SUMNAME     "mon.sum"
@@ -363,7 +364,7 @@ asgncntrs()
                if (kp<cbuf || np->value > kp->cvalue)
                        continue;
                        /* skip ``static'' functions */
                if (kp<cbuf || np->value > kp->cvalue)
                        continue;
                        /* skip ``static'' functions */
-               while (kp >= cbuf && kp->cvalue > np->value + 11)
+               while (kp >= cbuf && kp->cvalue > np->value + PCFUDGE)
                        --kp;
                if (kp->cvalue >= np->value) {
                        np->ncall += kp->cncall;
                        --kp;
                if (kp->cvalue >= np->value) {
                        np->ncall += kp->cncall;
@@ -585,6 +586,8 @@ plotprof()
                        continue;
                if(np->value >= highpc)
                        continue;
                        continue;
                if(np->value >= highpc)
                        continue;
+               if(zflg == 0 && np->time == 0 && np->ncall == 0)
+                       continue;
                time = np->time/totime;
                lasty = ranoff - (np->value - lowpc)*scale;
                if(lasty >= -2040. && lasty <= 2040.) {
                time = np->time/totime;
                lasty = ranoff - (np->value - lowpc)*scale;
                if(lasty >= -2040. && lasty <= 2040.) {