fixed a bug in multi-subscript calculation
[unix-history] / usr / src / usr.bin / gprof / gprof.c
index 5aac2c5..87b8407 100644 (file)
@@ -1,5 +1,5 @@
 #ifndef lint
 #ifndef lint
-    static     char *sccsid = "@(#)gprof.c     1.17 (Berkeley) %G%";
+    static     char *sccsid = "@(#)gprof.c     1.19 (Berkeley) %G%";
 #endif lint
 
 #include "gprof.h"
 #endif lint
 
 #include "gprof.h"
@@ -93,6 +93,10 @@ main(argc, argv)
        eflag = TRUE;
        addlist( elist , *sp );
     }
        eflag = TRUE;
        addlist( elist , *sp );
     }
+       /*
+        *      how long is a clock tick?
+        */
+    hz = hertz();
        /*
         *      get information about a.out file.
         */
        /*
         *      get information about a.out file.
         */
@@ -472,7 +476,7 @@ asgnsamples()
     /* read samples and assign to namelist symbols */
     scale = highpc - lowpc;
     scale /= nsamples;
     /* read samples and assign to namelist symbols */
     scale = highpc - lowpc;
     scale /= nsamples;
-    for (i = 0, j = 0; i < nsamples; i++) {
+    for (i = 0, j = 1; i < nsamples; i++) {
        ccnt = samples[i];
        if (ccnt == 0)
                continue;
        ccnt = samples[i];
        if (ccnt == 0)
                continue;