Mercurial > cgi-bin > hgwebdir.cgi > VMS > VMS_Implementations > VMS_impls > VMS__MC_shared_impl
diff 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 |
line diff
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/probes.h Wed Feb 22 11:39:12 2012 -0800 1.3 @@ -0,0 +1,182 @@ 1.4 +/* 1.5 + * Copyright 2009 OpenSourceStewardshipFoundation.org 1.6 + * Licensed under GNU General Public License version 2 1.7 + * 1.8 + * Author: seanhalle@yahoo.com 1.9 + * 1.10 + */ 1.11 + 1.12 +#ifndef _PROBES_H 1.13 +#define _PROBES_H 1.14 +#define _GNU_SOURCE 1.15 + 1.16 +#include "VMS_primitive_data_types.h" 1.17 + 1.18 +#include <sys/time.h> 1.19 + 1.20 +/*Note on order of include files: 1.21 + * This file relies on #defines that appear in other files.. 1.22 + */ 1.23 + 1.24 + 1.25 +//typedef struct _IntervalProbe IntervalProbe; //in VMS.h 1.26 + 1.27 +struct _IntervalProbe 1.28 + { 1.29 + char *nameStr; 1.30 + int32 probeID; 1.31 + 1.32 + int32 schedChoiceWasRecorded; 1.33 + int32 coreNum; 1.34 + int32 procrID; 1.35 + float64 procrCreateSecs; 1.36 + 1.37 + #ifdef STATS__USE_TSC_PROBES 1.38 + TSCount startStamp; 1.39 + TSCount endStamp; 1.40 + #else 1.41 + struct timeval startStamp; 1.42 + struct timeval endStamp; 1.43 + #endif 1.44 + float64 startSecs; 1.45 + float64 endSecs; 1.46 + float64 interval; 1.47 + DblHist *hist;//if NULL, then is single interval probe 1.48 + }; 1.49 + 1.50 + 1.51 + 1.52 +//======================== Probes ============================= 1.53 +// 1.54 +// Use macros to allow turning probes off with a #define switch 1.55 +#ifdef STATS__ENABLE_PROBES 1.56 +int32 1.57 +VMS_impl__record_time_point_into_new_probe( char *nameStr,SlaveVP *animPr); 1.58 +#define VMS__record_time_point_into_new_probe( nameStr, animPr ) \ 1.59 + VMS_impl__record_time_point_in_new_probe( nameStr, animPr ) 1.60 + 1.61 +int32 1.62 +VMS_ext_impl__record_time_point_into_new_probe( char *nameStr ); 1.63 +#define VMS_ext__record_time_point_into_new_probe( nameStr ) \ 1.64 + VMS_ext_impl__record_time_point_into_new_probe( nameStr ) 1.65 + 1.66 + 1.67 +int32 1.68 +VMS_impl__create_single_interval_probe( char *nameStr, SlaveVP *animPr ); 1.69 +#define VMS__create_single_interval_probe( nameStr, animPr ) \ 1.70 + VMS_impl__create_single_interval_probe( nameStr, animPr ) 1.71 + 1.72 + 1.73 +int32 1.74 +VMS_impl__create_histogram_probe( int32 numBins, float64 startValue, 1.75 + float64 binWidth, char *nameStr, SlaveVP *animPr ); 1.76 +#define VMS__create_histogram_probe( numBins, startValue, \ 1.77 + binWidth, nameStr, animPr ) \ 1.78 + VMS_impl__create_histogram_probe( numBins, startValue, \ 1.79 + binWidth, nameStr, animPr ) 1.80 +void 1.81 +VMS_impl__free_probe( IntervalProbe *probe ); 1.82 +#define VMS__free_probe( probe ) \ 1.83 + VMS_impl__free_probe( probe ) 1.84 + 1.85 +void 1.86 +VMS_impl__index_probe_by_its_name( int32 probeID, SlaveVP *animPr ); 1.87 +#define VMS__index_probe_by_its_name( probeID, animPr ) \ 1.88 + VMS_impl__index_probe_by_its_name( probeID, animPr ) 1.89 + 1.90 +IntervalProbe * 1.91 +VMS_impl__get_probe_by_name( char *probeName, SlaveVP *animPr ); 1.92 +#define VMS__get_probe_by_name( probeID, animPr ) \ 1.93 + VMS_impl__get_probe_by_name( probeName, animPr ) 1.94 + 1.95 +void 1.96 +VMS_impl__record_sched_choice_into_probe( int32 probeID, SlaveVP *animPr ); 1.97 +#define VMS__record_sched_choice_into_probe( probeID, animPr ) \ 1.98 + VMS_impl__record_sched_choice_into_probe( probeID, animPr ) 1.99 + 1.100 +void 1.101 +VMS_impl__record_interval_start_in_probe( int32 probeID ); 1.102 +#define VMS__record_interval_start_in_probe( probeID ) \ 1.103 + VMS_impl__record_interval_start_in_probe( probeID ) 1.104 + 1.105 +void 1.106 +VMS_impl__record_interval_end_in_probe( int32 probeID ); 1.107 +#define VMS__record_interval_end_in_probe( probeID ) \ 1.108 + VMS_impl__record_interval_end_in_probe( probeID ) 1.109 + 1.110 +void 1.111 +VMS_impl__print_stats_of_probe( int32 probeID ); 1.112 +#define VMS__print_stats_of_probe( probeID ) \ 1.113 + VMS_impl__print_stats_of_probe( probeID ) 1.114 + 1.115 +void 1.116 +VMS_impl__print_stats_of_all_probes(); 1.117 +#define VMS__print_stats_of_all_probes() \ 1.118 + VMS_impl__print_stats_of_all_probes() 1.119 + 1.120 + 1.121 +#else 1.122 +int32 1.123 +VMS_impl__record_time_point_into_new_probe( char *nameStr,SlaveVP *animPr); 1.124 +#define VMS__record_time_point_into_new_probe( nameStr, animPr ) \ 1.125 + 0 /* do nothing */ 1.126 + 1.127 +int32 1.128 +VMS_ext_impl__record_time_point_into_new_probe( char *nameStr ); 1.129 +#define VMS_ext__record_time_point_into_new_probe( nameStr ) \ 1.130 + 0 /* do nothing */ 1.131 + 1.132 + 1.133 +int32 1.134 +VMS_impl__create_single_interval_probe( char *nameStr, SlaveVP *animPr ); 1.135 +#define VMS__create_single_interval_probe( nameStr, animPr ) \ 1.136 + 0 /* do nothing */ 1.137 + 1.138 + 1.139 +int32 1.140 +VMS_impl__create_histogram_probe( int32 numBins, float64 startValue, 1.141 + float64 binWidth, char *nameStr, SlaveVP *animPr ); 1.142 +#define VMS__create_histogram_probe( numBins, startValue, \ 1.143 + binWidth, nameStr, animPr ) \ 1.144 + 0 /* do nothing */ 1.145 + 1.146 +void 1.147 +VMS_impl__index_probe_by_its_name( int32 probeID, SlaveVP *animPr ); 1.148 +#define VMS__index_probe_by_its_name( probeID, animPr ) \ 1.149 + /* do nothing */ 1.150 + 1.151 +IntervalProbe * 1.152 +VMS_impl__get_probe_by_name( char *probeName, SlaveVP *animPr ); 1.153 +#define VMS__get_probe_by_name( probeID, animPr ) \ 1.154 + NULL /* do nothing */ 1.155 + 1.156 +void 1.157 +VMS_impl__record_sched_choice_into_probe( int32 probeID, SlaveVP *animPr ); 1.158 +#define VMS__record_sched_choice_into_probe( probeID, animPr ) \ 1.159 + /* do nothing */ 1.160 + 1.161 +void 1.162 +VMS_impl__record_interval_start_in_probe( int32 probeID ); 1.163 +#define VMS__record_interval_start_in_probe( probeID ) \ 1.164 + /* do nothing */ 1.165 + 1.166 +void 1.167 +VMS_impl__record_interval_end_in_probe( int32 probeID ); 1.168 +#define VMS__record_interval_end_in_probe( probeID ) \ 1.169 + /* do nothing */ 1.170 + 1.171 +inline void doNothing(); 1.172 +void 1.173 +VMS_impl__print_stats_of_probe( int32 probeID ); 1.174 +#define VMS__print_stats_of_probe( probeID ) \ 1.175 + doNothing/* do nothing */ 1.176 + 1.177 +void 1.178 +VMS_impl__print_stats_of_all_probes(); 1.179 +#define VMS__print_stats_of_all_probes \ 1.180 + doNothing/* do nothing */ 1.181 + 1.182 +#endif /* defined STATS__ENABLE_PROBES */ 1.183 + 1.184 +#endif /* _PROBES_H */ 1.185 +
