home *** CD-ROM | disk | FTP | other *** search
/ io Programmo 39 / IOPROG_39.ISO / SOFT / sdkjava40.exe / data1.cab / fg_Samples / Samples / Profiler / jviewprf / sampler.hpp < prev    next >
Encoding:
C/C++ Source or Header  |  2000-05-04  |  1.1 KB  |  63 lines

  1. // sampler.hpp
  2. //
  3. // Created 01/18/99
  4. //
  5. // (C) Copyright 1995 - 1999 Microsoft Corporation.  All rights reserved.
  6. //
  7.  
  8. #ifndef __SAMPLER_HPP__
  9. #define __SAMPLER_HPP__
  10.  
  11. #include <jevmon.h>
  12.  
  13. class EventMonitor;
  14. struct ThreadRecord;
  15. class CallProfiler;
  16.  
  17.  
  18. struct SampleRecord
  19. {
  20.     JVM_METHOD_SAMPLE sample;
  21.     ThreadID thread;
  22.     DWORD tid;
  23. };
  24.  
  25.  
  26. class SamplingProfiler
  27. {
  28.     EventMonitor *m_pmon;
  29.     CallProfiler *m_callprof;
  30.     
  31.     HANDLE m_hSamplerThread;
  32.  
  33.     float m_SamplerOverhead;
  34.     ULONG m_nSamples;
  35.     ULONG m_AccuracySum;
  36.     ULONG m_nSamples_WithMethod;
  37.     ULONG m_AccuracySum_WithMethod;
  38.  
  39.     static DWORD WINAPI SamplerThreadEntry (LPVOID lpThreadParameter);
  40.     DWORD SamplerThread ();
  41.  
  42.     static VOID GetThreadSampleCB (ThreadRecord *pThread, PVOID token);
  43.     VOID GetThreadSample (ThreadRecord *pThread);
  44.  
  45. public:
  46.  
  47.     SamplingProfiler ();
  48.  
  49.     HRESULT Initialize (EventMonitor *pmon, CallProfiler *callprof);
  50.  
  51.     VOID Destruct ();
  52.  
  53.  
  54.     VOID OnVMInitialization ();
  55.  
  56.  
  57.     VOID SpewSamplerResults ();
  58. };
  59.  
  60.  
  61. #endif /* __SAMPLER_HPP__ */
  62.  
  63.