4 * Revision 1.15 1995/11/30 16:53:50 naim
5 * Adding bucket_width metric - naim
7 * Revision 1.14 1995/11/28 15:55:24 naim
8 * Changing metrics observed_cost, predicted_cost and pause_time back to
11 * Revision 1.13 1995/11/17 17:24:21 newhall
12 * support for MDL "unitsType" option, added normalized member to metric class
14 * Revision 1.12 1995/11/13 16:28:24 naim
15 * Making observed_cost, predicted_cost, active_processes and pause_time "normal"
16 * metrics and not "developer" mode metrics - naim
18 * Revision 1.11 1995/11/13 14:56:31 naim
19 * Making all internal metrics "developer mode" metrics - naim
21 * Revision 1.10 1995/09/26 20:28:46 naim
22 * Minor warning fixes and some other minor error messages fixes
24 * Revision 1.9 1995/07/24 03:52:34 tamches
25 * The Procedure -- > Code commit
27 * Revision 1.8 1995/05/18 10:34:38 markc
28 * Removed resource definitions
30 * Revision 1.7 1995/03/10 19:33:46 hollings
31 * Fixed several aspects realted to the cost model:
32 * track the cost of the base tramp not just mini-tramps
33 * correctly handle inst cost greater than an imm format on sparc
34 * print starts at end of pvm apps.
35 * added option to read a file with more accurate data for predicted cost.
37 * Revision 1.6 1995/02/16 08:53:12 markc
38 * Corrected error in comments -- I put a "star slash" in the comment.
40 * Revision 1.5 1995/02/16 08:33:19 markc
41 * Changed igen interfaces to use strings/vectors rather than char igen-arrays
42 * Changed igen interfaces to use bool, not Boolean.
43 * Cleaned up symbol table parsing - favor properly labeled symbol table objects
44 * Updated binary search for modules
45 * Moved machine dependnent ptrace code to architecture specific files.
46 * Moved machine dependent code out of class process.
47 * Removed almost all compiler warnings.
48 * Use "posix" like library to remove compiler warnings
50 * Revision 1.4 1994/11/10 18:57:57 jcargill
51 * The "Don't Blame Me Either" commit
53 * Revision 1.3 1994/11/09 18:40:01 rbi
54 * the "Don't Blame Me" commit
56 * Revision 1.1 1994/11/01 16:56:42 markc
57 * Environment code that is shared by all environs (pvm, cm5, sunos)
62 #include "internalMetrics.h"
69 internalMetric *activeProcs = NULL;
70 internalMetric *pauseTime = NULL;
71 internalMetric *totalPredictedCost= NULL;
72 internalMetric *hybridPredictedCost = NULL;
73 internalMetric *observed_cost = NULL;
75 internalMetric *cpu_daemon = NULL;
76 internalMetric *sys_daemon = NULL;
78 internalMetric *minflt_daemon = NULL;
79 internalMetric *majflt_daemon = NULL;
80 internalMetric *swap_daemon = NULL;
81 internalMetric *io_in_daemon = NULL;
82 internalMetric *io_out_daemon = NULL;
83 internalMetric *msg_send_daemon = NULL;
84 internalMetric *msg_recv_daemon = NULL;
85 internalMetric *sigs_daemon = NULL;
86 internalMetric *vol_csw_daemon = NULL;
87 internalMetric *inv_csw_daemon = NULL;
89 internalMetric *c_bucket_width = NULL;
90 internalMetric *g_bucket_width = NULL;
92 vector<instMapping*> initialRequests;
93 vector<sym_data> syms_to_find;
95 // In Elmer Fudd voice: "Be vewwwey vewwey careful!"
100 string hostName(un.nodename);
101 rootResource = new resource;
102 machineRoot = resource::newResource(rootResource, NULL, nullString,
104 machineResource = resource::newResource(machineRoot, NULL, nullString, hostName, 0.0, "");
105 processResource = resource::newResource(rootResource, NULL, nullString,
107 // moduleRoot = resource::newResource(rootResource, NULL, nullString,
108 // "Procedure", 0.0, "");
109 moduleRoot = resource::newResource(rootResource, NULL, nullString,
111 syncRoot = resource::newResource(rootResource, NULL, nullString,
112 "SyncObject", 0.0, "");
114 // TODO -- should these be detected and built ?
115 resource::newResource(syncRoot, NULL, nullString, "MsgTag", 0.0, "");
116 resource::newResource(syncRoot, NULL, nullString, "SpinLock", 0.0, "");
117 resource::newResource(syncRoot, NULL, nullString, "Barrier", 0.0, "");
118 resource::newResource(syncRoot, NULL, nullString, "Semaphore", 0.0, "");
120 im_pred_struct default_im_preds, obs_cost_preds;
121 default_im_preds.machine = pred_null;
122 default_im_preds.procedure = pred_invalid;
123 default_im_preds.process = pred_invalid;
124 default_im_preds.sync = pred_invalid;
126 obs_cost_preds.machine = pred_null;
127 obs_cost_preds.procedure = pred_invalid;
128 obs_cost_preds.process = pred_null;
129 obs_cost_preds.sync = pred_invalid;
131 c_bucket_width = internalMetric::newInternalMetric("c_bucket_width",
140 g_bucket_width = internalMetric::newInternalMetric("g_bucket_width",
149 totalPredictedCost = internalMetric::newInternalMetric("predicted_cost",
158 hybridPredictedCost = internalMetric::newInternalMetric("hybrid_cost",
167 observed_cost = internalMetric::newInternalMetric("observed_cost",
176 cpu_daemon = internalMetric::newInternalMetric("cpu_daemon",
180 OS::compute_rusage_cpu,
185 sys_daemon = internalMetric::newInternalMetric("sys_daemon",
189 OS::compute_rusage_sys,
194 minflt_daemon = internalMetric::newInternalMetric("min_fault_daemon",
198 OS::compute_rusage_min,
203 majflt_daemon = internalMetric::newInternalMetric("maj_fault_daemon",
207 OS::compute_rusage_maj,
212 swap_daemon = internalMetric::newInternalMetric("swap_daemon",
216 OS::compute_rusage_swap,
221 io_in_daemon = internalMetric::newInternalMetric("io_in_daemon",
225 OS::compute_rusage_io_in,
230 io_out_daemon = internalMetric::newInternalMetric("io_out_daemon",
234 OS::compute_rusage_io_out,
239 msg_send_daemon = internalMetric::newInternalMetric("msg_send_daemon",
243 OS::compute_rusage_msg_send,
248 msg_recv_daemon = internalMetric::newInternalMetric("msg_recv_daemon",
252 OS::compute_rusage_msg_recv,
257 sigs_daemon = internalMetric::newInternalMetric("signals_daemon",
261 OS::compute_rusage_sigs,
266 vol_csw_daemon = internalMetric::newInternalMetric("vol_csw_daemon",
270 OS::compute_rusage_vol_cs,
275 inv_csw_daemon = internalMetric::newInternalMetric("inv_csw_daemon",
279 OS::compute_rusage_inv_cs,
284 pauseTime = internalMetric::newInternalMetric("pause_time",
288 computePauseTimeMetric,
293 activeProcs = internalMetric::newInternalMetric("active_processes",
303 sd.name = "DYNINSTobsCostLow"; sd.must_find = true; syms_to_find += sd;
304 sd.name = EXIT_NAME; sd.must_find = true; syms_to_find += sd;
305 sd.name = "main"; sd.must_find = true; syms_to_find += sd;
307 initDefaultPointFrequencyTable();