view 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
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 _GNU_SOURCE
13 #include "VMS_primitive_data_types.h"
15 #include <sys/time.h>
17 /*Note on order of include files:
18 * This file relies on #defines that appear in other files..
19 */
22 //typedef struct _IntervalProbe IntervalProbe; //in VMS.h
24 struct _IntervalProbe
25 {
26 char *nameStr;
27 int32 probeID;
29 int32 schedChoiceWasRecorded;
30 int32 coreNum;
31 int32 slaveID;
32 float64 slaveCreateSecs;
34 // #ifdef STATS__USE_TSC_PROBES
35 TSCount startStamp;
36 TSCount endStamp;
37 // #else
38 // struct timeval startStamp;
39 // struct timeval endStamp;
40 // #endif
41 float64 startSecs;
42 float64 endSecs;
43 float64 interval;
44 DblHist *hist;//if NULL, then is single interval probe
45 };
48 int32
49 VMS_impl__create_single_interval_probe( char *nameStr, SlaveVP *animSlv );
51 int32
52 VMS_impl__create_histogram_probe( int32 numBins, float64 startValue,
53 float64 binWidth, char *nameStr, SlaveVP *animSlv );
55 int32
56 VMS_impl__record_time_point_into_new_probe( char *nameStr, SlaveVP *animSlv);
58 int32
59 VMS_ext_impl__record_time_point_into_new_probe( char *nameStr );
61 void
62 VMS_impl__free_probe( IntervalProbe *probe );
64 void
65 VMS_impl__index_probe_by_its_name( int32 probeID, SlaveVP *animSlv );
67 IntervalProbe *
68 VMS_impl__get_probe_by_name( char *probeName, SlaveVP *animSlv );
70 void
71 VMS_impl__record_sched_choice_into_probe( int32 probeID, SlaveVP *animSlv );
73 void
74 VMS_impl__record_interval_start_in_probe( int32 probeID );
76 void
77 VMS_impl__record_interval_end_in_probe( int32 probeID );
79 void
80 VMS_impl__print_stats_of_probe( int32 probeID );
82 void
83 VMS_impl__print_stats_of_all_probes();
86 //======================== Probes =============================
87 //
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
103 #ifdef STATS__ENABLE_PROBES
104 #define VMS_WL__record_time_point_into_new_probe( nameStr, animSlv ) \
105 VMS_impl__record_time_point_in_new_probe( nameStr, animSlv )
107 #define VMS_ext__record_time_point_into_new_probe( nameStr ) \
108 VMS_ext_impl__record_time_point_into_new_probe( nameStr )
110 #define VMS_WL__create_single_interval_probe( nameStr, animSlv ) \
111 VMS_impl__create_single_interval_probe( nameStr, animSlv )
113 #define VMS_WL__create_histogram_probe( numBins, startValue, \
114 binWidth, nameStr, animSlv ) \
115 VMS_impl__create_histogram_probe( numBins, startValue, \
116 binWidth, nameStr, animSlv )
117 #define VMS_int__free_probe( probe ) \
118 VMS_impl__free_probe( probe )
120 #define VMS_WL__index_probe_by_its_name( probeID, animSlv ) \
121 VMS_impl__index_probe_by_its_name( probeID, animSlv )
123 #define VMS_WL__get_probe_by_name( probeID, animSlv ) \
124 VMS_impl__get_probe_by_name( probeName, animSlv )
126 #define VMS_WL__record_sched_choice_into_probe( probeID, animSlv ) \
127 VMS_impl__record_sched_choice_into_probe( probeID, animSlv )
129 #define VMS_WL__record_interval_start_in_probe( probeID ) \
130 VMS_impl__record_interval_start_in_probe( probeID )
132 #define VMS_WL__record_interval_end_in_probe( probeID ) \
133 VMS_impl__record_interval_end_in_probe( probeID )
135 #define VMS_WL__print_stats_of_probe( probeID ) \
136 VMS_impl__print_stats_of_probe( probeID )
138 #define VMS_WL__print_stats_of_all_probes() \
139 VMS_impl__print_stats_of_all_probes()
142 #else
143 #define VMS_WL__record_time_point_into_new_probe( nameStr, animSlv ) \
144 0 /* do nothing */
146 #define VMS_ext__record_time_point_into_new_probe( nameStr ) \
147 0 /* do nothing */
150 #define VMS_WL__create_single_interval_probe( nameStr, animSlv ) \
151 0 /* do nothing */
154 #define VMS_WL__create_histogram_probe( numBins, startValue, \
155 binWidth, nameStr, animSlv ) \
156 0 /* do nothing */
158 #define VMS_WL__index_probe_by_its_name( probeID, animSlv ) \
159 /* do nothing */
161 #define VMS_WL__get_probe_by_name( probeID, animSlv ) \
162 NULL /* do nothing */
164 #define VMS_WL__record_sched_choice_into_probe( probeID, animSlv ) \
165 /* do nothing */
167 #define VMS_WL__record_interval_start_in_probe( probeID ) \
168 /* do nothing */
170 #define VMS_WL__record_interval_end_in_probe( probeID ) \
171 /* do nothing */
173 #define VMS_WL__print_stats_of_probe( probeID ) \
174 ; /* do nothing */
176 #define VMS_WL__print_stats_of_all_probes() \
177 ;/* do nothing */
179 #endif /* defined STATS__ENABLE_PROBES */
181 #endif /* _PROBES_H */