HyperPlatform Programmer's Reference
performance.h
Go to the documentation of this file.
1 // Copyright (c) 2015-2017, Satoshi Tanda. All rights reserved.
2 // Use of this source code is governed by a MIT-style license that can be
3 // found in the LICENSE file.
4 
7 
8 #ifndef HYPERPLATFORM_PERFORMANCE_H_
9 #define HYPERPLATFORM_PERFORMANCE_H_
10 
11 #include "perf_counter.h"
12 
13 extern "C" {
15 //
16 // macro utilities
17 //
18 
19 #if (HYPERPLATFORM_PERFORMANCE_ENABLE_PERFCOUNTER != 0)
20 
26 #define HYPERPLATFORM_PERFORMANCE_MEASURE_THIS_SCOPE() \
27  HYPERPLATFORM_PERFCOUNTER_MEASURE_TIME(g_performance_collector, PerfGetTime)
28 
29 #else
30 #define HYPERPLATFORM_PERFORMANCE_MEASURE_THIS_SCOPE()
31 #endif
32 
34 //
35 // constants and macros
36 //
37 
39 //
40 // types
41 //
42 
44 //
45 // prototypes
46 //
47 
50 _IRQL_requires_max_(PASSIVE_LEVEL) NTSTATUS PerfInitialization();
51 
53 _IRQL_requires_max_(PASSIVE_LEVEL) void PerfTermination();
54 
59 ULONG64 PerfGetTime();
60 
62 //
63 // variables
64 //
65 
69 
71 //
72 // implementations
73 //
74 
75 } // extern "C"
76 
77 #endif // HYPERPLATFORM_PERFORMANCE_H_
ULONG64 PerfGetTime()
Returns the current "time" for performance measurement.
Definition: performance.cpp:83
NTSTATUS PerfInitialization()
Makes HYPERPLATFORM_PERFORMANCE_MEASURE_THIS_SCOPE() ready for use.
Definition: performance.cpp:53
void PerfTermination()
Ends performance monitoring and outputs its results.
Definition: performance.cpp:73
Responsible for collecting and saving data supplied by PerfCounter.
Definition: perf_counter.h:113
PerfCollector * g_performance_collector
Stores all performance data collected by HYPERPLATFORM_PERFORMANCE_MEASURE_THIS_SCOPE().
Definition: performance.cpp:46
Declares interfaces to performance measurement primitives.