hist.h 2.0 KB

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