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