Commit | Line | Data |
---|---|---|
3d6c6501 SEF |
1 | /* |
2 | * Copyright (c) 1983 Regents of the University of California. | |
3 | * All rights reserved. | |
4 | * | |
5 | * Redistribution and use in source and binary forms are permitted | |
6 | * provided that: (1) source distributions retain this entire copyright | |
7 | * notice and comment, and (2) distributions including binaries display | |
8 | * the following acknowledgement: ``This product includes software | |
9 | * developed by the University of California, Berkeley and its contributors'' | |
10 | * in the documentation or other materials provided with the distribution | |
11 | * and in all advertising materials mentioning features or use of this | |
12 | * software. Neither the name of the University nor the names of its | |
13 | * contributors may be used to endorse or promote products derived | |
14 | * from this software without specific prior written permission. | |
15 | * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR | |
16 | * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED | |
17 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. | |
18 | * | |
12516a37 | 19 | * @(#)gprof.h 5.9 (Berkeley) 6/1/90 |
3d6c6501 | 20 | */ |
5489fcc3 KR |
21 | #ifndef gprof_h |
22 | #define gprof_h | |
3d6c6501 | 23 | |
8739c727 | 24 | #include <ansidecl.h> |
274e44ae ILT |
25 | |
26 | /* Include the BFD sysdep.h file. */ | |
9d651373 | 27 | #include "sysdep.h" |
5489fcc3 | 28 | |
274e44ae ILT |
29 | /* Undefine the BFD PACKAGE and VERSION macros before including the |
30 | gprof config.h file. */ | |
31 | #undef PACKAGE | |
32 | #undef VERSION | |
33 | ||
34 | #include "gconfig.h" | |
35 | ||
5489fcc3 | 36 | #ifndef MIN |
12516a37 | 37 | #define MIN(a,b) ((a) < (b) ? (a) : (b)) |
5489fcc3 KR |
38 | #endif |
39 | #ifndef MAX | |
12516a37 | 40 | #define MAX(a,b) ((a) > (b) ? (a) : (b)) |
5489fcc3 | 41 | #endif |
3d6c6501 | 42 | |
7508b715 ILT |
43 | /* AIX defines hz as a macro. */ |
44 | #undef hz | |
45 | ||
5489fcc3 | 46 | #ifdef MACHINE_H |
12516a37 | 47 | #include MACHINE_H |
3d6c6501 | 48 | #else |
12516a37 KR |
49 | #if vax |
50 | #include "vax.h" | |
51 | #endif | |
52 | #if sun | |
53 | #include "sun.h" | |
54 | #endif | |
55 | #if tahoe | |
56 | #include "tahoe.h" | |
57 | #endif | |
5489fcc3 KR |
58 | #endif |
59 | ||
60 | #ifndef FOPEN_RB | |
12516a37 | 61 | #define FOPEN_RB "r" |
5489fcc3 KR |
62 | #endif |
63 | #ifndef FOPEN_WB | |
12516a37 | 64 | #define FOPEN_WB "w" |
3d6c6501 SEF |
65 | #endif |
66 | ||
5489fcc3 | 67 | #ifndef PATH_MAX |
12516a37 | 68 | #define PATH_MAX 1024 |
5489fcc3 | 69 | #endif |
3d6c6501 | 70 | |
12516a37 | 71 | #define A_OUTNAME "a.out" /* default core filename */ |
5489fcc3 KR |
72 | #define GMONNAME "gmon.out" /* default profile filename */ |
73 | #define GMONSUM "gmon.sum" /* profile summary filename */ | |
3d6c6501 | 74 | |
5489fcc3 KR |
75 | /* |
76 | * These may already be defined on some systems. We could probably | |
77 | * just use the BFD versions of these, since BFD has already dealt | |
78 | * with this problem. | |
79 | */ | |
d20d64bb | 80 | #undef FALSE |
3d6c6501 | 81 | #define FALSE 0 |
d20d64bb | 82 | #undef TRUE |
3d6c6501 SEF |
83 | #define TRUE 1 |
84 | ||
5489fcc3 KR |
85 | #define STYLE_FLAT_PROFILE (1<<0) |
86 | #define STYLE_CALL_GRAPH (1<<1) | |
87 | #define STYLE_SUMMARY_FILE (1<<2) | |
88 | #define STYLE_EXEC_COUNTS (1<<3) | |
89 | #define STYLE_ANNOTATED_SOURCE (1<<4) | |
90 | #define STYLE_GMON_INFO (1<<5) | |
64c50fc5 JL |
91 | #define STYLE_FUNCTION_ORDER (1<<6) |
92 | #define STYLE_FILE_ORDER (1<<7) | |
5489fcc3 | 93 | |
12516a37 KR |
94 | #define ANYDEBUG (1<<0) /* 1 */ |
95 | #define DFNDEBUG (1<<1) /* 2 */ | |
96 | #define CYCLEDEBUG (1<<2) /* 4 */ | |
97 | #define ARCDEBUG (1<<3) /* 8 */ | |
98 | #define TALLYDEBUG (1<<4) /* 16 */ | |
99 | #define TIMEDEBUG (1<<5) /* 32 */ | |
100 | #define SAMPLEDEBUG (1<<6) /* 64 */ | |
101 | #define AOUTDEBUG (1<<7) /* 128 */ | |
102 | #define CALLDEBUG (1<<8) /* 256 */ | |
103 | #define LOOKUPDEBUG (1<<9) /* 512 */ | |
104 | #define PROPDEBUG (1<<10) /* 1024 */ | |
105 | #define BBDEBUG (1<<11) /* 2048 */ | |
106 | #define IDDEBUG (1<<12) /* 4096 */ | |
107 | #define SRCDEBUG (1<<13) /* 8192 */ | |
5489fcc3 KR |
108 | |
109 | #ifdef DEBUG | |
12516a37 | 110 | #define DBG(l,s) if (debug_level & (l)) {s;} |
5489fcc3 | 111 | #else |
12516a37 | 112 | #define DBG(l,s) |
5489fcc3 | 113 | #endif |
3d6c6501 | 114 | |
12516a37 KR |
115 | typedef enum |
116 | { | |
5489fcc3 | 117 | FF_AUTO = 0, FF_MAGIC, FF_BSD, FF_PROF |
12516a37 KR |
118 | } |
119 | File_Format; | |
3d6c6501 | 120 | |
5489fcc3 | 121 | typedef int bool; |
12516a37 | 122 | typedef unsigned char UNIT[2]; /* unit of profiling */ |
3d6c6501 | 123 | |
12516a37 | 124 | extern const char *whoami; /* command-name, for error messages */ |
64c50fc5 | 125 | extern const char *function_mapping_file; /* file mapping functions to files */ |
12516a37 KR |
126 | extern const char *a_out_name; /* core filename */ |
127 | extern long hz; /* ticks per second */ | |
3d6c6501 | 128 | |
3d6c6501 | 129 | /* |
5489fcc3 KR |
130 | * Command-line options: |
131 | */ | |
12516a37 | 132 | extern int debug_level; /* debug level */ |
5489fcc3 | 133 | extern int output_style; |
12516a37 KR |
134 | extern int output_width; /* controls column width in index */ |
135 | extern bool bsd_style_output; /* as opposed to FSF style output */ | |
5489fcc3 KR |
136 | extern bool discard_underscores; /* discard leading underscores? */ |
137 | extern bool ignore_direct_calls; /* don't count direct calls */ | |
138 | extern bool ignore_static_funcs; /* suppress static functions */ | |
12516a37 KR |
139 | extern bool ignore_zeros; /* ignore unused symbols/files */ |
140 | extern bool line_granularity; /* function or line granularity? */ | |
141 | extern bool print_descriptions; /* output profile description */ | |
142 | extern bool print_path; /* print path or just filename? */ | |
32843f94 JL |
143 | extern bool ignore_non_functions;/* Ignore non-function symbols. */ |
144 | ||
12516a37 | 145 | extern File_Format file_format; /* requested file format */ |
5489fcc3 | 146 | |
12516a37 | 147 | extern bool first_output; /* no output so far? */ |
5489fcc3 | 148 | |
12516a37 | 149 | extern void done PARAMS ((int status)); |
5489fcc3 KR |
150 | |
151 | #endif /* gprof_h */ |