TestEtwEventSink.h 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. //-------------------------------------------------------------------------------------------------------
  2. // Copyright (C) Microsoft. All rights reserved.
  3. // Licensed under the MIT license. See LICENSE.txt file in the project root for full license information.
  4. //-------------------------------------------------------------------------------------------------------
  5. #pragma once
  6. #ifdef TEST_ETW_EVENTS
  7. #define CREATE_EVENTSINK_PROC_NAME CreateEventSink
  8. // Abstract class to be inherited to receive ETW event notifications
  9. class TestEtwEventSink
  10. {
  11. public:
  12. virtual void WriteMethodEvent(const char16* eventName,
  13. void* scriptContextId,
  14. void* methodStartAddress,
  15. uint64 methodSize,
  16. uint methodID,
  17. uint16 methodFlags,
  18. uint16 methodAddressRangeID,
  19. DWORD_PTR sourceID,
  20. uint line,
  21. uint column,
  22. const char16* methodName) = 0;
  23. virtual void WriteSourceEvent(const char16* eventName, uint64 sourceContext, void* scriptContextId, uint sourceFlags, const char16* url) = 0;
  24. virtual void UnloadInstance() = 0;
  25. static bool IsLoaded();
  26. static bool Load();
  27. static void Unload();
  28. static TestEtwEventSink* Instance;
  29. typedef void (*RundownFunc)(bool start);
  30. private:
  31. static char const * const CreateEventSinkProcName;
  32. typedef TestEtwEventSink * (*CreateEventSink)(RundownFunc rundown, bool trace);
  33. };
  34. #endif