/* gmon_io.c - Input and output from/to gmon.out files.
- Copyright 2000, 2001, 2002 Free Software Foundation, Inc.
+ Copyright 2000, 2001, 2002, 2004, 2005 Free Software Foundation, Inc.
This file is part of GNU Binutils.
{
bfd_vma low_pc;
bfd_vma high_pc;
- int ncnt;
+ unsigned int ncnt;
};
- int i, samp_bytes, header_size = 0;
+ unsigned int i;
+ int samp_bytes, header_size = 0;
unsigned long count;
bfd_vma from_pc, self_pc;
static struct hdr h;
UNIT raw_bin_count;
struct hdr tmp;
- int version;
+ unsigned int version;
/* Information from a gmon.out file is in two parts: an array of
sampling hits within pc ranges, and the arcs. */
if (version == GMONVERSION)
{
- int profrate;
+ unsigned int profrate;
/* 4.4BSD format header. */
if (gmon_io_read_32 (ifp, &profrate))
if (!s_highpc)
hz = profrate;
- else if (hz != profrate)
+ else if (hz != (int) profrate)
{
fprintf (stderr,
_("%s: profiling rate incompatible with first gmon file\n"),
else if (file_format == FF_BSD || file_format == FF_BSD44)
{
UNIT raw_bin_count;
- int i, hdrsize;
+ unsigned int i, hdrsize;
unsigned padsize;
char pad[3*4];
Arc *arc;
/* hist.c - Histogram related operations.
- Copyright 2000, 2001, 2002 Free Software Foundation, Inc.
+ Copyright 2000, 2001, 2002, 2004, 2005 Free Software Foundation, Inc.
This file is part of GNU Binutils.
bfd_vma s_lowpc; /* Lowest address in .text. */
bfd_vma s_highpc = 0; /* Highest address in .text. */
bfd_vma lowpc, highpc; /* Same, but expressed in UNITs. */
-int hist_num_bins = 0; /* Number of histogram samples. */
+unsigned int hist_num_bins = 0; /* Number of histogram samples. */
int *hist_sample = 0; /* Histogram samples (shorts in the file!). */
double hist_scale;
char hist_dimension[16] = "seconds";
hist_read_rec (FILE * ifp, const char *filename)
{
bfd_vma n_lowpc, n_highpc;
- int i, ncnt, profrate;
+ unsigned int i, ncnt, profrate;
UNIT count;
if (gmon_io_read_vma (ifp, &n_lowpc)
}
DBG (SAMPLEDEBUG,
- printf ("[hist_read_rec] n_lowpc 0x%lx n_highpc 0x%lx ncnt %d\n",
+ printf ("[hist_read_rec] n_lowpc 0x%lx n_highpc 0x%lx ncnt %u\n",
(unsigned long) n_lowpc, (unsigned long) n_highpc, ncnt);
- printf ("[hist_read_rec] s_lowpc 0x%lx s_highpc 0x%lx nsamples %d\n",
+ printf ("[hist_read_rec] s_lowpc 0x%lx s_highpc 0x%lx nsamples %u\n",
(unsigned long) s_lowpc, (unsigned long) s_highpc,
hist_num_bins);
printf ("[hist_read_rec] lowpc 0x%lx highpc 0x%lx\n",
(unsigned long) lowpc, (unsigned long) highpc));
if (n_lowpc != s_lowpc || n_highpc != s_highpc
- || ncnt != hist_num_bins || hz != profrate)
+ || ncnt != hist_num_bins || hz != (int) profrate)
{
fprintf (stderr, _("%s: `%s' is incompatible with first gmon file\n"),
whoami, filename);
if (fread (&count[0], sizeof (count), 1, ifp) != 1)
{
fprintf (stderr,
- _("%s: %s: unexpected EOF after reading %d of %d samples\n"),
+ _("%s: %s: unexpected EOF after reading %u of %u samples\n"),
whoami, filename, i, hist_num_bins);
done (1);
}
hist_write_hist (FILE * ofp, const char *filename)
{
UNIT count;
- int i;
+ unsigned int i;
/* Write header. */
bfd_vma bin_low_pc, bin_high_pc;
bfd_vma sym_low_pc, sym_high_pc;
bfd_vma overlap, addr;
- int bin_count, i;
- unsigned int j;
+ unsigned int bin_count;
+ unsigned int i, j;
double time, credit;
/* Read samples and assign to symbols. */
DBG (SAMPLEDEBUG,
printf (
- "[assign_samples] bin_low_pc=0x%lx, bin_high_pc=0x%lx, bin_count=%d\n",
+ "[assign_samples] bin_low_pc=0x%lx, bin_high_pc=0x%lx, bin_count=%u\n",
(unsigned long) (sizeof (UNIT) * bin_low_pc),
(unsigned long) (sizeof (UNIT) * bin_high_pc),
bin_count));
/* hist.h
- Copyright 2000, 2001 Free Software Foundation, Inc.
+ Copyright 2000, 2001, 2002, 2004, 2005 Free Software Foundation, Inc.
This file is part of GNU Binutils.
extern bfd_vma s_lowpc; /* Lowpc from the profile file. */
extern bfd_vma s_highpc; /* Highpc from the profile file. */
extern bfd_vma lowpc, highpc; /* Range profiled, in UNIT's. */
-extern int hist_num_bins; /* Number of histogram bins. */
+extern unsigned int hist_num_bins; /* Number of histogram bins. */
extern int *hist_sample; /* Code histogram. */
/* Scale factor converting samples to pc values: