Mercurial > cgi-bin > hgwebdir.cgi > VMS > VMS_Implementations > VMS_impls > VMS__MC_shared_impl
view probes.h @ 52:f59cfa31a579
fixed up probes just a bit
| author | Me |
|---|---|
| date | Sat, 30 Oct 2010 21:53:55 -0700 |
| parents | 8f7141a9272e |
| children | 42dd44df1bb0 |
line source
1 /*
2 * Copyright 2009 OpenSourceStewardshipFoundation.org
3 * Licensed under GNU General Public License version 2
4 *
5 * Author: seanhalle@yahoo.com
6 *
7 */
9 #ifndef _PROBES_H
10 #define _PROBES_H
11 #define __USE_GNU
13 #include "VMS_primitive_data_types.h"
15 #include <sys/time.h>
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
27 //typedef struct _IntervalProbe IntervalProbe; //in VMS.h
29 struct _IntervalProbe
30 {
31 char *nameStr;
32 int32 probeID;
34 int32 schedChoiceWasRecorded;
35 int32 coreNum;
36 int32 procrID;
37 float64 procrCreateSecs;
39 #ifdef STATS__USE_TSC_PROBES
40 TSCount startStamp;
41 TSCount endStamp;
42 #else
43 struct timeval startStamp;
44 struct timeval endStamp;
45 #endif
46 float64 startSecs;
47 float64 endSecs;
48 float64 interval;
49 DblHist *hist;//if NULL, then is single interval probe
50 };
53 //============================= Statistics ==================================
55 //Frequency of TS counts
56 //TODO: change freq for each machine
57 #define TSCOUNT_FREQ 3180000000
59 inline TSCount getTSCount();
62 //======================== Probes =============================
63 //
64 // Use macros to allow turning probes off with a #define switch
65 #ifdef STATS__ENABLE_PROBES
66 int32
67 VMS_impl__record_time_point_into_new_probe( char *nameStr,VirtProcr *animPr);
68 #define VMS__record_time_point_into_new_probe( nameStr, animPr ) \
69 VMS_impl__record_time_point_in_new_probe( nameStr, animPr )
71 int32
72 VMS_ext_impl__record_time_point_into_new_probe( char *nameStr );
73 #define VMS_ext__record_time_point_into_new_probe( nameStr ) \
74 VMS_ext_impl__record_time_point_into_new_probe( nameStr )
77 int32
78 VMS_impl__create_single_interval_probe( char *nameStr, VirtProcr *animPr );
79 #define VMS__create_single_interval_probe( nameStr, animPr ) \
80 VMS_impl__create_single_interval_probe( nameStr, animPr )
83 int32
84 VMS_impl__create_histogram_probe( int32 numBins, float64 startValue,
85 float64 binWidth, char *nameStr, VirtProcr *animPr );
86 #define VMS__create_histogram_probe( numBins, startValue, \
87 binWidth, nameStr, animPr ) \
88 VMS_impl__create_histogram_probe( numBins, startValue, \
89 binWidth, nameStr, animPr )
91 void
92 VMS_impl__index_probe_by_its_name( int32 probeID, VirtProcr *animPr );
93 #define VMS__index_probe_by_its_name( probeID, animPr ) \
94 VMS_impl__index_probe_by_its_name( probeID, animPr )
96 IntervalProbe *
97 VMS_impl__get_probe_by_name( char *probeName, VirtProcr *animPr );
98 #define VMS__get_probe_by_name( probeID, animPr ) \
99 VMS_impl__get_probe_by_name( probeName, animPr )
101 void
102 VMS_impl__record_sched_choice_into_probe( int32 probeID, VirtProcr *animPr );
103 #define VMS__record_sched_choice_into_probe( probeID, animPr ) \
104 VMS_impl__record_sched_choice_into_probe( probeID, animPr )
106 void
107 VMS_impl__record_interval_start_in_probe( int32 probeID );
108 #define VMS__record_interval_start_in_probe( probeID ) \
109 VMS_impl__record_interval_start_in_probe( probeID )
111 void
112 VMS_impl__record_interval_end_in_probe( int32 probeID );
113 #define VMS__record_interval_end_in_probe( probeID ) \
114 VMS_impl__record_interval_end_in_probe( probeID )
116 void
117 VMS_impl__print_stats_of_probe( int32 probeID );
118 #define VMS__print_stats_of_probe( probeID ) \
119 VMS_impl__print_stats_of_probe( probeID )
121 void
122 VMS_impl__print_stats_of_all_probes();
123 #define VMS__print_stats_of_all_probes \
124 VMS_impl__print_stats_of_all_probes
127 #else
128 int32
129 VMS_impl__record_time_point_into_new_probe( char *nameStr,VirtProcr *animPr);
130 #define VMS__record_time_point_into_new_probe( nameStr, animPr ) \
131 0 /* do nothing */
133 int32
134 VMS_ext_impl__record_time_point_into_new_probe( char *nameStr, VirtProcr *animPr);
135 #define VMS_ext__record_time_point_into_new_probe( nameStr ) \
136 0 /* do nothing */
139 int32
140 VMS_impl__create_single_interval_probe( char *nameStr, VirtProcr *animPr );
141 #define VMS__create_single_interval_probe( nameStr, animPr ) \
142 0 /* do nothing */
145 int32
146 VMS_impl__create_histogram_probe( int32 numBins, float64 startValue,
147 float64 binWidth, char *nameStr, VirtProcr *animPr );
148 #define VMS__create_histogram_probe( numBins, startValue, \
149 binWidth, nameStr, animPr ) \
150 0 /* do nothing */
152 void
153 VMS_impl__index_probe_by_its_name( int32 probeID, VirtProcr *animPr );
154 #define VMS__index_probe_by_its_name( probeID, animPr ) \
155 /* do nothing */
157 IntervalProbe *
158 VMS_impl__get_probe_by_name( char *probeName, VirtProcr *animPr );
159 #define VMS__get_probe_by_name( probeID, animPr ) \
160 NULL /* do nothing */
162 void
163 VMS_impl__record_sched_choice_into_probe( int32 probeID, VirtProcr *animPr );
164 #define VMS__record_sched_choice_into_probe( probeID, animPr ) \
165 /* do nothing */
167 void
168 VMS_impl__record_interval_start_in_probe( int32 probeID );
169 #define VMS__record_interval_start_in_probe( probeID ) \
170 /* do nothing */
172 void
173 VMS_impl__record_interval_end_in_probe( int32 probeID );
174 #define VMS__record_interval_end_in_probe( probeID ) \
175 /* do nothing */
177 void
178 VMS_impl__print_stats_of_probe( int32 probeID );
179 #define VMS__print_stats_of_probe( probeID ) \
180 /* do nothing */
182 void
183 VMS_impl__print_stats_of_all_probes();
184 #define VMS__print_stats_of_all_probes \
185 /* do nothing */
187 #endif /* defined STATS__ENABLE_PROBES */
189 #endif /* _PROBES_H */
