]>
Commit | Line | Data |
---|---|---|
581c785b | 1 | /* Copyright (C) 1996-2022 Free Software Foundation, Inc. |
54d79e99 | 2 | This file is part of the GNU C Library. |
b20e47cb | 3 | |
54d79e99 | 4 | The GNU C Library is free software; you can redistribute it and/or |
41bdb6e2 AJ |
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. | |
b20e47cb | 8 | |
54d79e99 UD |
9 | The GNU C Library is distributed in the hope that it will be useful, |
10 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
41bdb6e2 | 12 | Lesser General Public License for more details. |
b20e47cb | 13 | |
41bdb6e2 | 14 | You should have received a copy of the GNU Lesser General Public |
59ba27a6 | 15 | License along with the GNU C Library; if not, see |
5a82c748 | 16 | <https://www.gnu.org/licenses/>. */ |
b20e47cb RM |
17 | |
18 | /* This file specifies the format of gmon.out files. It should have | |
54d79e99 UD |
19 | as few external dependencies as possible as it is going to be included |
20 | in many different programs. That is, minimize the number of #include's. | |
b20e47cb | 21 | |
54d79e99 UD |
22 | A gmon.out file consists of a header (defined by gmon_hdr) followed by |
23 | a sequence of records. Each record starts with a one-byte tag | |
24 | identifying the type of records, followed by records specific data. */ | |
b20e47cb | 25 | |
8a4b65b4 | 26 | #ifndef _SYS_GMON_OUT_H |
8a4b65b4 | 27 | #define _SYS_GMON_OUT_H 1 |
5107cf1d | 28 | |
8a4b65b4 | 29 | #include <features.h> |
b20e47cb RM |
30 | |
31 | #define GMON_MAGIC "gmon" /* magic cookie */ | |
32 | #define GMON_VERSION 1 /* version number */ | |
33 | ||
0413b54c UD |
34 | /* For profiling shared object we need a new format. */ |
35 | #define GMON_SHOBJ_VERSION 0x1ffff | |
36 | ||
8a4b65b4 UD |
37 | __BEGIN_DECLS |
38 | ||
b20e47cb RM |
39 | /* |
40 | * Raw header as it appears on file (without padding). This header | |
41 | * always comes first in gmon.out and is then followed by a series | |
42 | * records defined below. | |
43 | */ | |
5ae9d168 UD |
44 | struct gmon_hdr |
45 | { | |
46 | char cookie[4]; | |
47 | char version[4]; | |
48 | char spare[3 * 4]; | |
49 | }; | |
b20e47cb RM |
50 | |
51 | /* types of records in this file: */ | |
5ae9d168 UD |
52 | typedef enum |
53 | { | |
54 | GMON_TAG_TIME_HIST = 0, | |
55 | GMON_TAG_CG_ARC = 1, | |
56 | GMON_TAG_BB_COUNT = 2 | |
57 | } GMON_Record_Tag; | |
b20e47cb | 58 | |
5ae9d168 UD |
59 | struct gmon_hist_hdr |
60 | { | |
61 | char low_pc[sizeof (char *)]; /* base pc address of sample buffer */ | |
62 | char high_pc[sizeof (char *)]; /* max pc address of sampled buffer */ | |
63 | char hist_size[4]; /* size of sample buffer */ | |
64 | char prof_rate[4]; /* profiling clock rate */ | |
65 | char dimen[15]; /* phys. dim., usually "seconds" */ | |
66 | char dimen_abbrev; /* usually 's' for "seconds" */ | |
67 | }; | |
b20e47cb | 68 | |
5ae9d168 UD |
69 | struct gmon_cg_arc_record |
70 | { | |
71 | char from_pc[sizeof (char *)]; /* address within caller's body */ | |
72 | char self_pc[sizeof (char *)]; /* address within callee's body */ | |
73 | char count[4]; /* number of arc traversals */ | |
3996f34b | 74 | }; |
b20e47cb | 75 | |
8a4b65b4 UD |
76 | __END_DECLS |
77 | ||
5107cf1d | 78 | #endif /* sys/gmon_out.h */ |