aboutsummaryrefslogtreecommitdiff
path: root/gprof
diff options
context:
space:
mode:
Diffstat (limited to 'gprof')
-rw-r--r--gprof/ChangeLog4
-rw-r--r--gprof/hist.c11
2 files changed, 10 insertions, 5 deletions
diff --git a/gprof/ChangeLog b/gprof/ChangeLog
index 6b855b6..a5acbee 100644
--- a/gprof/ChangeLog
+++ b/gprof/ChangeLog
@@ -1,3 +1,7 @@
+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".
diff --git a/gprof/hist.c b/gprof/hist.c
index d987656..08aae2e 100644
--- a/gprof/hist.c
+++ b/gprof/hist.c
@@ -463,7 +463,7 @@ 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;
@@ -528,11 +528,12 @@ 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;
}
}
}