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 | |
cd39bab0 TT |
33 | /* Also undefine BFD's `_' macro; we have our own definition. */ |
34 | #undef _ | |
274e44ae ILT |
35 | |
36 | #include "gconfig.h" | |
37 | ||
5489fcc3 | 38 | #ifndef MIN |
12516a37 | 39 | #define MIN(a,b) ((a) < (b) ? (a) : (b)) |
5489fcc3 KR |
40 | #endif |
41 | #ifndef MAX | |
12516a37 | 42 | #define MAX(a,b) ((a) > (b) ? (a) : (b)) |
5489fcc3 | 43 | #endif |
3d6c6501 | 44 | |
7508b715 ILT |
45 | /* AIX defines hz as a macro. */ |
46 | #undef hz | |
47 | ||
5489fcc3 | 48 | #ifndef PATH_MAX |
12516a37 | 49 | #define PATH_MAX 1024 |
5489fcc3 | 50 | #endif |
3d6c6501 | 51 | |
12516a37 | 52 | #define A_OUTNAME "a.out" /* default core filename */ |
5489fcc3 KR |
53 | #define GMONNAME "gmon.out" /* default profile filename */ |
54 | #define GMONSUM "gmon.sum" /* profile summary filename */ | |
3d6c6501 | 55 | |
64eaad40 TT |
56 | #ifdef HAVE_LOCALE_H |
57 | # include <locale.h> | |
16a02269 | 58 | #endif |
64eaad40 TT |
59 | |
60 | #ifdef ENABLE_NLS | |
61 | # include <libintl.h> | |
62 | # define _(String) gettext (String) | |
63 | # ifdef gettext_noop | |
64 | # define N_(String) gettext_noop (String) | |
65 | # else | |
66 | # define N_(String) (String) | |
67 | # endif | |
16a02269 TT |
68 | #else |
69 | /* Stubs that do something close enough. */ | |
64eaad40 TT |
70 | # define textdomain(String) (String) |
71 | # define gettext(String) (String) | |
72 | # define dgettext(Domain,Message) (Message) | |
73 | # define dcgettext(Domain,Message,Type) (Message) | |
74 | # define bindtextdomain(Domain,Directory) (Domain) | |
75 | # define _(String) (String) | |
76 | # define N_(String) (String) | |
16a02269 | 77 | #endif |
64eaad40 TT |
78 | |
79 | #ifndef LC_MESSAGES | |
80 | # define LC_MESSAGES 0 | |
16a02269 TT |
81 | #endif |
82 | ||
64eaad40 | 83 | |
5489fcc3 KR |
84 | /* |
85 | * These may already be defined on some systems. We could probably | |
86 | * just use the BFD versions of these, since BFD has already dealt | |
87 | * with this problem. | |
88 | */ | |
d20d64bb | 89 | #undef FALSE |
3d6c6501 | 90 | #define FALSE 0 |
d20d64bb | 91 | #undef TRUE |
3d6c6501 SEF |
92 | #define TRUE 1 |
93 | ||
5489fcc3 KR |
94 | #define STYLE_FLAT_PROFILE (1<<0) |
95 | #define STYLE_CALL_GRAPH (1<<1) | |
96 | #define STYLE_SUMMARY_FILE (1<<2) | |
97 | #define STYLE_EXEC_COUNTS (1<<3) | |
98 | #define STYLE_ANNOTATED_SOURCE (1<<4) | |
99 | #define STYLE_GMON_INFO (1<<5) | |
64c50fc5 JL |
100 | #define STYLE_FUNCTION_ORDER (1<<6) |
101 | #define STYLE_FILE_ORDER (1<<7) | |
5489fcc3 | 102 | |
12516a37 KR |
103 | #define ANYDEBUG (1<<0) /* 1 */ |
104 | #define DFNDEBUG (1<<1) /* 2 */ | |
105 | #define CYCLEDEBUG (1<<2) /* 4 */ | |
106 | #define ARCDEBUG (1<<3) /* 8 */ | |
107 | #define TALLYDEBUG (1<<4) /* 16 */ | |
108 | #define TIMEDEBUG (1<<5) /* 32 */ | |
109 | #define SAMPLEDEBUG (1<<6) /* 64 */ | |
110 | #define AOUTDEBUG (1<<7) /* 128 */ | |
111 | #define CALLDEBUG (1<<8) /* 256 */ | |
112 | #define LOOKUPDEBUG (1<<9) /* 512 */ | |
113 | #define PROPDEBUG (1<<10) /* 1024 */ | |
114 | #define BBDEBUG (1<<11) /* 2048 */ | |
115 | #define IDDEBUG (1<<12) /* 4096 */ | |
116 | #define SRCDEBUG (1<<13) /* 8192 */ | |
5489fcc3 KR |
117 | |
118 | #ifdef DEBUG | |
12516a37 | 119 | #define DBG(l,s) if (debug_level & (l)) {s;} |
5489fcc3 | 120 | #else |
12516a37 | 121 | #define DBG(l,s) |
5489fcc3 | 122 | #endif |
3d6c6501 | 123 | |
12516a37 KR |
124 | typedef enum |
125 | { | |
5489fcc3 | 126 | FF_AUTO = 0, FF_MAGIC, FF_BSD, FF_PROF |
12516a37 KR |
127 | } |
128 | File_Format; | |
3d6c6501 | 129 | |
5489fcc3 | 130 | typedef int bool; |
12516a37 | 131 | typedef unsigned char UNIT[2]; /* unit of profiling */ |
3d6c6501 | 132 | |
12516a37 | 133 | extern const char *whoami; /* command-name, for error messages */ |
64c50fc5 | 134 | extern const char *function_mapping_file; /* file mapping functions to files */ |
12516a37 KR |
135 | extern const char *a_out_name; /* core filename */ |
136 | extern long hz; /* ticks per second */ | |
3d6c6501 | 137 | |
3d6c6501 | 138 | /* |
5489fcc3 KR |
139 | * Command-line options: |
140 | */ | |
12516a37 | 141 | extern int debug_level; /* debug level */ |
5489fcc3 | 142 | extern int output_style; |
12516a37 KR |
143 | extern int output_width; /* controls column width in index */ |
144 | extern bool bsd_style_output; /* as opposed to FSF style output */ | |
e4dee78c | 145 | extern bool demangle; /* demangle symbol names? */ |
5489fcc3 KR |
146 | extern bool discard_underscores; /* discard leading underscores? */ |
147 | extern bool ignore_direct_calls; /* don't count direct calls */ | |
148 | extern bool ignore_static_funcs; /* suppress static functions */ | |
12516a37 KR |
149 | extern bool ignore_zeros; /* ignore unused symbols/files */ |
150 | extern bool line_granularity; /* function or line granularity? */ | |
151 | extern bool print_descriptions; /* output profile description */ | |
152 | extern bool print_path; /* print path or just filename? */ | |
32843f94 JL |
153 | extern bool ignore_non_functions;/* Ignore non-function symbols. */ |
154 | ||
12516a37 | 155 | extern File_Format file_format; /* requested file format */ |
5489fcc3 | 156 | |
12516a37 | 157 | extern bool first_output; /* no output so far? */ |
5489fcc3 | 158 | |
12516a37 | 159 | extern void done PARAMS ((int status)); |
5489fcc3 KR |
160 | |
161 | #endif /* gprof_h */ |