comparison probes.h @ 209:0c83ea8adefc

Close to compilable version of common_ancestor -- still includes HW dep stuff
author Some Random Person <seanhalle@yahoo.com>
date Sun, 04 Mar 2012 14:26:35 -0800
parents eaf7e4c58c9e
children
comparison
equal deleted inserted replaced
12:c079d8b32d45 13:501023fdbd0b
26 char *nameStr; 26 char *nameStr;
27 int32 probeID; 27 int32 probeID;
28 28
29 int32 schedChoiceWasRecorded; 29 int32 schedChoiceWasRecorded;
30 int32 coreNum; 30 int32 coreNum;
31 int32 procrID; 31 int32 slaveID;
32 float64 procrCreateSecs; 32 float64 slaveCreateSecs;
33 33
34 #ifdef STATS__USE_TSC_PROBES 34 // #ifdef STATS__USE_TSC_PROBES
35 TSCount startStamp; 35 TSCount startStamp;
36 TSCount endStamp; 36 TSCount endStamp;
37 #else 37 // #else
38 struct timeval startStamp; 38 // struct timeval startStamp;
39 struct timeval endStamp; 39 // struct timeval endStamp;
40 #endif 40 // #endif
41 float64 startSecs; 41 float64 startSecs;
42 float64 endSecs; 42 float64 endSecs;
43 float64 interval; 43 float64 interval;
44 DblHist *hist;//if NULL, then is single interval probe 44 DblHist *hist;//if NULL, then is single interval probe
45 }; 45 };
46 46
47 47
48 int32
49 VMS_impl__create_single_interval_probe( char *nameStr, SlaveVP *animSlv );
50
51 int32
52 VMS_impl__create_histogram_probe( int32 numBins, float64 startValue,
53 float64 binWidth, char *nameStr, SlaveVP *animSlv );
54
55 int32
56 VMS_impl__record_time_point_into_new_probe( char *nameStr, SlaveVP *animSlv);
57
58 int32
59 VMS_ext_impl__record_time_point_into_new_probe( char *nameStr );
60
61 void
62 VMS_impl__free_probe( IntervalProbe *probe );
63
64 void
65 VMS_impl__index_probe_by_its_name( int32 probeID, SlaveVP *animSlv );
66
67 IntervalProbe *
68 VMS_impl__get_probe_by_name( char *probeName, SlaveVP *animSlv );
69
70 void
71 VMS_impl__record_sched_choice_into_probe( int32 probeID, SlaveVP *animSlv );
72
73 void
74 VMS_impl__record_interval_start_in_probe( int32 probeID );
75
76 void
77 VMS_impl__record_interval_end_in_probe( int32 probeID );
78
79 void
80 VMS_impl__print_stats_of_probe( int32 probeID );
81
82 void
83 VMS_impl__print_stats_of_all_probes();
84
48 85
49 //======================== Probes ============================= 86 //======================== Probes =============================
50 // 87 //
51 // Use macros to allow turning probes off with a #define switch 88 // Use macros to allow turning probes off with a #define switch
89 // This means probes have zero impact on performance when off
90 //=============================================================
91 #define VMS_App__record_time_point_into_new_probe VMS_WL__record_time_point_into_new_probe
92 #define VMS_ext__record_time_point_into_new_probe
93 #define VMS_App__create_single_interval_probe VMS_WL__create_single_interval_probe
94 #define VMS_App__create_histogram_probe VMS_WL__create_histogram_probe
95 #define VMS_App__index_probe_by_its_name VMS_WL__index_probe_by_its_name
96 #define VMS_App__get_probe_by_name VMS_WL__get_probe_by_name
97 #define VMS_App__record_sched_choice_into_probe VMS_WL__record_sched_choice_into_probe
98 #define VMS_App__record_interval_start_in_probe VMS_WL__record_interval_start_in_probe
99 #define VMS_App__record_interval_end_in_probe VMS_WL__record_interval_end_in_probe
100 #define VMS_App__print_stats_of_probe VMS_WL__print_stats_of_probe
101 #define VMS_App__print_stats_of_all_probes VMS_WL__print_stats_of_all_probes
102
52 #ifdef STATS__ENABLE_PROBES 103 #ifdef STATS__ENABLE_PROBES
53 int32 104 #define VMS_WL__record_time_point_into_new_probe( nameStr, animSlv ) \
54 VMS_impl__record_time_point_into_new_probe( char *nameStr,SlaveVP *animPr); 105 VMS_impl__record_time_point_in_new_probe( nameStr, animSlv )
55 #define VMS__record_time_point_into_new_probe( nameStr, animPr ) \
56 VMS_impl__record_time_point_in_new_probe( nameStr, animPr )
57 106
58 int32
59 VMS_ext_impl__record_time_point_into_new_probe( char *nameStr );
60 #define VMS_ext__record_time_point_into_new_probe( nameStr ) \ 107 #define VMS_ext__record_time_point_into_new_probe( nameStr ) \
61 VMS_ext_impl__record_time_point_into_new_probe( nameStr ) 108 VMS_ext_impl__record_time_point_into_new_probe( nameStr )
62 109
110 #define VMS_WL__create_single_interval_probe( nameStr, animSlv ) \
111 VMS_impl__create_single_interval_probe( nameStr, animSlv )
63 112
64 int32 113 #define VMS_WL__create_histogram_probe( numBins, startValue, \
65 VMS_impl__create_single_interval_probe( char *nameStr, SlaveVP *animPr ); 114 binWidth, nameStr, animSlv ) \
66 #define VMS__create_single_interval_probe( nameStr, animPr ) \
67 VMS_impl__create_single_interval_probe( nameStr, animPr )
68
69
70 int32
71 VMS_impl__create_histogram_probe( int32 numBins, float64 startValue,
72 float64 binWidth, char *nameStr, SlaveVP *animPr );
73 #define VMS__create_histogram_probe( numBins, startValue, \
74 binWidth, nameStr, animPr ) \
75 VMS_impl__create_histogram_probe( numBins, startValue, \ 115 VMS_impl__create_histogram_probe( numBins, startValue, \
76 binWidth, nameStr, animPr ) 116 binWidth, nameStr, animSlv )
77 void 117 #define VMS_int__free_probe( probe ) \
78 VMS_impl__free_probe( IntervalProbe *probe );
79 #define VMS__free_probe( probe ) \
80 VMS_impl__free_probe( probe ) 118 VMS_impl__free_probe( probe )
81 119
82 void 120 #define VMS_WL__index_probe_by_its_name( probeID, animSlv ) \
83 VMS_impl__index_probe_by_its_name( int32 probeID, SlaveVP *animPr ); 121 VMS_impl__index_probe_by_its_name( probeID, animSlv )
84 #define VMS__index_probe_by_its_name( probeID, animPr ) \
85 VMS_impl__index_probe_by_its_name( probeID, animPr )
86 122
87 IntervalProbe * 123 #define VMS_WL__get_probe_by_name( probeID, animSlv ) \
88 VMS_impl__get_probe_by_name( char *probeName, SlaveVP *animPr ); 124 VMS_impl__get_probe_by_name( probeName, animSlv )
89 #define VMS__get_probe_by_name( probeID, animPr ) \
90 VMS_impl__get_probe_by_name( probeName, animPr )
91 125
92 void 126 #define VMS_WL__record_sched_choice_into_probe( probeID, animSlv ) \
93 VMS_impl__record_sched_choice_into_probe( int32 probeID, SlaveVP *animPr ); 127 VMS_impl__record_sched_choice_into_probe( probeID, animSlv )
94 #define VMS__record_sched_choice_into_probe( probeID, animPr ) \
95 VMS_impl__record_sched_choice_into_probe( probeID, animPr )
96 128
97 void 129 #define VMS_WL__record_interval_start_in_probe( probeID ) \
98 VMS_impl__record_interval_start_in_probe( int32 probeID );
99 #define VMS__record_interval_start_in_probe( probeID ) \
100 VMS_impl__record_interval_start_in_probe( probeID ) 130 VMS_impl__record_interval_start_in_probe( probeID )
101 131
102 void 132 #define VMS_WL__record_interval_end_in_probe( probeID ) \
103 VMS_impl__record_interval_end_in_probe( int32 probeID );
104 #define VMS__record_interval_end_in_probe( probeID ) \
105 VMS_impl__record_interval_end_in_probe( probeID ) 133 VMS_impl__record_interval_end_in_probe( probeID )
106 134
107 void 135 #define VMS_WL__print_stats_of_probe( probeID ) \
108 VMS_impl__print_stats_of_probe( int32 probeID );
109 #define VMS__print_stats_of_probe( probeID ) \
110 VMS_impl__print_stats_of_probe( probeID ) 136 VMS_impl__print_stats_of_probe( probeID )
111 137
112 void 138 #define VMS_WL__print_stats_of_all_probes() \
113 VMS_impl__print_stats_of_all_probes();
114 #define VMS__print_stats_of_all_probes() \
115 VMS_impl__print_stats_of_all_probes() 139 VMS_impl__print_stats_of_all_probes()
116 140
117 141
118 #else 142 #else
119 int32 143 #define VMS_WL__record_time_point_into_new_probe( nameStr, animSlv ) \
120 VMS_impl__record_time_point_into_new_probe( char *nameStr,SlaveVP *animPr);
121 #define VMS__record_time_point_into_new_probe( nameStr, animPr ) \
122 0 /* do nothing */ 144 0 /* do nothing */
123 145
124 int32
125 VMS_ext_impl__record_time_point_into_new_probe( char *nameStr );
126 #define VMS_ext__record_time_point_into_new_probe( nameStr ) \ 146 #define VMS_ext__record_time_point_into_new_probe( nameStr ) \
127 0 /* do nothing */ 147 0 /* do nothing */
128 148
129 149
130 int32 150 #define VMS_WL__create_single_interval_probe( nameStr, animSlv ) \
131 VMS_impl__create_single_interval_probe( char *nameStr, SlaveVP *animPr );
132 #define VMS__create_single_interval_probe( nameStr, animPr ) \
133 0 /* do nothing */ 151 0 /* do nothing */
134 152
135 153
136 int32 154 #define VMS_WL__create_histogram_probe( numBins, startValue, \
137 VMS_impl__create_histogram_probe( int32 numBins, float64 startValue, 155 binWidth, nameStr, animSlv ) \
138 float64 binWidth, char *nameStr, SlaveVP *animPr );
139 #define VMS__create_histogram_probe( numBins, startValue, \
140 binWidth, nameStr, animPr ) \
141 0 /* do nothing */ 156 0 /* do nothing */
142 157
143 void 158 #define VMS_WL__index_probe_by_its_name( probeID, animSlv ) \
144 VMS_impl__index_probe_by_its_name( int32 probeID, SlaveVP *animPr );
145 #define VMS__index_probe_by_its_name( probeID, animPr ) \
146 /* do nothing */ 159 /* do nothing */
147 160
148 IntervalProbe * 161 #define VMS_WL__get_probe_by_name( probeID, animSlv ) \
149 VMS_impl__get_probe_by_name( char *probeName, SlaveVP *animPr );
150 #define VMS__get_probe_by_name( probeID, animPr ) \
151 NULL /* do nothing */ 162 NULL /* do nothing */
152 163
153 void 164 #define VMS_WL__record_sched_choice_into_probe( probeID, animSlv ) \
154 VMS_impl__record_sched_choice_into_probe( int32 probeID, SlaveVP *animPr );
155 #define VMS__record_sched_choice_into_probe( probeID, animPr ) \
156 /* do nothing */ 165 /* do nothing */
157 166
158 void 167 #define VMS_WL__record_interval_start_in_probe( probeID ) \
159 VMS_impl__record_interval_start_in_probe( int32 probeID );
160 #define VMS__record_interval_start_in_probe( probeID ) \
161 /* do nothing */ 168 /* do nothing */
162 169
163 void 170 #define VMS_WL__record_interval_end_in_probe( probeID ) \
164 VMS_impl__record_interval_end_in_probe( int32 probeID );
165 #define VMS__record_interval_end_in_probe( probeID ) \
166 /* do nothing */ 171 /* do nothing */
167 172
168 inline void doNothing(); 173 #define VMS_WL__print_stats_of_probe( probeID ) \
169 void 174 ; /* do nothing */
170 VMS_impl__print_stats_of_probe( int32 probeID );
171 #define VMS__print_stats_of_probe( probeID ) \
172 doNothing/* do nothing */
173 175
174 void 176 #define VMS_WL__print_stats_of_all_probes() \
175 VMS_impl__print_stats_of_all_probes(); 177 ;/* do nothing */
176 #define VMS__print_stats_of_all_probes \
177 doNothing/* do nothing */
178 178
179 #endif /* defined STATS__ENABLE_PROBES */ 179 #endif /* defined STATS__ENABLE_PROBES */
180 180
181 #endif /* _PROBES_H */ 181 #endif /* _PROBES_H */
182 182