Commit | Line | Data |
---|---|---|
ef368dac NC |
1 | /* gmon_out.h |
2 | ||
3 | Copyright (C) 2000 Free Software Foundation, Inc. | |
4 | ||
5 | This file is part of GNU Binutils. | |
6 | ||
7 | This program is free software; you can redistribute it and/or modify | |
8 | it under the terms of the GNU General Public License as published by | |
9 | the Free Software Foundation; either version 2 of the License, or | |
10 | (at your option) any later version. | |
11 | ||
12 | This program is distributed in the hope that it will be useful, | |
13 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
15 | GNU General Public License for more details. | |
16 | ||
17 | You should have received a copy of the GNU General Public License | |
18 | along with this program; if not, write to the Free Software | |
19 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ | |
20 | \f | |
21 | /* This file specifies the format of gmon.out files. It should have | |
22 | as few external dependencies as possible as it is going to be | |
23 | included in many different programs. That is, minimize the | |
24 | number of #include's. | |
25 | ||
26 | A gmon.out file consists of a header (defined by gmon_hdr) followed | |
27 | by a sequence of records. Each record starts with a one-byte tag | |
28 | identifying the type of records, followed by records specific data. */ | |
252b5132 RH |
29 | #ifndef gmon_out_h |
30 | #define gmon_out_h | |
31 | ||
32 | #define GMON_MAGIC "gmon" /* magic cookie */ | |
33 | #define GMON_VERSION 1 /* version number */ | |
34 | ||
ef368dac | 35 | /* Raw header as it appears on file (without padding). */ |
252b5132 RH |
36 | struct gmon_hdr |
37 | { | |
38 | char cookie[4]; | |
39 | char version[4]; | |
40 | char spare[3 * 4]; | |
41 | }; | |
42 | ||
ef368dac | 43 | /* Types of records in this file. */ |
252b5132 RH |
44 | typedef enum |
45 | { | |
46 | GMON_TAG_TIME_HIST = 0, GMON_TAG_CG_ARC = 1, GMON_TAG_BB_COUNT = 2 | |
47 | } | |
48 | GMON_Record_Tag; | |
49 | ||
50 | struct gmon_hist_hdr | |
51 | { | |
ef368dac NC |
52 | char low_pc[sizeof (char*)]; /* Base pc address of sample buffer. */ |
53 | char high_pc[sizeof (char*)]; /* Max pc address of sampled buffer. */ | |
54 | char hist_size[4]; /* Size of sample buffer. */ | |
55 | char prof_rate[4]; /* Profiling clock rate. */ | |
56 | char dimen[15]; /* Phys. dim., usually "seconds". */ | |
57 | char dimen_abbrev; /* Usually 's' for "seconds". */ | |
252b5132 RH |
58 | }; |
59 | ||
60 | struct gmon_cg_arc_record | |
61 | { | |
ef368dac NC |
62 | char from_pc[sizeof (char*)]; /* Address within caller's body. */ |
63 | char self_pc[sizeof (char*)]; /* Address within callee's body. */ | |
64 | char count[4]; /* Number of arc traversals. */ | |
252b5132 RH |
65 | }; |
66 | ||
67 | #endif /* gmon_out_h */ |