2 * Copyright (c) 1996 Barton P. Miller
4 * We provide the Paradyn Parallel Performance Tools (below
5 * described as Paradyn") on an AS IS basis, and do not warrant its
6 * validity or performance. We reserve the right to update, modify,
7 * or discontinue this software at any time. We shall have no
8 * obligation to supply such updates or modifications or any other
9 * form of support to you.
11 * This license is for research uses. For such uses, there is no
12 * charge. We define "research use" to mean you may freely use it
13 * inside your organization for whatever purposes you see fit. But you
14 * may not re-distribute Paradyn or parts of Paradyn, in any form
15 * source or binary (including derivatives), electronic or otherwise,
16 * to any other organization or entity without our permission.
18 * (for other uses, please contact us at paradyn@cs.wisc.edu)
20 * All warranties, including without limitation, any warranty of
21 * merchantability or fitness for a particular purpose, are hereby
24 * By your use of Paradyn, you understand and agree that we (or any
25 * other person or entity with proprietary rights in Paradyn) are
26 * under no obligation to provide either maintenance services,
27 * update services, notices of latent defects, or correction of
28 * defects for Paradyn.
30 * Even if advised of the possibility of such damages, under no
31 * circumstances shall we (or any other person or entity with
32 * proprietary rights in the software licensed hereunder) be liable
33 * to you or any third party for direct, indirect, or consequential
34 * damages of any character regardless of type of action, including,
35 * without limitation, loss of profits, loss of use, loss of good
36 * will, or computer failure or malfunction. You agree to indemnify
37 * us (and any other person or entity with proprietary rights in the
38 * software licensed hereunder) for any and all liability it may
39 * incur to third parties resulting from your use of Paradyn.
45 #include "rtinst/h/trace.h"
51 #include "ptrace_emul.h"
52 #include "dyninstRPC.xdr.SRVR.h"
56 #include "perfStream.h"
58 #include "showerror.h"
59 #include "dyninstP.h" // isApplicationPaused()
61 string process::getProcessStatus() const {
66 sprintf(ret, "%d running", pid);
69 sprintf(ret, "%d neonatal", pid);
72 sprintf(ret, "%d stopped", pid);
75 sprintf(ret, "%d exited", pid);
78 sprintf(ret, "%d UNKNOWN State", pid);
85 // someone should make the proper measurements on hpux
87 void initPrimitiveCost()
89 /* Need to add code here to collect values for other machines */
91 // TODO: these values need to be updated - naim (02-13-96)
93 // these happen async of the rest of the system.
95 logLine("HPUX platform\n");
97 primitiveCosts["DYNINSTalarmExpire"] = 1;
98 primitiveCosts["DYNINSTsampleValues"] = 1;
99 primitiveCosts["DYNINSTreportTimer"] = 1;
100 primitiveCosts["DYNINSTreportCounter"] = 1;
101 primitiveCosts["DYNINSTreportCost"] = 1;
102 primitiveCosts["DYNINSTreportNewTags"] = 1;
103 primitiveCosts["DYNINSTprintCost"] = 1;
105 // this doesn't really take any time
106 primitiveCosts["DYNINSTbreakPoint"] = 1;
108 // this happens before we start keeping time.
109 primitiveCosts["DYNINSTinit"] = 1;
111 primitiveCosts["DYNINSTincrementCounter"] = 16;
112 primitiveCosts["DYNINSTdecrementCounter"] = 16;
114 primitiveCosts["DYNINSTstartWallTimer"] = 1988;
115 primitiveCosts["DYNINSTstopWallTimer"] = 4084;
116 primitiveCosts["DYNINSTstartProcessTimer"] = 51;
117 primitiveCosts["DYNINSTstopProcessTimer"] = 111;
121 * Define the various classes of library functions to inst.
124 void initLibraryFunctions()
126 /* should record waiting time in read/write, but have a conflict with
127 * use of these functions by our inst code.
128 * This happens when a CPUtimer that is stopped is stopped again by the
129 * write. It is then started again at the end of the write and should
130 * not be running then. We could let timers go negative, but this
131 * causes a problem when inst is inserted into already running code.
132 * Not sure what the best fix is - jkh 10/4/93
136 tagDict["write"] = TAG_LIB_FUNC | TAG_IO_OUT;
137 tagDict["read"] = TAG_LIB_FUNC | TAG_IO_IN;
139 tagDict["send"] = TAG_LIB_FUNC | TAG_CPU_STATE | TAG_MSG_SEND;
140 tagDict["sendmsg"] = TAG_LIB_FUNC | TAG_CPU_STATE | TAG_MSG_SEND;
141 tagDict["sendto"] = TAG_LIB_FUNC | TAG_CPU_STATE | TAG_MSG_SEND;
143 tagDict["rev"] = TAG_LIB_FUNC | TAG_CPU_STATE | TAG_MSG_RECV;
144 tagDict["recvmsg"] = TAG_LIB_FUNC | TAG_CPU_STATE | TAG_MSG_RECV;
145 tagDict["recvfrom"] = TAG_LIB_FUNC | TAG_CPU_STATE | TAG_MSG_RECV;
147 tagDict["DYNINSTalarmExpire"] = TAG_LIB_FUNC;
148 tagDict["DYNINSTsampleValues"] = TAG_LIB_FUNC;
149 tagDict[EXIT_NAME] = TAG_LIB_FUNC;
150 tagDict["fork"] = TAG_LIB_FUNC;
152 tagDict["cmmd_debug"] = TAG_LIB_FUNC;
153 tagDict["CMRT_init"] = TAG_LIB_FUNC;
154 tagDict["CMMD_send"] = TAG_LIB_FUNC;
155 tagDict["CMMD_receive"] = TAG_LIB_FUNC;
156 tagDict["CMMD_receive_block"] = TAG_LIB_FUNC;
157 tagDict["CMMD_send_block"] = TAG_LIB_FUNC;
158 tagDict["CMMD_send_async"] = TAG_LIB_FUNC;
159 tagDict["CMMD_send_async"] = TAG_LIB_FUNC;
165 float computePauseTimeMetric(const metricDefinitionNode *) {
166 // we don't need to use the metricDefinitionNode
168 timeStamp elapsed=0.0;
170 now = getCurrentTime(false);
171 if (firstRecordTime) {
172 elapsed = elapsedPauseTime;
173 if (isApplicationPaused())
174 elapsed += now - startPause;
176 assert(elapsed >= 0.0);