3 * Interface between the Performance Consultant and the rest of paradyn.
5 * $Log: performanceConsultant.I,v $
6 * Revision 1.29 1996/07/26 07:25:49 karavan
7 * added global performanceConsultant::numMetrics which is used to
8 * size some filteredDataServer data structures.
10 * Revision 1.28 1996/05/06 04:36:59 karavan
11 * added thread globals
13 * Revision 1.27 1996/05/02 19:52:37 karavan
14 * added some class data members
16 * Revision 1.26 1996/05/01 14:04:28 naim
17 * Adding async. call to requestNodeInfoCallback to avoid deadlock between UI
20 * Revision 1.25 1996/04/21 21:37:18 newhall
21 * removed getPredictedDataCostCallbackPC
23 * Revision 1.24 1996/04/18 22:00:18 naim
24 * Changes to make getPredictedDataCost asynchronous - naim
26 * Revision 1.23 1996/04/07 21:20:47 karavan
27 * combined newSearch and activateSearch and got rid of newSearch.
29 * Revision 1.22 1996/03/18 07:11:12 karavan
30 * added new TC, PCcollectInstrTimings
32 * Revision 1.21 1996/02/09 20:56:11 karavan
33 * Added globalRawDataServer and currentRawDataServer to keep the new data
36 * Revision 1.20 1996/02/09 18:01:28 karavan
37 * Changes to support phase-level searching
39 * Revision 1.19 1996/02/08 20:09:49 karavan
40 * added PC-global variables to store current TC values.
42 * Revision 1.18 1996/02/02 02:17:52 karavan
43 * Changes for new performance consultant.
45 * Revision 1.17 1996/01/09 21:43:17 tamches
46 * incremented version number to 7
48 * Revision 1.16 1996/01/09 00:45:15 tamches
49 * added phaseID argument to getNodeInfo
51 * Revision 1.15 1996/01/08 22:07:15 tamches
52 * Added igen call getNodeInof() and related struct shg_node_info
54 * Revision 1.14 1995/10/17 03:21:05 tamches
56 * Bumped version number from 5 to 6
58 * Revision 1.13 1995/10/17 03:11:54 tamches
60 * Added endSearch() igen call
62 * Revision 1.12 1995/10/05 04:48:24 karavan
63 * changes to support multiple searches, one per phase.
65 * Revision 1.11 1995/02/16 08:01:45 markc
66 * Modified interfaces:
67 * 1) XDR interfaces use strings and vectors instead of igen arrays and char*'s
68 * 2) No sync upcalls are allowed by the server in xdr interfaces
69 * 3) Redefined igen arrays that were used in thread code to use manually defined
70 * structures rather than igen-defined, since igen did not need to know about
72 * 4) Upped all of the version numbers since all new interface code is generated
73 * 5) Async calls are no longer handled while waiting for sync responses, these
74 * requests are buffered.
76 * Revision 1.10 1995/01/26 17:59:31 jcargill
77 * Changed igen-generated include files to new naming convention; fixed
78 * some bugs compiling with gcc-2.6.3.
80 * Revision 1.9 1994/09/22 00:45:15 markc
81 * Made array declarations explicit
82 * Incremented version number
84 * Revision 1.8 1994/08/17 17:55:29 markc
85 * Incremented version numbers because a new version of igen has been
88 * Revision 1.7 1994/05/09 20:53:36 hollings
89 * added changeState to dataManager, and clearSHG to performanceConsultant.
91 * Revision 1.6 1994/05/06 06:50:45 karavan
94 * Revision 1.5 1994/05/02 20:36:50 hollings
95 * Added pause and shg get node routines.
97 * Revision 1.4 1994/04/27 22:54:52 hollings
98 * Merged refine auto and search.
100 * Revision 1.3 1994/04/21 05:01:21 karavan
101 * changed search and autoRefine to async to avoid deadlock with UIM.
103 * Revision 1.2 1994/02/02 00:43:20 hollings
104 * Added Auto Refinement options.
106 * Revision 1.1 1994/02/01 18:47:35 hollings
107 * Upgrades for performanceConsultant thread.
110 #include "dataManager.thread.h"
113 // Forward decl of classes that are passed out the interface.
115 class searchHistoryNode;
116 class filteredDataServer;
117 class PCmetricInstServer;
119 typedef struct int_Array {
124 // Note: the following structure (used by the "getNodeInfo" igen call) is
125 // subject to fairly frequent change, as we thing of more goodies.
126 struct shg_node_info {
129 bool currentConclusion;
130 timeStamp timeTrueFalse;
131 sampleValue currentValue;
134 sampleValue estimatedCost;
138 $remote performanceConsultant {
142 // If search is paused, resumes search. Otherwise, performs
143 // all initialization for new search; initializes root node and
144 // messages in search display
145 // Assumes phaseID is valid, defined as: DM's phaseID plus one for
146 // current search, 0 for global search.
147 $async void activateSearch(unsigned phaseID);
149 // stop the automated search process in its tracks.
150 $async void pauseSearch(unsigned phaseID);
152 // Completely terminate a search; remove all instrumentation.
153 $async void endSearch(unsigned phaseID);
155 // DM tells the PC the new value for predicted data cost
156 // $async void getPredictedDataCostCallbackPC(int dummy,float val);
158 // Get loads of information about a node:
159 // client's responsibility to provide valid shg_node_info struct pointer
160 $async void requestNodeInfo(unsigned phaseID, int nodeID);
163 // these globals hold values updated by tunable constant callbacks
164 static float hysteresisRange;
165 static float predictedCostLimit;
166 static float minObservationTime;
167 static float sufficientTime;
168 static bool printDataTrace;
169 static bool printTestResults;
170 static bool printSearchChanges;
171 static bool printDataCollection;
172 static bool collectInstrTimings;
173 static bool useIndividualThresholds;
175 static unsigned DMcurrentPhaseToken;
176 static unsigned currentPhase;
177 static perfStreamHandle pstream;
178 static metricHandle normalMetric;
179 static bool PChyposDefined;
180 static unsigned numMetrics;
181 // for quick handling of new data
182 static filteredDataServer *globalRawDataServer;
183 static filteredDataServer *currentRawDataServer;
184 static PCmetricInstServer *globalPCMetricServer;