- h = tmp;
- s_lowpc = (bfd_vma) h.low_pc;
- s_highpc = (bfd_vma) h.high_pc;
- lowpc = (bfd_vma) h.low_pc / sizeof (UNIT);
- highpc = (bfd_vma) h.high_pc / sizeof (UNIT);
- samp_bytes = h.ncnt - header_size;
- hist_num_bins = samp_bytes / sizeof (UNIT);
+ if (!histograms)
+ {
+ num_histograms = 1;
+ histograms = (struct histogram *) 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 = (int *) xmalloc (hist_num_bins * sizeof (int));
+ memset (histograms->sample, 0,
+ hist_num_bins * sizeof (int));
+ }