home *** CD-ROM | disk | FTP | other *** search
- // sampler.hpp
- //
- // Created 01/18/99
- //
- // (C) Copyright 1995 - 1999 Microsoft Corporation. All rights reserved.
- //
-
- #ifndef __SAMPLER_HPP__
- #define __SAMPLER_HPP__
-
- #include <jevmon.h>
-
- class EventMonitor;
- struct ThreadRecord;
- class CallProfiler;
-
-
- struct SampleRecord
- {
- JVM_METHOD_SAMPLE sample;
- ThreadID thread;
- DWORD tid;
- };
-
-
- class SamplingProfiler
- {
- EventMonitor *m_pmon;
- CallProfiler *m_callprof;
-
- HANDLE m_hSamplerThread;
-
- float m_SamplerOverhead;
- ULONG m_nSamples;
- ULONG m_AccuracySum;
- ULONG m_nSamples_WithMethod;
- ULONG m_AccuracySum_WithMethod;
-
- static DWORD WINAPI SamplerThreadEntry (LPVOID lpThreadParameter);
- DWORD SamplerThread ();
-
- static VOID GetThreadSampleCB (ThreadRecord *pThread, PVOID token);
- VOID GetThreadSample (ThreadRecord *pThread);
-
- public:
-
- SamplingProfiler ();
-
- HRESULT Initialize (EventMonitor *pmon, CallProfiler *callprof);
-
- VOID Destruct ();
-
-
- VOID OnVMInitialization ();
-
-
- VOID SpewSamplerResults ();
- };
-
-
- #endif /* __SAMPLER_HPP__ */
-
-