OpenCBM
perfeval.h
Go to the documentation of this file.
1 /*
2  * This program is free software; you can redistribute it and/or
3  * modify it under the terms of the GNU General Public License
4  * as published by the Free Software Foundation; either version
5  * 2 of the License, or (at your option) any later version.
6  *
7  * Copyright 2005-2007 Spiro Trikaliotis
8  */
9 
18 #ifndef PERFEVAL_H
19 #define PERFEVAL_H
20 
21 #ifdef __cplusplus
22 extern "C" {
23 #endif /* #ifdef _CPLUSPLUS */
24 
25 #ifdef DBG_USERMODE
26  typedef HANDLE PETHREAD;
27 #endif
28 
29 #include "debug.h"
30 
31 #ifdef PERFEVAL
32 
36 typedef struct
37 PERFORMANCE_EVAL_ENTRY
38 {
40  __int64 Timestamp;
41 
43  ULONG Processor;
44 
46  PETHREAD PeThread;
47 
49  ULONG_PTR Event;
50 
52  ULONG_PTR Data;
53 
54 } PERFORMANCE_EVAL_ENTRY, *PPERFORMANCE_EVAL_ENTRY;
55 
56 extern VOID PerfInit(VOID);
57 extern VOID PerfEvent(IN ULONG_PTR Event, IN ULONG_PTR Data);
58 extern VOID PerfSave(VOID);
59 
61 #define PERF_INIT() PerfInit()
62 
64 #define PERF_EVENT(_Event_, _Data_) PerfEvent(_Event_, _Data_)
65 
67 #ifdef PERFEVAL_VERBOSE
68  #define PERF_EVENT_VERBOSE(_Event_, _Data_) PERF_EVENT(_Event_, _Data_)
69 #else
70  #define PERF_EVENT_VERBOSE(_Event_, _Data_)
71 #endif
72 
73 #ifdef PERFEVAL_PARBURST
74  #define PERF_EVENT_PARBURST(_Event_, _Data_) PERF_EVENT(_Event_, _Data_)
75 #else
76  #define PERF_EVENT_PARBURST(_Event_, _Data_)
77 #endif
78 
80 #define PERF_SAVE() PerfSave()
81 
82 #else /* #ifdef PERFEVAL */
83 
85 #define PERF_INIT()
86 
88 #define PERF_EVENT(_Event_, _Data_)
89 
91 #define PERF_SAVE()
92 
93 #endif /* #ifdef PERFEVAL */
94 
95 #ifdef __cplusplus
96 }
97 #endif /* #ifdef _CPLUSPLUS */
98 
99 #endif // #ifndef PERFEVAL_H
Define makros for debugging purposes.