2007-05-14 H.J. Lu <hongjiu.lu@intel.com>
[deliverable/binutils-gdb.git] / gprof / hist.h
CommitLineData
ef368dac 1/* hist.h
0eee5820 2
8c62e9e1 3 Copyright 2000, 2001, 2002, 2004, 2005 Free Software Foundation, Inc.
ef368dac
NC
4
5This file is part of GNU Binutils.
6
7This program is free software; you can redistribute it and/or modify
8it under the terms of the GNU General Public License as published by
9the Free Software Foundation; either version 2 of the License, or
10(at your option) any later version.
11
12This program is distributed in the hope that it will be useful,
13but WITHOUT ANY WARRANTY; without even the implied warranty of
14MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15GNU General Public License for more details.
16
17You should have received a copy of the GNU General Public License
18along with this program; if not, write to the Free Software
44eb1801 19Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */
ef368dac 20\f
252b5132
RH
21#ifndef hist_h
22#define hist_h
23
b3296dc5
VP
24typedef struct histogram
25{
26 bfd_vma lowpc;
27 bfd_vma highpc;
28 unsigned int num_bins;
29 int *sample; /* Histogram samples (shorts in the file!). */
30} histogram;
31
32histogram *histograms;
33unsigned num_histograms;
ef368dac
NC
34
35/* Scale factor converting samples to pc values:
36 each sample covers HIST_SCALE bytes. */
252b5132
RH
37extern double hist_scale;
38
3e8f6abf
BE
39extern void hist_read_rec (FILE *, const char *);
40extern void hist_write_hist (FILE *, const char *);
41extern void hist_assign_samples (void);
42extern void hist_print (void);
252b5132 43
b3296dc5
VP
44/* Checks if ADDRESS is within the range of addresses for which
45 we have histogram data. Returns 1 if so and 0 otherwise. */
46extern int hist_check_address (unsigned address);
47
48/* Given a range of addresses for a symbol, find a histogram record
49 that intersects with this range, and clips the range to that
50 histogram record, modifying *P_LOWPC and *P_HIGHPC.
51
52 If no intersection is found, *P_LOWPC and *P_HIGHPC will be set to
53 one unspecified value. If more that one intersection is found,
54 an error is emitted. */
55extern void hist_clip_symbol_address (bfd_vma *p_lowpc, bfd_vma *p_highpc);
56
252b5132 57#endif /* hist_h */
This page took 0.294095 seconds and 4 git commands to generate.