2008-08-20 Craig Silverstein <csilvers@google.com>
[deliverable/binutils-gdb.git] / gprof / gmon_io.c
index 1abf427bafc8eb7f1de05c34d85978877c65141a..8d1071a7a52f81c082d374c5551f9d881ccae839 100644 (file)
@@ -1,13 +1,13 @@
 /* gmon_io.c - Input and output from/to gmon.out files.
 
-   Copyright 1999, 2000, 2001, 2002, 2003, 2004, 2005
+   Copyright 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2007
    Free Software Foundation, Inc.
 
    This file is part of GNU Binutils.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
-   the Free Software Foundation; either version 2 of the License, or
+   the Free Software Foundation; either version 3 of the License, or
    (at your option) any later version.
 
    This program is distributed in the hope that it will be useful,
@@ -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));
This page took 0.023203 seconds and 4 git commands to generate.