Commit | Line | Data |
---|---|---|
252b5132 RH |
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 | * | |
19 | * @(#)gprof.h 5.9 (Berkeley) 6/1/90 | |
20 | */ | |
21 | #ifndef gprof_h | |
22 | #define gprof_h | |
23 | ||
63999bc7 | 24 | #include "ansidecl.h" |
252b5132 RH |
25 | |
26 | /* Include the BFD sysdep.h file. */ | |
27 | #include "sysdep.h" | |
28 | ||
29 | /* Undefine the BFD PACKAGE and VERSION macros before including the | |
30 | gprof config.h file. */ | |
31 | #undef PACKAGE | |
32 | #undef VERSION | |
252b5132 RH |
33 | |
34 | #include "gconfig.h" | |
35 | ||
36 | #ifndef MIN | |
37 | #define MIN(a,b) ((a) < (b) ? (a) : (b)) | |
38 | #endif | |
39 | #ifndef MAX | |
40 | #define MAX(a,b) ((a) > (b) ? (a) : (b)) | |
41 | #endif | |
42 | ||
43 | /* AIX defines hz as a macro. */ | |
44 | #undef hz | |
45 | ||
46 | #ifndef PATH_MAX | |
47 | #define PATH_MAX 1024 | |
48 | #endif | |
49 | ||
63999bc7 | 50 | #define A_OUTNAME "a.out" /* default core filename */ |
252b5132 RH |
51 | #define GMONNAME "gmon.out" /* default profile filename */ |
52 | #define GMONSUM "gmon.sum" /* profile summary filename */ | |
53 | ||
54 | #ifdef HAVE_LOCALE_H | |
55 | # include <locale.h> | |
56 | #endif | |
57 | ||
f067e7fb NC |
58 | #ifdef ENABLE_NLS |
59 | /* Undefine BFD's `_' macro - it uses dgetext() and we want to use gettext(). */ | |
60 | #undef _ | |
61 | #define _(String) gettext (String) | |
62 | #endif | |
63 | ||
c20f4f8c | 64 | #include "bin-bugs.h" |
252b5132 RH |
65 | |
66 | /* | |
67 | * These may already be defined on some systems. We could probably | |
68 | * just use the BFD versions of these, since BFD has already dealt | |
69 | * with this problem. | |
70 | */ | |
71 | #undef FALSE | |
72 | #define FALSE 0 | |
73 | #undef TRUE | |
74 | #define TRUE 1 | |
75 | ||
76 | #define STYLE_FLAT_PROFILE (1<<0) | |
77 | #define STYLE_CALL_GRAPH (1<<1) | |
78 | #define STYLE_SUMMARY_FILE (1<<2) | |
79 | #define STYLE_EXEC_COUNTS (1<<3) | |
80 | #define STYLE_ANNOTATED_SOURCE (1<<4) | |
81 | #define STYLE_GMON_INFO (1<<5) | |
82 | #define STYLE_FUNCTION_ORDER (1<<6) | |
83 | #define STYLE_FILE_ORDER (1<<7) | |
84 | ||
85 | #define ANYDEBUG (1<<0) /* 1 */ | |
86 | #define DFNDEBUG (1<<1) /* 2 */ | |
87 | #define CYCLEDEBUG (1<<2) /* 4 */ | |
88 | #define ARCDEBUG (1<<3) /* 8 */ | |
89 | #define TALLYDEBUG (1<<4) /* 16 */ | |
90 | #define TIMEDEBUG (1<<5) /* 32 */ | |
91 | #define SAMPLEDEBUG (1<<6) /* 64 */ | |
92 | #define AOUTDEBUG (1<<7) /* 128 */ | |
93 | #define CALLDEBUG (1<<8) /* 256 */ | |
94 | #define LOOKUPDEBUG (1<<9) /* 512 */ | |
95 | #define PROPDEBUG (1<<10) /* 1024 */ | |
96 | #define BBDEBUG (1<<11) /* 2048 */ | |
97 | #define IDDEBUG (1<<12) /* 4096 */ | |
98 | #define SRCDEBUG (1<<13) /* 8192 */ | |
99 | ||
100 | #ifdef DEBUG | |
101 | #define DBG(l,s) if (debug_level & (l)) {s;} | |
102 | #else | |
103 | #define DBG(l,s) | |
104 | #endif | |
105 | ||
106 | typedef enum | |
107 | { | |
108 | FF_AUTO = 0, FF_MAGIC, FF_BSD, FF_BSD44, FF_PROF | |
109 | } | |
110 | File_Format; | |
111 | ||
112 | typedef int bool; | |
113 | typedef unsigned char UNIT[2]; /* unit of profiling */ | |
114 | ||
115 | extern const char *whoami; /* command-name, for error messages */ | |
116 | extern const char *function_mapping_file; /* file mapping functions to files */ | |
117 | extern const char *a_out_name; /* core filename */ | |
118 | extern long hz; /* ticks per second */ | |
119 | ||
120 | /* | |
121 | * Command-line options: | |
122 | */ | |
123 | extern int debug_level; /* debug level */ | |
124 | extern int output_style; | |
125 | extern int output_width; /* controls column width in index */ | |
126 | extern bool bsd_style_output; /* as opposed to FSF style output */ | |
127 | extern bool demangle; /* demangle symbol names? */ | |
128 | extern bool discard_underscores; /* discard leading underscores? */ | |
129 | extern bool ignore_direct_calls; /* don't count direct calls */ | |
130 | extern bool ignore_static_funcs; /* suppress static functions */ | |
131 | extern bool ignore_zeros; /* ignore unused symbols/files */ | |
132 | extern bool line_granularity; /* function or line granularity? */ | |
133 | extern bool print_descriptions; /* output profile description */ | |
134 | extern bool print_path; /* print path or just filename? */ | |
135 | extern bool ignore_non_functions;/* Ignore non-function symbols. */ | |
136 | ||
137 | extern File_Format file_format; /* requested file format */ | |
138 | ||
139 | extern bool first_output; /* no output so far? */ | |
140 | ||
141 | extern void done PARAMS ((int status)); | |
142 | ||
143 | #endif /* gprof_h */ |