comparison probes.h @ 200:6db9e4898978

VMS name chgs -- added "WL" "PI" and "int" and split vms.h up
author Me@portablequad
date Sun, 12 Feb 2012 01:49:33 -0800
parents c1784868dcea
children
comparison
equal deleted inserted replaced
9:db4c4e8d97c1 10:c2f3336728d3
12 12
13 #include "VMS_primitive_data_types.h" 13 #include "VMS_primitive_data_types.h"
14 14
15 #include <sys/time.h> 15 #include <sys/time.h>
16 16
17 /*Note on order of include files:
18 * This file relies on #defines that appear in other files..
19 */
17 20
18 //when STATS__TURN_ON_PROBES is defined allows using probes to measure
19 // time intervals. The probes are macros that only compile to something
20 // when STATS__TURN_ON_PROBES is defined. The probes are saved in the
21 // master env -- but only when this is defined.
22 //The TSC probes use RDTSC instr, can be unreliable, Dbl uses gettimeofday
23 #define STATS__TURN_ON_PROBES
24 //#define STATS__USE_TSC_PROBES
25 #define STATS__USE_DBL_PROBES
26 21
27 //typedef struct _IntervalProbe IntervalProbe; //in VMS.h 22 //typedef struct _IntervalProbe IntervalProbe; //in VMS.h
28 23
29 struct _IntervalProbe 24 struct _IntervalProbe
30 { 25 {
48 float64 interval; 43 float64 interval;
49 DblHist *hist;//if NULL, then is single interval probe 44 DblHist *hist;//if NULL, then is single interval probe
50 }; 45 };
51 46
52 47
53 //============================= Statistics ==================================
54
55 //Frequency of TS counts
56 //TODO: change freq for each machine
57 #define TSCOUNT_FREQ 3180000000
58
59 inline TSCount getTSCount();
60
61 48
62 //======================== Probes ============================= 49 //======================== Probes =============================
63 // 50 //
64 // Use macros to allow turning probes off with a #define switch 51 // Use macros to allow turning probes off with a #define switch
65 #ifdef STATS__ENABLE_PROBES 52 #ifdef STATS__ENABLE_PROBES
66 int32 53 int32
67 VMS_impl__record_time_point_into_new_probe( char *nameStr,VirtProcr *animPr); 54 VMS_impl__record_time_point_into_new_probe( char *nameStr,SlaveVP *animPr);
68 #define VMS__record_time_point_into_new_probe( nameStr, animPr ) \ 55 #define VMS__record_time_point_into_new_probe( nameStr, animPr ) \
69 VMS_impl__record_time_point_in_new_probe( nameStr, animPr ) 56 VMS_impl__record_time_point_in_new_probe( nameStr, animPr )
70 57
71 int32 58 int32
72 VMS_ext_impl__record_time_point_into_new_probe( char *nameStr ); 59 VMS_ext_impl__record_time_point_into_new_probe( char *nameStr );
73 #define VMS_ext__record_time_point_into_new_probe( nameStr ) \ 60 #define VMS_ext__record_time_point_into_new_probe( nameStr ) \
74 VMS_ext_impl__record_time_point_into_new_probe( nameStr ) 61 VMS_ext_impl__record_time_point_into_new_probe( nameStr )
75 62
76 63
77 int32 64 int32
78 VMS_impl__create_single_interval_probe( char *nameStr, VirtProcr *animPr ); 65 VMS_impl__create_single_interval_probe( char *nameStr, SlaveVP *animPr );
79 #define VMS__create_single_interval_probe( nameStr, animPr ) \ 66 #define VMS__create_single_interval_probe( nameStr, animPr ) \
80 VMS_impl__create_single_interval_probe( nameStr, animPr ) 67 VMS_impl__create_single_interval_probe( nameStr, animPr )
81 68
82 69
83 int32 70 int32
84 VMS_impl__create_histogram_probe( int32 numBins, float64 startValue, 71 VMS_impl__create_histogram_probe( int32 numBins, float64 startValue,
85 float64 binWidth, char *nameStr, VirtProcr *animPr ); 72 float64 binWidth, char *nameStr, SlaveVP *animPr );
86 #define VMS__create_histogram_probe( numBins, startValue, \ 73 #define VMS__create_histogram_probe( numBins, startValue, \
87 binWidth, nameStr, animPr ) \ 74 binWidth, nameStr, animPr ) \
88 VMS_impl__create_histogram_probe( numBins, startValue, \ 75 VMS_impl__create_histogram_probe( numBins, startValue, \
89 binWidth, nameStr, animPr ) 76 binWidth, nameStr, animPr )
90 void 77 void
91 VMS_impl__free_probe( IntervalProbe *probe ); 78 VMS_impl__free_probe( IntervalProbe *probe );
92 #define VMS__free_probe( probe ) \ 79 #define VMS__free_probe( probe ) \
93 VMS_impl__free_probe( probe ) 80 VMS_impl__free_probe( probe )
94 81
95 void 82 void
96 VMS_impl__index_probe_by_its_name( int32 probeID, VirtProcr *animPr ); 83 VMS_impl__index_probe_by_its_name( int32 probeID, SlaveVP *animPr );
97 #define VMS__index_probe_by_its_name( probeID, animPr ) \ 84 #define VMS__index_probe_by_its_name( probeID, animPr ) \
98 VMS_impl__index_probe_by_its_name( probeID, animPr ) 85 VMS_impl__index_probe_by_its_name( probeID, animPr )
99 86
100 IntervalProbe * 87 IntervalProbe *
101 VMS_impl__get_probe_by_name( char *probeName, VirtProcr *animPr ); 88 VMS_impl__get_probe_by_name( char *probeName, SlaveVP *animPr );
102 #define VMS__get_probe_by_name( probeID, animPr ) \ 89 #define VMS__get_probe_by_name( probeID, animPr ) \
103 VMS_impl__get_probe_by_name( probeName, animPr ) 90 VMS_impl__get_probe_by_name( probeName, animPr )
104 91
105 void 92 void
106 VMS_impl__record_sched_choice_into_probe( int32 probeID, VirtProcr *animPr ); 93 VMS_impl__record_sched_choice_into_probe( int32 probeID, SlaveVP *animPr );
107 #define VMS__record_sched_choice_into_probe( probeID, animPr ) \ 94 #define VMS__record_sched_choice_into_probe( probeID, animPr ) \
108 VMS_impl__record_sched_choice_into_probe( probeID, animPr ) 95 VMS_impl__record_sched_choice_into_probe( probeID, animPr )
109 96
110 void 97 void
111 VMS_impl__record_interval_start_in_probe( int32 probeID ); 98 VMS_impl__record_interval_start_in_probe( int32 probeID );
128 VMS_impl__print_stats_of_all_probes() 115 VMS_impl__print_stats_of_all_probes()
129 116
130 117
131 #else 118 #else
132 int32 119 int32
133 VMS_impl__record_time_point_into_new_probe( char *nameStr,VirtProcr *animPr); 120 VMS_impl__record_time_point_into_new_probe( char *nameStr,SlaveVP *animPr);
134 #define VMS__record_time_point_into_new_probe( nameStr, animPr ) \ 121 #define VMS__record_time_point_into_new_probe( nameStr, animPr ) \
135 0 /* do nothing */ 122 0 /* do nothing */
136 123
137 int32 124 int32
138 VMS_ext_impl__record_time_point_into_new_probe( char *nameStr ); 125 VMS_ext_impl__record_time_point_into_new_probe( char *nameStr );
139 #define VMS_ext__record_time_point_into_new_probe( nameStr ) \ 126 #define VMS_ext__record_time_point_into_new_probe( nameStr ) \
140 0 /* do nothing */ 127 0 /* do nothing */
141 128
142 129
143 int32 130 int32
144 VMS_impl__create_single_interval_probe( char *nameStr, VirtProcr *animPr ); 131 VMS_impl__create_single_interval_probe( char *nameStr, SlaveVP *animPr );
145 #define VMS__create_single_interval_probe( nameStr, animPr ) \ 132 #define VMS__create_single_interval_probe( nameStr, animPr ) \
146 0 /* do nothing */ 133 0 /* do nothing */
147 134
148 135
149 int32 136 int32
150 VMS_impl__create_histogram_probe( int32 numBins, float64 startValue, 137 VMS_impl__create_histogram_probe( int32 numBins, float64 startValue,
151 float64 binWidth, char *nameStr, VirtProcr *animPr ); 138 float64 binWidth, char *nameStr, SlaveVP *animPr );
152 #define VMS__create_histogram_probe( numBins, startValue, \ 139 #define VMS__create_histogram_probe( numBins, startValue, \
153 binWidth, nameStr, animPr ) \ 140 binWidth, nameStr, animPr ) \
154 0 /* do nothing */ 141 0 /* do nothing */
155 142
156 void 143 void
157 VMS_impl__index_probe_by_its_name( int32 probeID, VirtProcr *animPr ); 144 VMS_impl__index_probe_by_its_name( int32 probeID, SlaveVP *animPr );
158 #define VMS__index_probe_by_its_name( probeID, animPr ) \ 145 #define VMS__index_probe_by_its_name( probeID, animPr ) \
159 /* do nothing */ 146 /* do nothing */
160 147
161 IntervalProbe * 148 IntervalProbe *
162 VMS_impl__get_probe_by_name( char *probeName, VirtProcr *animPr ); 149 VMS_impl__get_probe_by_name( char *probeName, SlaveVP *animPr );
163 #define VMS__get_probe_by_name( probeID, animPr ) \ 150 #define VMS__get_probe_by_name( probeID, animPr ) \
164 NULL /* do nothing */ 151 NULL /* do nothing */
165 152
166 void 153 void
167 VMS_impl__record_sched_choice_into_probe( int32 probeID, VirtProcr *animPr ); 154 VMS_impl__record_sched_choice_into_probe( int32 probeID, SlaveVP *animPr );
168 #define VMS__record_sched_choice_into_probe( probeID, animPr ) \ 155 #define VMS__record_sched_choice_into_probe( probeID, animPr ) \
169 /* do nothing */ 156 /* do nothing */
170 157
171 void 158 void
172 VMS_impl__record_interval_start_in_probe( int32 probeID ); 159 VMS_impl__record_interval_start_in_probe( int32 probeID );