Adding error message when shmat fails - naim
[dyninst.git] / paradyn / h / performanceConsultant.I
1
2 /*
3  * Interface between the Performance Consultant and the rest of paradyn.
4  *
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.
9  *
10  * Revision 1.28  1996/05/06 04:36:59  karavan
11  * added thread globals
12  *
13  * Revision 1.27  1996/05/02 19:52:37  karavan
14  * added some class data members
15  *
16  * Revision 1.26  1996/05/01 14:04:28  naim
17  * Adding async. call to requestNodeInfoCallback to avoid deadlock between UI
18  * and PC - naim
19  *
20  * Revision 1.25  1996/04/21  21:37:18  newhall
21  * removed getPredictedDataCostCallbackPC
22  *
23  * Revision 1.24  1996/04/18  22:00:18  naim
24  * Changes to make getPredictedDataCost asynchronous - naim
25  *
26  * Revision 1.23  1996/04/07  21:20:47  karavan
27  * combined newSearch and activateSearch and got rid of newSearch.
28  *
29  * Revision 1.22  1996/03/18 07:11:12  karavan
30  * added new TC, PCcollectInstrTimings
31  *
32  * Revision 1.21  1996/02/09 20:56:11  karavan
33  * Added globalRawDataServer and currentRawDataServer to keep the new data
34  * path efficient.
35  *
36  * Revision 1.20  1996/02/09 18:01:28  karavan
37  * Changes to support phase-level searching
38  *
39  * Revision 1.19  1996/02/08 20:09:49  karavan
40  * added PC-global variables to store current TC values.
41  *
42  * Revision 1.18  1996/02/02 02:17:52  karavan
43  * Changes for new performance consultant.
44  *
45  * Revision 1.17  1996/01/09 21:43:17  tamches
46  * incremented version number to 7
47  *
48  * Revision 1.16  1996/01/09 00:45:15  tamches
49  * added phaseID argument to getNodeInfo
50  *
51  * Revision 1.15  1996/01/08 22:07:15  tamches
52  * Added igen call getNodeInof() and related struct shg_node_info
53  *
54  * Revision 1.14  1995/10/17 03:21:05  tamches
55  * (really Karen)
56  * Bumped version number from 5 to 6
57  *
58  * Revision 1.13  1995/10/17 03:11:54  tamches
59  * (really Karen)
60  * Added endSearch() igen call
61  *
62  * Revision 1.12  1995/10/05 04:48:24  karavan
63  * changes to support multiple searches, one per phase.
64  *
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
71  *      these structures.
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.
75  *
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.
79  *
80  * Revision 1.9  1994/09/22  00:45:15  markc
81  * Made array declarations explicit
82  * Incremented version number
83  *
84  * Revision 1.8  1994/08/17  17:55:29  markc
85  * Incremented version numbers because a new version of igen has been
86  * committed.
87  *
88  * Revision 1.7  1994/05/09  20:53:36  hollings
89  * added changeState to dataManager, and clearSHG to performanceConsultant.
90  *
91  * Revision 1.6  1994/05/06  06:50:45  karavan
92  * added startSHG().
93  *
94  * Revision 1.5  1994/05/02  20:36:50  hollings
95  * Added pause and shg get node routines.
96  *
97  * Revision 1.4  1994/04/27  22:54:52  hollings
98  * Merged refine auto and search.
99  *
100  * Revision 1.3  1994/04/21  05:01:21  karavan
101  * changed search and autoRefine to async to avoid deadlock with UIM.
102  *
103  * Revision 1.2  1994/02/02  00:43:20  hollings
104  * Added Auto Refinement options.
105  *
106  * Revision 1.1  1994/02/01  18:47:35  hollings
107  * Upgrades for performanceConsultant thread.
108  *
109  */
110 #include "dataManager.thread.h"
111
112 //
113 // Forward decl of classes that are passed out the interface.
114 //
115 class searchHistoryNode;
116 class filteredDataServer;
117 class PCmetricInstServer;
118
119 typedef struct int_Array {
120   int count;
121   int *data;
122 } int_Array;
123
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 {
127    string why;
128    string where;
129    bool currentConclusion;
130    timeStamp timeTrueFalse;
131    sampleValue currentValue;
132    timeStamp startTime;
133    timeStamp endTime;
134    sampleValue estimatedCost;
135    bool persistent;
136 };
137
138 $remote performanceConsultant {
139     $base 6000;
140     $version 18;
141
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);
148
149     // stop the automated search process in its tracks.
150     $async void pauseSearch(unsigned phaseID);
151
152     // Completely terminate a search; remove all instrumentation.
153     $async void endSearch(unsigned phaseID);
154
155     // DM tells the PC the new value for predicted data cost
156     // $async void getPredictedDataCostCallbackPC(int dummy,float val);
157
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);
161
162     $signore
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;
174     // other PC-globals
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;
185     $signore    
186 };