gmon_out.h 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. /* Copyright (C) 1996, 1997 Free Software Foundation, Inc.
  2. This file is part of the GNU C Library.
  3. Contributed by David Mosberger <davidm@cs.arizona.edu>.
  4. The GNU C Library is free software; you can redistribute it and/or
  5. modify it under the terms of the GNU Lesser General Public
  6. License as published by the Free Software Foundation; either
  7. version 2.1 of the License, or (at your option) any later version.
  8. The GNU C Library 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 GNU
  11. Lesser General Public License for more details.
  12. You should have received a copy of the GNU Lesser General Public
  13. License along with the GNU C Library; if not, write to the Free
  14. Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
  15. 02111-1307 USA. */
  16. /* This file specifies the format of gmon.out files. It should have
  17. as few external dependencies as possible as it is going to be included
  18. in many different programs. That is, minimize the number of #include's.
  19. A gmon.out file consists of a header (defined by gmon_hdr) followed by
  20. a sequence of records. Each record starts with a one-byte tag
  21. identifying the type of records, followed by records specific data. */
  22. #ifndef _SYS_GMON_OUT_H
  23. #define _SYS_GMON_OUT_H 1
  24. #include <features.h>
  25. #define GMON_MAGIC "gmon" /* magic cookie */
  26. #define GMON_VERSION 1 /* version number */
  27. /* For profiling shared object we need a new format. */
  28. #define GMON_SHOBJ_VERSION 0x1ffff
  29. __BEGIN_DECLS
  30. /*
  31. * Raw header as it appears on file (without padding). This header
  32. * always comes first in gmon.out and is then followed by a series
  33. * records defined below.
  34. */
  35. struct gmon_hdr
  36. {
  37. char cookie[4];
  38. char version[4];
  39. char spare[3 * 4];
  40. };
  41. /* types of records in this file: */
  42. typedef enum
  43. {
  44. GMON_TAG_TIME_HIST = 0,
  45. GMON_TAG_CG_ARC = 1,
  46. GMON_TAG_BB_COUNT = 2
  47. } GMON_Record_Tag;
  48. struct gmon_hist_hdr
  49. {
  50. char low_pc[sizeof (char *)]; /* base pc address of sample buffer */
  51. char high_pc[sizeof (char *)]; /* max pc address of sampled buffer */
  52. char hist_size[4]; /* size of sample buffer */
  53. char prof_rate[4]; /* profiling clock rate */
  54. char dimen[15]; /* phys. dim., usually "seconds" */
  55. char dimen_abbrev; /* usually 's' for "seconds" */
  56. };
  57. struct gmon_cg_arc_record
  58. {
  59. char from_pc[sizeof (char *)]; /* address within caller's body */
  60. char self_pc[sizeof (char *)]; /* address within callee's body */
  61. char count[4]; /* number of arc traversals */
  62. };
  63. __END_DECLS
  64. #endif /* sys/gmon_out.h */