home *** CD-ROM | disk | FTP | other *** search
/ Tricks of the Mac Game Programming Gurus / TricksOfTheMacGameProgrammingGurus.iso / CodeWarrior Lite / Metrowerks C⁄C++ Lite / Profiler Libraries / profiler.h < prev    next >
Encoding:
C/C++ Source or Header  |  1995-04-25  |  1.7 KB  |  68 lines  |  [TEXT/MMCC]

  1. /*
  2.     profiler.h
  3.  
  4.     The main entry points for the Profiler.
  5.     
  6.     Copyright © 1993-1994 Metrowerks Inc.  All rights reserved.
  7.  */
  8.  
  9. #ifndef __PROFILER__
  10. #define __PROFILER__
  11.  
  12. #ifndef __TYPES__
  13. #include <Types.h>
  14. #endif
  15.  
  16. typedef enum { collectDetailed, collectSummary } ProfilerCollectionMethod;
  17. typedef enum { ticksTimeBase, timeMgrTimeBase, microsecondsTimeBase, PPCTimeBase, bestTimeBase } ProfilerTimeBase;
  18.     
  19. #ifdef __cplusplus
  20. extern "C" {
  21. #endif
  22.  
  23. /*
  24.   The following call turns on the Profiler and starts the underlying timebase.
  25.  */
  26. pascal OSErr ProfilerInit(ProfilerCollectionMethod method, ProfilerTimeBase timeBase, short numFunctions, short stackDepth);
  27.  
  28. /*
  29.   Turn off the profiler and stop the timebase.  This releases the memory holding
  30.   the recorded data.
  31.  */
  32. pascal void ProfilerTerm(void);
  33.  
  34. /*
  35.   Turn on and off the profiler.  This pauses the timebase, and the recording of data.
  36.  */
  37. pascal void ProfilerSetStatus(short on);
  38. pascal short ProfilerGetStatus(void);
  39.  
  40. /*
  41.   Return the data buffer sizes that the profiler has currently used.  This is useful
  42.   for tuning the buffer sizes passed to ProfilerInit.
  43.  */
  44.  
  45. pascal void ProfilerGetDataSizes(long *functionSize, long *stackSize);
  46.  
  47. /*
  48.   Dump the current buffer of profile information to the given file.  If it exists, append
  49.   and increment a number to the filename.  This does not clear the profile information.
  50.   The filename should be a Pascal string.
  51.  */
  52. pascal OSErr ProfilerDump(StringPtr filename);
  53.  
  54. /*
  55.   Clear out the profile buffer.  This does not stop the recording of new information.
  56.  */
  57. pascal void ProfilerClear(void);
  58.  
  59. /*
  60.   The actual function that the compiler calls to collect profile information.
  61.  */
  62. pascal void __PROFILE(char *functionName);
  63.  
  64. #ifdef __cplusplus
  65. }
  66. #endif
  67.  
  68. #endif