summaryrefslogtreecommitdiff
path: root/gprof/gmon_io.c
diff options
context:
space:
mode:
authorBrian Dessent <brian@dessent.net>2008-08-05 19:09:06 +0000
committerBrian Dessent <brian@dessent.net>2008-08-05 19:09:06 +0000
commit2d5079d3a12fe65898c12c236f5f6723d94a3231 (patch)
tree8050913beaf1252de5ac6d53ae00788c76866b56 /gprof/gmon_io.c
parentbc5e6b5d0f225e23773e41f943495caa7ec83527 (diff)
downloadbinutils-redhat-2d5079d3a12fe65898c12c236f5f6723d94a3231.tar.gz
* gmon_io.c (gmon_out_read): When reading old format gmon.out,
set num_histograms and hist_scale.
Diffstat (limited to 'gprof/gmon_io.c')
-rw-r--r--gprof/gmon_io.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/gprof/gmon_io.c b/gprof/gmon_io.c
index 4639932297..8d1071a7a5 100644
--- a/gprof/gmon_io.c
+++ b/gprof/gmon_io.c
@@ -493,10 +493,13 @@ gmon_out_read (const char *filename)
if (!histograms)
{
+ num_histograms = 1;
histograms = xmalloc (sizeof (struct histogram));
histograms->lowpc = tmp.low_pc;
histograms->highpc = tmp.high_pc;
histograms->num_bins = hist_num_bins;
+ hist_scale = (double)((tmp.high_pc - tmp.low_pc) / sizeof (UNIT))
+ / hist_num_bins;
histograms->sample = xmalloc (hist_num_bins * sizeof (int));
memset (histograms->sample, 0,
hist_num_bins * sizeof (int));