36 #if defined(ALLOC_PRAGMA) 37 #pragma alloc_text(INIT, PerfInitialization) 38 #pragma alloc_text(PAGE, PerfTermination) 55 auto status = STATUS_SUCCESS;
57 const auto perf_collector =
60 if (!perf_collector) {
61 return STATUS_MEMORY_NOT_ALLOCATED;
84 LARGE_INTEGER counter = KeQueryPerformanceCounter(
nullptr);
85 return static_cast<ULONG64
>(counter.QuadPart);
89 void* output_context) {
90 UNREFERENCED_PARAMETER(output_context);
92 "Execution Count",
"Elapsed Time");
96 const char* location_name, ULONG64 total_execution_count,
97 ULONG64 total_elapsed_time,
void* output_context) {
98 UNREFERENCED_PARAMETER(output_context);
100 total_execution_count, total_elapsed_time);
104 void* output_context) {
105 UNREFERENCED_PARAMETER(output_context);
void Terminate()
Destructor; prints out accumulated performance results.
#define HYPERPLATFORM_LOG_INFO(format,...)
static const ULONG kHyperPlatformCommonPoolTag
A pool tag.
void Initialize(_In_ OutputRoutine *output_routine, _In_opt_ InitialOutputRoutine *initial_output_routine=NoOutputRoutine, _In_opt_ FinalOutputRoutine *final_output_routine=NoOutputRoutine, _In_opt_ LockRoutine *lock_enter_routine=NoLockRoutine, _In_opt_ LockRoutine *lock_leave_routine=NoLockRoutine, _In_opt_ void *lock_context=nullptr, _In_opt_ void *output_context=nullptr)
Constructor; call this only once before any other code in this module runs.
void(_In_ const char *location_name, _In_ ULONG64 total_execution_count, _In_ ULONG64 total_elapsed_time, _In_opt_ void *output_context) OutputRoutine
A function type for printing out results.
void(_In_opt_ void *output_context) FinalOutputRoutine
A function type for printing out a footer line of results.
void(_In_opt_ void *output_context) InitialOutputRoutine
A function type for printing out a header line of results.
Declares and implements common things across the project.
Responsible for collecting and saving data supplied by PerfCounter.
Declares interfaces to logging functions.