gprof.h 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135
  1. /*
  2. * Copyright (c) 1983, 1993
  3. * The Regents of the University of California. All rights reserved.
  4. *
  5. * Redistribution and use in source and binary forms, with or without
  6. * modification, are permitted provided that the following conditions
  7. * are met:
  8. * 1. Redistributions of source code must retain the above copyright
  9. * notice, this list of conditions and the following disclaimer.
  10. * 2. Redistributions in binary form must reproduce the above copyright
  11. * notice, this list of conditions and the following disclaimer in the
  12. * documentation and/or other materials provided with the distribution.
  13. * 3. Neither the name of the University nor the names of its contributors
  14. * may be used to endorse or promote products derived from this software
  15. * without specific prior written permission.
  16. *
  17. * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
  18. * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  19. * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  20. * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
  21. * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  22. * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
  23. * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  24. * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
  25. * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
  26. * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  27. * SUCH DAMAGE.
  28. */
  29. #ifndef gprof_h
  30. #define gprof_h
  31. /* Include the BFD sysdep.h file. */
  32. #include "sysdep.h"
  33. #include "bfd.h"
  34. #undef PACKAGE
  35. #undef PACKAGE_NAME
  36. #undef PACKAGE_STRING
  37. #undef PACKAGE_TARNAME
  38. #undef PACKAGE_VERSION
  39. #include "gconfig.h"
  40. #ifdef HAVE_SYS_TIME_H
  41. #include <sys/time.h>
  42. #endif
  43. #ifndef MIN
  44. #define MIN(a,b) ((a) < (b) ? (a) : (b))
  45. #endif
  46. #ifndef MAX
  47. #define MAX(a,b) ((a) > (b) ? (a) : (b))
  48. #endif
  49. /* AIX defines hz as a macro. */
  50. #undef hz
  51. #define A_OUTNAME "a.out" /* default core filename */
  52. #define GMONNAME "gmon.out" /* default profile filename */
  53. #define GMONSUM "gmon.sum" /* profile summary filename */
  54. #include <locale.h>
  55. #ifdef ENABLE_NLS
  56. /* Undefine BFD's `_' macro - it uses dgetext() and we want to use gettext(). */
  57. #undef _
  58. #define _(String) gettext (String)
  59. #endif
  60. #define STYLE_FLAT_PROFILE (1<<0)
  61. #define STYLE_CALL_GRAPH (1<<1)
  62. #define STYLE_SUMMARY_FILE (1<<2)
  63. #define STYLE_EXEC_COUNTS (1<<3)
  64. #define STYLE_ANNOTATED_SOURCE (1<<4)
  65. #define STYLE_GMON_INFO (1<<5)
  66. #define STYLE_FUNCTION_ORDER (1<<6)
  67. #define STYLE_FILE_ORDER (1<<7)
  68. #define ANYDEBUG (1<<0) /* 1 */
  69. #define DFNDEBUG (1<<1) /* 2 */
  70. #define CYCLEDEBUG (1<<2) /* 4 */
  71. #define ARCDEBUG (1<<3) /* 8 */
  72. #define TALLYDEBUG (1<<4) /* 16 */
  73. #define TIMEDEBUG (1<<5) /* 32 */
  74. #define SAMPLEDEBUG (1<<6) /* 64 */
  75. #define AOUTDEBUG (1<<7) /* 128 */
  76. #define CALLDEBUG (1<<8) /* 256 */
  77. #define LOOKUPDEBUG (1<<9) /* 512 */
  78. #define PROPDEBUG (1<<10) /* 1024 */
  79. #define BBDEBUG (1<<11) /* 2048 */
  80. #define IDDEBUG (1<<12) /* 4096 */
  81. #define SRCDEBUG (1<<13) /* 8192 */
  82. #ifdef DEBUG
  83. #define DBG(l,s) if (debug_level & (l)) {s;}
  84. #else
  85. #define DBG(l,s)
  86. #endif
  87. typedef enum
  88. {
  89. FF_AUTO = 0, FF_MAGIC, FF_BSD, FF_BSD44, FF_PROF
  90. }
  91. File_Format;
  92. typedef unsigned char UNIT[2]; /* unit of profiling */
  93. extern const char *whoami; /* command-name, for error messages */
  94. extern const char *function_mapping_file; /* file mapping functions to files */
  95. extern const char *a_out_name; /* core filename */
  96. extern long hz; /* ticks per second */
  97. /*
  98. * Command-line options:
  99. */
  100. extern int debug_level; /* debug level */
  101. extern int output_style;
  102. extern int output_width; /* controls column width in index */
  103. extern bool bsd_style_output; /* as opposed to FSF style output */
  104. extern bool demangle; /* demangle symbol names? */
  105. extern bool ignore_direct_calls; /* don't count direct calls */
  106. extern bool ignore_static_funcs; /* suppress static functions */
  107. extern bool ignore_zeros; /* ignore unused symbols/files */
  108. extern bool line_granularity; /* function or line granularity? */
  109. extern bool print_descriptions; /* output profile description */
  110. extern bool print_path; /* print path or just filename? */
  111. extern bool ignore_non_functions; /* Ignore non-function symbols. */
  112. extern bool inline_file_names; /* print file names after symbols */
  113. extern File_Format file_format; /* requested file format */
  114. extern bool first_output; /* no output so far? */
  115. extern void done (int status) ATTRIBUTE_NORETURN;
  116. #endif /* gprof_h */