home *** CD-ROM | disk | FTP | other *** search
/ QuickTime 2.0 Developer Kit / QuickTime 2.0 Developer Kit.iso / mac / MAC / Programming Stuff / Interfaces / CIncludes / Perf.h < prev    next >
Encoding:
C/C++ Source or Header  |  1993-11-30  |  2.8 KB  |  83 lines  |  [TEXT/MPS ]

  1. /*
  2.     File:        Perf.h
  3.  
  4.     Copyright:    © 1983-1993 by Apple Computer, Inc.
  5.                 All rights reserved.
  6.  
  7.     Version:    System 7.1 for ETO #11
  8.     Created:    Tuesday, March 30, 1993 18:00
  9.  
  10. */
  11.  
  12. #ifndef __PERF__
  13. #define __PERF__
  14.  
  15. #ifndef __TYPES__
  16. #include <Types.h>
  17. #endif
  18.  
  19. struct TPerfGlobals {
  20.     long startROM;                /*ROM Base*/
  21.     long romHits;                /*used if MeasureROM is false*/
  22.     long misses;                /*count of PC values outside measured memory*/
  23.     long (*segArray)[1];        /*array of segment handles*/
  24.     long (*sizeArray)[1];        /*array of segment sizes*/
  25.     short (**idArray)[1];        /*array of segment rsrc IDs*/
  26.     long (*baseArray)[1];        /*array of offsets to counters for each segment*/
  27.     long (*samples)[1];         /*samples buffer*/
  28.     long buffSize;                /*size of samples buffer in bytes*/
  29.     short timeInterval;         /*number of clock intervals between interrupts*/
  30.     short bucketSize;            /*size of buckets power of 2*/
  31.     short log2buckSize;         /*used in CvtPC*/
  32.     short pcOffset;             /*offset to the user PC at interrupt time.*/
  33.     short numMeasure;            /*# Code segments (w/o jump table)- ROM etc.*/
  34.     short firstCode;            /*index of first Code segment*/
  35.     Boolean takingSamples;        /*true if sampling is enabled.*/
  36.     Boolean measureROM;
  37.     Boolean measureCode;
  38.     short ramSeg;                /*index of "segment" record to cover RAM > 0 if RAM (misses) are to be bucketed.*/
  39.     long ramBase;                /*beginning of RAM being measured.*/
  40.     short measureRAMbucketSize;
  41.     short measureRAMlog2buckSize;
  42.     short romVersion;
  43.     short vRefNum;                /*Volume where the report file is to be created*/
  44.     Boolean volumeSelected;     /*True if user selects the report file name*/
  45.     Str255 rptFileName;         /*Report file name*/
  46.     Str255 rptFileCreator;        /*Report File Creator*/
  47.     Str255 rptFileType;         /*Report File type*/
  48.     ResType getResType;         /*Resource type*/
  49. };
  50.  
  51. typedef struct TPerfGlobals TPerfGlobals;
  52. typedef TPerfGlobals *TP2PerfGlobals;
  53.  
  54. /* PerfGlobals are declared as a record, so main program can allocate
  55. as globals, desk accessory can add to globals allocated via pointer,
  56. print driver can allocate via low memory, etc. */
  57.  
  58.  
  59.  
  60. #ifdef __cplusplus
  61. extern "C" {
  62. #endif
  63. pascal Boolean InitPerf(TP2PerfGlobals *thePerfGlobals,short timerCount,
  64.     short codeAndROMBucketSize,Boolean doROM,Boolean doAppCode,const Str255 appCodeType,
  65.     short romID,const Str255 romName,Boolean doRAM,long ramLow,long ramHigh,
  66.     short ramBucketSize);                                /* called once to setup Performance monitoring
  67.  */
  68. pascal void TermPerf(TP2PerfGlobals thePerfGlobals);    /* if InitPerf succeeds then TermPerf must be called before terminating program.
  69.  */
  70. pascal Boolean PerfControl(TP2PerfGlobals thePerfGlobals,Boolean turnOn);
  71. /*
  72.     Call this to turn off/on measuring.
  73.      Returns previous state.
  74. */
  75.  
  76. pascal short PerfDump(TP2PerfGlobals thePerfGlobals,const Str255 reportFile,
  77.     Boolean doHistogram,short rptFileColumns);            /* Call this to dump the statistics into a file. */
  78. #ifdef __cplusplus
  79. }
  80. #endif
  81.  
  82. #endif
  83.