Back to index

cell-binutils  2.17cvs20070401
gprof.h
Go to the documentation of this file.
00001 /*
00002  * Copyright (c) 1983, 1993
00003  *      The Regents of the University of California.  All rights reserved.
00004  *
00005  * Redistribution and use in source and binary forms, with or without
00006  * modification, are permitted provided that the following conditions
00007  * are met:
00008  * 1. Redistributions of source code must retain the above copyright
00009  *    notice, this list of conditions and the following disclaimer.
00010  * 2. Redistributions in binary form must reproduce the above copyright
00011  *    notice, this list of conditions and the following disclaimer in the
00012  *    documentation and/or other materials provided with the distribution.
00013  * 3. Neither the name of the University nor the names of its contributors
00014  *    may be used to endorse or promote products derived from this software
00015  *    without specific prior written permission.
00016  *
00017  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
00018  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
00019  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
00020  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
00021  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
00022  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
00023  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
00024  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
00025  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
00026  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
00027  * SUCH DAMAGE.
00028  */
00029 #ifndef gprof_h
00030 #define gprof_h
00031 
00032 /* Include the BFD sysdep.h file.  */
00033 #include "sysdep.h"
00034 #include "bfd.h"
00035 
00036 /* Undefine the BFD PACKAGE and VERSION macros before including the
00037    gprof config.h file.  */
00038 #undef PACKAGE
00039 #undef VERSION
00040 
00041 #include "gconfig.h"
00042 
00043 #ifndef MIN
00044 #define MIN(a,b)     ((a) < (b) ? (a) : (b))
00045 #endif
00046 #ifndef MAX
00047 #define MAX(a,b)     ((a) > (b) ? (a) : (b))
00048 #endif
00049 
00050 /* AIX defines hz as a macro.  */
00051 #undef hz
00052 
00053 #ifndef PATH_MAX
00054 #define PATH_MAX     1024
00055 #endif
00056 
00057 #define       A_OUTNAME     "a.out"              /* default core filename */
00058 #define       GMONNAME      "gmon.out"    /* default profile filename */
00059 #define       GMONSUM              "gmon.sum"    /* profile summary filename */
00060 
00061 #ifdef HAVE_LOCALE_H
00062 # include <locale.h>
00063 #endif
00064 
00065 #ifdef ENABLE_NLS
00066 /* Undefine BFD's `_' macro - it uses dgetext() and we want to use gettext().  */
00067 #undef  _
00068 #define _(String) gettext (String)
00069 #endif
00070 
00071 #define STYLE_FLAT_PROFILE  (1<<0)
00072 #define STYLE_CALL_GRAPH    (1<<1)
00073 #define STYLE_SUMMARY_FILE  (1<<2)
00074 #define STYLE_EXEC_COUNTS   (1<<3)
00075 #define STYLE_ANNOTATED_SOURCE     (1<<4)
00076 #define STYLE_GMON_INFO            (1<<5)
00077 #define STYLE_FUNCTION_ORDER       (1<<6)
00078 #define STYLE_FILE_ORDER    (1<<7)
00079 
00080 #define       ANYDEBUG      (1<<0) /*    1 */
00081 #define       DFNDEBUG      (1<<1) /*    2 */
00082 #define       CYCLEDEBUG    (1<<2) /*    4 */
00083 #define       ARCDEBUG      (1<<3) /*    8 */
00084 #define       TALLYDEBUG    (1<<4) /*   16 */
00085 #define       TIMEDEBUG     (1<<5) /*   32 */
00086 #define       SAMPLEDEBUG   (1<<6) /*   64 */
00087 #define       AOUTDEBUG     (1<<7) /*  128 */
00088 #define       CALLDEBUG     (1<<8) /*  256 */
00089 #define       LOOKUPDEBUG   (1<<9) /*  512 */
00090 #define       PROPDEBUG     (1<<10)       /* 1024 */
00091 #define BBDEBUG             (1<<11)       /* 2048 */
00092 #define IDDEBUG             (1<<12)       /* 4096 */
00093 #define SRCDEBUG     (1<<13)       /* 8192 */
00094 
00095 #ifdef DEBUG
00096 #define DBG(l,s)     if (debug_level & (l)) {s;}
00097 #else
00098 #define DBG(l,s)
00099 #endif
00100 
00101 typedef enum
00102   {
00103     FF_AUTO = 0, FF_MAGIC, FF_BSD, FF_BSD44, FF_PROF
00104   }
00105 File_Format;
00106 
00107 typedef unsigned char UNIT[2];     /* unit of profiling */
00108 
00109 extern const char *whoami;  /* command-name, for error messages */
00110 extern const char *function_mapping_file; /* file mapping functions to files */
00111 extern const char *a_out_name;     /* core filename */
00112 extern long hz;                    /* ticks per second */
00113 
00114 /*
00115  * Command-line options:
00116  */
00117 extern int debug_level;                   /* debug level */
00118 extern int output_style;
00119 extern int output_width;           /* controls column width in index */
00120 extern bfd_boolean bsd_style_output;      /* as opposed to FSF style output */
00121 extern bfd_boolean demangle;              /* demangle symbol names? */
00122 extern bfd_boolean discard_underscores;   /* discard leading underscores? */
00123 extern bfd_boolean ignore_direct_calls;   /* don't count direct calls */
00124 extern bfd_boolean ignore_static_funcs;   /* suppress static functions */
00125 extern bfd_boolean ignore_zeros;   /* ignore unused symbols/files */
00126 extern bfd_boolean line_granularity;      /* function or line granularity? */
00127 extern bfd_boolean print_descriptions;    /* output profile description */
00128 extern bfd_boolean print_path;            /* print path or just filename? */
00129 extern bfd_boolean ignore_non_functions; /* Ignore non-function symbols.  */
00130 
00131 extern File_Format file_format;           /* requested file format */
00132 
00133 extern bfd_boolean first_output;   /* no output so far? */
00134 
00135 extern void done (int status) ATTRIBUTE_NORETURN;
00136 
00137 #endif /* gprof_h */