diff --git a/include/gpgmm.h b/include/gpgmm.h index a87ba22f9..c84776466 100644 --- a/include/gpgmm.h +++ b/include/gpgmm.h @@ -99,6 +99,86 @@ namespace gpgmm { kSubAllocatedWithin = 3, }; + /** \enum EVENT_RECORD_FLAGS + Represents different event categories to record. + */ + enum EVENT_RECORD_FLAGS { + + /** \brief Record nothing. + */ + EVENT_RECORD_FLAG_NONE = 0x0, + + /** \brief Record lifetimes of API objects created by GPGMM. + */ + EVENT_RECORD_FLAG_API_OBJECTS = 0x1, + + /** \brief Record API calls made to GPGMM. + */ + EVENT_RECORD_FLAG_API_CALLS = 0x2, + + /** \brief Record duration of GPGMM API calls. + */ + EVENT_RECORD_FLAG_API_TIMINGS = 0x4, + + /** \brief Record metrics made to GPGMM API calls. + */ + EVENT_RECORD_FLAG_COUNTERS = 0x8, + + /** \brief Record events required for playback. + + Bitwise OR'd combination of EVENT_RECORD_FLAG_API_OBJECTS and + EVENT_RECORD_FLAG_API_CALLS. + */ + EVENT_RECORD_FLAG_CAPTURE = 0x3, + + /** \brief Record everything. + */ + EVENT_RECORD_FLAG_ALL_EVENTS = 0xFF, + }; + + /** \enum EVENT_RECORD_SCOPE + Represents recording scopes to limit event recording. + */ + enum EVENT_RECORD_SCOPE { + + /** \brief Scopes events per process (or multiple instances). + */ + EVENT_RECORD_SCOPE_PER_PROCESS = 0, + + /** \brief Scopes events per instance. + */ + EVENT_RECORD_SCOPE_PER_INSTANCE = 1, + }; + + /** \struct EVENT_RECORD_OPTIONS + Represents additional controls for recording. + */ + struct EVENT_RECORD_OPTIONS { + /** \brief Flags used to decide what to record. + + Optional parameter. By default, nothing is recorded. + */ + EVENT_RECORD_FLAGS Flags; + + /** \brief Specifies the scope of the events. + + Optional parameter. By default, recording is per process. + */ + EVENT_RECORD_SCOPE EventScope; + + /** \brief Record detailed timing events. + + Optional parameter. By default, detailed timing events are disabled. + */ + bool UseDetailedTimingEvents; + + /** \brief Path to trace file. + + Optional parameter. By default, a trace file is created for you. + */ + const char* TraceFile; + }; + } // namespace gpgmm #endif // INCLUDE_GPGMM_H_ diff --git a/include/gpgmm_d3d12.h b/include/gpgmm_d3d12.h index b3d4786e1..42a60ea54 100644 --- a/include/gpgmm_d3d12.h +++ b/include/gpgmm_d3d12.h @@ -275,88 +275,8 @@ namespace gpgmm::d3d12 { */ GPGMM_EXPORT HRESULT CreateResidencyList(IResidencyList** ppResidencyListOut); - /** \enum EVENT_RECORD_FLAGS - Represents different event categories to record. - */ - enum EVENT_RECORD_FLAGS { - - /** \brief Record nothing. - */ - EVENT_RECORD_FLAG_NONE = 0x0, - - /** \brief Record lifetimes of API objects created by GPGMM. - */ - EVENT_RECORD_FLAG_API_OBJECTS = 0x1, - - /** \brief Record API calls made to GPGMM. - */ - EVENT_RECORD_FLAG_API_CALLS = 0x2, - - /** \brief Record duration of GPGMM API calls. - */ - EVENT_RECORD_FLAG_API_TIMINGS = 0x4, - - /** \brief Record metrics made to GPGMM API calls. - */ - EVENT_RECORD_FLAG_COUNTERS = 0x8, - - /** \brief Record events required for playback. - - Bitwise OR'd combination of EVENT_RECORD_FLAG_API_OBJECTS and - EVENT_RECORD_FLAG_API_CALLS. - */ - EVENT_RECORD_FLAG_CAPTURE = 0x3, - - /** \brief Record everything. - */ - EVENT_RECORD_FLAG_ALL_EVENTS = 0xFF, - }; - DEFINE_ENUM_FLAG_OPERATORS(EVENT_RECORD_FLAGS) - /** \enum EVENT_RECORD_SCOPE - Represents recording scopes to limit event recording. - */ - enum EVENT_RECORD_SCOPE { - - /** \brief Scopes events per process (or multiple instances). - */ - EVENT_RECORD_SCOPE_PER_PROCESS = 0, - - /** \brief Scopes events per instance. - */ - EVENT_RECORD_SCOPE_PER_INSTANCE = 1, - }; - - /** \struct EVENT_RECORD_OPTIONS - Represents additional controls for recording. - */ - struct EVENT_RECORD_OPTIONS { - /** \brief Flags used to decide what to record. - - Optional parameter. By default, nothing is recorded. - */ - EVENT_RECORD_FLAGS Flags; - - /** \brief Specifies the scope of the events. - - Optional parameter. By default, recording is per process. - */ - EVENT_RECORD_SCOPE EventScope; - - /** \brief Record detailed timing events. - - Optional parameter. By default, detailed timing events are disabled. - */ - bool UseDetailedTimingEvents; - - /** \brief Path to trace file. - - Optional parameter. By default, a trace file is created for you. - */ - const char* TraceFile; - }; - /** \enum RESIDENCY_FLAGS Specify options to configure the residency manager. */ diff --git a/src/tests/capture_replay_tests/D3D12EventTraceReplay.cpp b/src/tests/capture_replay_tests/D3D12EventTraceReplay.cpp index cc9b88b71..3e63d0541 100644 --- a/src/tests/capture_replay_tests/D3D12EventTraceReplay.cpp +++ b/src/tests/capture_replay_tests/D3D12EventTraceReplay.cpp @@ -189,14 +189,14 @@ class D3D12EventTraceReplay : public D3D12TestBase, public CaptureReplayTestWith // Captures never store recording options, they must be always specified. baseAllocatorDesc.RecordOptions.Flags |= - static_cast(envParams.CaptureEventMask); + static_cast(envParams.CaptureEventMask); baseAllocatorDesc.RecordOptions.TraceFile = traceFile.path.c_str(); baseAllocatorDesc.MinRecordLevel = baseAllocatorDesc.MinLogLevel; // Keep recording across multiple playback iterations to ensure all // events will be captured instead of overwritten per iteration. if (envParams.Iterations == 1) { - baseAllocatorDesc.RecordOptions.EventScope = EVENT_RECORD_SCOPE_PER_INSTANCE; + baseAllocatorDesc.RecordOptions.EventScope = gpgmm::EVENT_RECORD_SCOPE_PER_INSTANCE; } if (!envParams.IsPrefetchAllowed) {