annotate probes.h @ 208:eaf7e4c58c9e

Create common_ancestor brch -- all branches will be closed, then new ones created with this as the common ancestor of all branches -- it is incomplete! only code that is common to all HW and Feat and FeatDev branches is in here
author Some Random Person <seanhalle@yahoo.com>
date Wed, 22 Feb 2012 11:39:12 -0800
parents
children 0c83ea8adefc
rev   line source
seanhalle@208 1 /*
seanhalle@208 2 * Copyright 2009 OpenSourceStewardshipFoundation.org
seanhalle@208 3 * Licensed under GNU General Public License version 2
seanhalle@208 4 *
seanhalle@208 5 * Author: seanhalle@yahoo.com
seanhalle@208 6 *
seanhalle@208 7 */
seanhalle@208 8
seanhalle@208 9 #ifndef _PROBES_H
seanhalle@208 10 #define _PROBES_H
seanhalle@208 11 #define _GNU_SOURCE
seanhalle@208 12
seanhalle@208 13 #include "VMS_primitive_data_types.h"
seanhalle@208 14
seanhalle@208 15 #include <sys/time.h>
seanhalle@208 16
seanhalle@208 17 /*Note on order of include files:
seanhalle@208 18 * This file relies on #defines that appear in other files..
seanhalle@208 19 */
seanhalle@208 20
seanhalle@208 21
seanhalle@208 22 //typedef struct _IntervalProbe IntervalProbe; //in VMS.h
seanhalle@208 23
seanhalle@208 24 struct _IntervalProbe
seanhalle@208 25 {
seanhalle@208 26 char *nameStr;
seanhalle@208 27 int32 probeID;
seanhalle@208 28
seanhalle@208 29 int32 schedChoiceWasRecorded;
seanhalle@208 30 int32 coreNum;
seanhalle@208 31 int32 procrID;
seanhalle@208 32 float64 procrCreateSecs;
seanhalle@208 33
seanhalle@208 34 #ifdef STATS__USE_TSC_PROBES
seanhalle@208 35 TSCount startStamp;
seanhalle@208 36 TSCount endStamp;
seanhalle@208 37 #else
seanhalle@208 38 struct timeval startStamp;
seanhalle@208 39 struct timeval endStamp;
seanhalle@208 40 #endif
seanhalle@208 41 float64 startSecs;
seanhalle@208 42 float64 endSecs;
seanhalle@208 43 float64 interval;
seanhalle@208 44 DblHist *hist;//if NULL, then is single interval probe
seanhalle@208 45 };
seanhalle@208 46
seanhalle@208 47
seanhalle@208 48
seanhalle@208 49 //======================== Probes =============================
seanhalle@208 50 //
seanhalle@208 51 // Use macros to allow turning probes off with a #define switch
seanhalle@208 52 #ifdef STATS__ENABLE_PROBES
seanhalle@208 53 int32
seanhalle@208 54 VMS_impl__record_time_point_into_new_probe( char *nameStr,SlaveVP *animPr);
seanhalle@208 55 #define VMS__record_time_point_into_new_probe( nameStr, animPr ) \
seanhalle@208 56 VMS_impl__record_time_point_in_new_probe( nameStr, animPr )
seanhalle@208 57
seanhalle@208 58 int32
seanhalle@208 59 VMS_ext_impl__record_time_point_into_new_probe( char *nameStr );
seanhalle@208 60 #define VMS_ext__record_time_point_into_new_probe( nameStr ) \
seanhalle@208 61 VMS_ext_impl__record_time_point_into_new_probe( nameStr )
seanhalle@208 62
seanhalle@208 63
seanhalle@208 64 int32
seanhalle@208 65 VMS_impl__create_single_interval_probe( char *nameStr, SlaveVP *animPr );
seanhalle@208 66 #define VMS__create_single_interval_probe( nameStr, animPr ) \
seanhalle@208 67 VMS_impl__create_single_interval_probe( nameStr, animPr )
seanhalle@208 68
seanhalle@208 69
seanhalle@208 70 int32
seanhalle@208 71 VMS_impl__create_histogram_probe( int32 numBins, float64 startValue,
seanhalle@208 72 float64 binWidth, char *nameStr, SlaveVP *animPr );
seanhalle@208 73 #define VMS__create_histogram_probe( numBins, startValue, \
seanhalle@208 74 binWidth, nameStr, animPr ) \
seanhalle@208 75 VMS_impl__create_histogram_probe( numBins, startValue, \
seanhalle@208 76 binWidth, nameStr, animPr )
seanhalle@208 77 void
seanhalle@208 78 VMS_impl__free_probe( IntervalProbe *probe );
seanhalle@208 79 #define VMS__free_probe( probe ) \
seanhalle@208 80 VMS_impl__free_probe( probe )
seanhalle@208 81
seanhalle@208 82 void
seanhalle@208 83 VMS_impl__index_probe_by_its_name( int32 probeID, SlaveVP *animPr );
seanhalle@208 84 #define VMS__index_probe_by_its_name( probeID, animPr ) \
seanhalle@208 85 VMS_impl__index_probe_by_its_name( probeID, animPr )
seanhalle@208 86
seanhalle@208 87 IntervalProbe *
seanhalle@208 88 VMS_impl__get_probe_by_name( char *probeName, SlaveVP *animPr );
seanhalle@208 89 #define VMS__get_probe_by_name( probeID, animPr ) \
seanhalle@208 90 VMS_impl__get_probe_by_name( probeName, animPr )
seanhalle@208 91
seanhalle@208 92 void
seanhalle@208 93 VMS_impl__record_sched_choice_into_probe( int32 probeID, SlaveVP *animPr );
seanhalle@208 94 #define VMS__record_sched_choice_into_probe( probeID, animPr ) \
seanhalle@208 95 VMS_impl__record_sched_choice_into_probe( probeID, animPr )
seanhalle@208 96
seanhalle@208 97 void
seanhalle@208 98 VMS_impl__record_interval_start_in_probe( int32 probeID );
seanhalle@208 99 #define VMS__record_interval_start_in_probe( probeID ) \
seanhalle@208 100 VMS_impl__record_interval_start_in_probe( probeID )
seanhalle@208 101
seanhalle@208 102 void
seanhalle@208 103 VMS_impl__record_interval_end_in_probe( int32 probeID );
seanhalle@208 104 #define VMS__record_interval_end_in_probe( probeID ) \
seanhalle@208 105 VMS_impl__record_interval_end_in_probe( probeID )
seanhalle@208 106
seanhalle@208 107 void
seanhalle@208 108 VMS_impl__print_stats_of_probe( int32 probeID );
seanhalle@208 109 #define VMS__print_stats_of_probe( probeID ) \
seanhalle@208 110 VMS_impl__print_stats_of_probe( probeID )
seanhalle@208 111
seanhalle@208 112 void
seanhalle@208 113 VMS_impl__print_stats_of_all_probes();
seanhalle@208 114 #define VMS__print_stats_of_all_probes() \
seanhalle@208 115 VMS_impl__print_stats_of_all_probes()
seanhalle@208 116
seanhalle@208 117
seanhalle@208 118 #else
seanhalle@208 119 int32
seanhalle@208 120 VMS_impl__record_time_point_into_new_probe( char *nameStr,SlaveVP *animPr);
seanhalle@208 121 #define VMS__record_time_point_into_new_probe( nameStr, animPr ) \
seanhalle@208 122 0 /* do nothing */
seanhalle@208 123
seanhalle@208 124 int32
seanhalle@208 125 VMS_ext_impl__record_time_point_into_new_probe( char *nameStr );
seanhalle@208 126 #define VMS_ext__record_time_point_into_new_probe( nameStr ) \
seanhalle@208 127 0 /* do nothing */
seanhalle@208 128
seanhalle@208 129
seanhalle@208 130 int32
seanhalle@208 131 VMS_impl__create_single_interval_probe( char *nameStr, SlaveVP *animPr );
seanhalle@208 132 #define VMS__create_single_interval_probe( nameStr, animPr ) \
seanhalle@208 133 0 /* do nothing */
seanhalle@208 134
seanhalle@208 135
seanhalle@208 136 int32
seanhalle@208 137 VMS_impl__create_histogram_probe( int32 numBins, float64 startValue,
seanhalle@208 138 float64 binWidth, char *nameStr, SlaveVP *animPr );
seanhalle@208 139 #define VMS__create_histogram_probe( numBins, startValue, \
seanhalle@208 140 binWidth, nameStr, animPr ) \
seanhalle@208 141 0 /* do nothing */
seanhalle@208 142
seanhalle@208 143 void
seanhalle@208 144 VMS_impl__index_probe_by_its_name( int32 probeID, SlaveVP *animPr );
seanhalle@208 145 #define VMS__index_probe_by_its_name( probeID, animPr ) \
seanhalle@208 146 /* do nothing */
seanhalle@208 147
seanhalle@208 148 IntervalProbe *
seanhalle@208 149 VMS_impl__get_probe_by_name( char *probeName, SlaveVP *animPr );
seanhalle@208 150 #define VMS__get_probe_by_name( probeID, animPr ) \
seanhalle@208 151 NULL /* do nothing */
seanhalle@208 152
seanhalle@208 153 void
seanhalle@208 154 VMS_impl__record_sched_choice_into_probe( int32 probeID, SlaveVP *animPr );
seanhalle@208 155 #define VMS__record_sched_choice_into_probe( probeID, animPr ) \
seanhalle@208 156 /* do nothing */
seanhalle@208 157
seanhalle@208 158 void
seanhalle@208 159 VMS_impl__record_interval_start_in_probe( int32 probeID );
seanhalle@208 160 #define VMS__record_interval_start_in_probe( probeID ) \
seanhalle@208 161 /* do nothing */
seanhalle@208 162
seanhalle@208 163 void
seanhalle@208 164 VMS_impl__record_interval_end_in_probe( int32 probeID );
seanhalle@208 165 #define VMS__record_interval_end_in_probe( probeID ) \
seanhalle@208 166 /* do nothing */
seanhalle@208 167
seanhalle@208 168 inline void doNothing();
seanhalle@208 169 void
seanhalle@208 170 VMS_impl__print_stats_of_probe( int32 probeID );
seanhalle@208 171 #define VMS__print_stats_of_probe( probeID ) \
seanhalle@208 172 doNothing/* do nothing */
seanhalle@208 173
seanhalle@208 174 void
seanhalle@208 175 VMS_impl__print_stats_of_all_probes();
seanhalle@208 176 #define VMS__print_stats_of_all_probes \
seanhalle@208 177 doNothing/* do nothing */
seanhalle@208 178
seanhalle@208 179 #endif /* defined STATS__ENABLE_PROBES */
seanhalle@208 180
seanhalle@208 181 #endif /* _PROBES_H */
seanhalle@208 182