Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
80 changes: 80 additions & 0 deletions include/gpgmm.h
Original file line number Diff line number Diff line change
Expand Up @@ -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_
80 changes: 0 additions & 80 deletions include/gpgmm_d3d12.h
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*/
Expand Down
4 changes: 2 additions & 2 deletions src/tests/capture_replay_tests/D3D12EventTraceReplay.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<EVENT_RECORD_FLAGS>(envParams.CaptureEventMask);
static_cast<gpgmm::EVENT_RECORD_FLAGS>(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) {
Expand Down