home *** CD-ROM | disk | FTP | other *** search
-
- /* C O P Y R I G H T N O T I C E : */
- /* Copyright 1986 Eric Jul and Norm Hutchinson. May not be used for any */
- /* purpose without written permission from the authors. */
-
- /* Contains the measurement instrumentation and counters */
-
- #include "Kernel/h/stdTypes.h"
- #include "Kernel/h/kmdTypes.h"
-
- int cEM_directCreates = 0;
- int cEM_totalInvokes = 0;
- int cEM_directInvokes = 0;
- int cEM_inlinedInvokes = 0;
- int cEM_localInvokes = 0;
- int cEM_selfInvokes = 0;
- int cEM_KCTimmutableInvokes = 0;
- int cEM_UKCTimmutableInvokes = 0;
- int cEM_KCTresidentGlobalInvokes = 0;
- int cEM_UKCTresidentGlobalInvokes = 0;
-
- int cINVK_RemoteInvokes = 0; /* invoke.c */
- int cINVK_RemoteReturns = 0; /* invoke.c */
- int cINVK_RemoteNoSuccessReturns = 0; /* invoke.c */
- int cINVK_InvokeFaults = 0; /* invoke.c */
- int cINVK_RemoteInvokesBytesSent = 0; /* invoke.c */
- int cINVK_RemoteInvokesPacketsSent = 0;
- int cINVK_RemoteReturnsBytesSent = 0; /* invoke.c */
- int cINVK_RemoteReturnsPacketsSent = 0;
-
- int cMV_MovesDone = 0; /* mobility.c */
- int cINVK_CallByMovesDone = 0; /* invoke.c */
- int cINVK_CallByResultMovesDone = 0;
- int cINVK_CallByVisitsDone = 0; /* invoke.c */
- int cINVK_CallByVisitReturnsDone = 0; /* invoke.c */
- int cMV_MovesBytesSent = 0; /* mobility.c */
- int cMV_MovesPacketsSent = 0;
- int cINVK_CallByMovesBytesSent = 0; /* invoke.c */
- int cINVK_CallByResultBytesSent = 0;
- int cINVK_CallByVisitsBytesSent = 0; /* invoke.c */
- int cINVK_CallByVisitReturnBytesSent= 0; /* invoke.c */
-
- int cCP_CheckpointsDone = 0; /* checkPoint.c */
- int cCP_CheckpointsBytesSent = 0; /* checkPoint.c */
-
- int cLOC_LocatesDone = 0; /* locate.c */
- int cLOC_ShoutsSent = 0; /* locate.c */
- int cLOC_ShoutBroadcastsSent = 0; /* locate.c */
- int cLOC_SearchsSent = 0; /* locate.c */
- int cLOC_SearchBroadcastsSent = 0; /* locate.c */
- int cLOC_SearchProdsSent = 0; /* locate.c */
-
- int cEM_moves = 0;
- int cEM_fixes = 0;
- int cEM_unfixes = 0;
- int cEM_refixes = 0;
- int cEM_locates = 0;
- int cEM_callByMoves = 0;
- int cEM_callByResultMoves = 0;
- int cEM_callByVisits = 0;
-
-
- /* Snapshot */
- void EMDumpStats()
- {
- KMDPrint("Dump of counters\n");
- KMDPrint("%8d directCreates\n", cEM_directCreates);
- KMDPrint("%8d totalInvokes\n", cEM_totalInvokes);
- KMDPrint("%8d directInvokes\n", cEM_directInvokes);
- KMDPrint("%8d inlinedInvokes\n", cEM_inlinedInvokes);
- KMDPrint("%8d local invokes\n", cEM_localInvokes);
- KMDPrint("%8d self invokes\n", cEM_selfInvokes);
- KMDPrint("%8d KCT invokes of immutable objects\n",
- cEM_KCTimmutableInvokes);
- KMDPrint("%8d UKCT invokes of immutable objects\n",
- cEM_UKCTimmutableInvokes);
- KMDPrint("%8d KCT invokes of resident globals\n",
- cEM_KCTresidentGlobalInvokes);
- KMDPrint("%8d UKCT invokes of resident globals\n",
- cEM_UKCTresidentGlobalInvokes);
- KMDPrint("%8d Invoke Faults\n", cINVK_InvokeFaults);
- KMDPrint("%8d Remote Invokes\n", cINVK_RemoteInvokes);
- KMDPrint("%8d Remote Invokes Bytes Sent, avg. %8.2f\n",
- cINVK_RemoteInvokesBytesSent, cINVK_RemoteInvokes > 0 ?
- cINVK_RemoteInvokesBytesSent / (float) cINVK_RemoteInvokes : 0);
- KMDPrint("%8d Remote Invokes Packets Sent, avg. %8.2f\n",
- cINVK_RemoteInvokesPacketsSent, cINVK_RemoteInvokes > 0 ?
- cINVK_RemoteInvokesPacketsSent / (float) cINVK_RemoteInvokes : 0);
- KMDPrint("%8d Remote Returns\n", cINVK_RemoteReturns);
- KMDPrint("%8d Remote Returns Bytes Sent, avg. %8.2f\n",
- cINVK_RemoteReturnsBytesSent, cINVK_RemoteReturns > 0 ?
- cINVK_RemoteReturnsBytesSent / (float) cINVK_RemoteReturns : 0);
- KMDPrint("%8d Remote Returns Packets Sent, avg. %8.2f\n",
- cINVK_RemoteReturnsPacketsSent, cINVK_RemoteReturns > 0 ?
- cINVK_RemoteReturnsPacketsSent / (float) cINVK_RemoteReturns : 0);
-
- KMDPrint("%8d Move statements\n", cEM_moves);
- KMDPrint("%8d Moves Actually Done\n", cMV_MovesDone);
- KMDPrint("%8d Bytes moved, avg. %8.2f\n", cMV_MovesBytesSent,
- cMV_MovesDone > 0 ? cMV_MovesBytesSent / (float) cMV_MovesDone : 0);
- KMDPrint("%8d Packets for move, avg. %8.2f\n", cMV_MovesPacketsSent,
- cMV_MovesDone > 0 ? cMV_MovesPacketsSent / (float) cMV_MovesDone : 0);
- KMDPrint("%8d Fix statements\n", cEM_fixes);
- KMDPrint("%8d Unfix statements\n", cEM_unfixes);
- KMDPrint("%8d Refix statements\n", cEM_refixes);
- KMDPrint("%8d Checkpoints done\n", cCP_CheckpointsDone);
- KMDPrint("%8d Checkpoint bytes sent\n", cCP_CheckpointsBytesSent);
- KMDPrint("%8d Locate expressions\n", cEM_locates);
- KMDPrint("%8d Locates Done\n", cLOC_LocatesDone);
- KMDPrint("%8d Shout broadcasts sent with %4d requests, avg. %8.2f\n",
- cLOC_ShoutBroadcastsSent, cLOC_ShoutsSent,
- cLOC_ShoutBroadcastsSent > 0 ?
- cLOC_ShoutsSent / (float) cLOC_ShoutBroadcastsSent : 0);
- KMDPrint("%8d Search broadcasts sent with %4d requests, avg. %8.2f\n",
- cLOC_SearchBroadcastsSent, cLOC_SearchsSent,
- cLOC_SearchBroadcastsSent > 0 ?
- cLOC_SearchsSent / (float) cLOC_SearchBroadcastsSent : 0);
- KMDPrint("%8d Search Prods sent\n", cLOC_SearchProdsSent);
- KMDPrint("%8d Call by move arguments\n", cEM_callByMoves);
- KMDPrint("%8d Call by moves done\n", cINVK_CallByMovesDone);
- KMDPrint("%8d Call by moves bytes sent, avg. %8.2f\n",
- cINVK_CallByMovesBytesSent,
- cINVK_CallByMovesDone > 0 ? cINVK_CallByMovesBytesSent /
- (float) cINVK_CallByMovesDone : 0);
- KMDPrint("%8d Call by move results\n", cEM_callByResultMoves);
- KMDPrint("%8d Call by result moves done\n", cINVK_CallByResultMovesDone);
- KMDPrint("%8d Call by result bytes sent, avg. %8.2f\n",
- cINVK_CallByResultBytesSent,
- cINVK_CallByResultMovesDone > 0 ? cINVK_CallByResultBytesSent /
- (float) cINVK_CallByResultMovesDone : 0);
- KMDPrint("%8d Call by visit arguments\n", cEM_callByVisits);
- KMDPrint("%8d Call by visit moves done\n", cINVK_CallByVisitsDone);
- KMDPrint("%8d Call by visit bytes sent, avg. %8.2f\n",
- cINVK_CallByVisitsBytesSent,
- cINVK_CallByVisitsDone > 0 ? cINVK_CallByVisitsBytesSent /
- (float) cINVK_CallByVisitsDone : 0);
- KMDPrint("%8d Call by visit return moves done\n",
- cINVK_CallByVisitReturnsDone);
- KMDPrint("%8d Call by visit returning bytes, avg. %8.2f\n",
- cINVK_CallByVisitReturnBytesSent,
- cINVK_CallByVisitReturnsDone > 0 ? cINVK_CallByVisitReturnBytesSent /
- (float) cINVK_CallByVisitReturnsDone : 0);
-
- }
-
- /* Snapshot */
- void EMResetStats()
- {
- KMDPrint("Counters reset\n");
- cEM_directCreates = 0;
- cEM_totalInvokes = 0;
- cEM_directInvokes = 0;
- cEM_inlinedInvokes = 0;
- cEM_localInvokes = 0;
- cEM_selfInvokes = 0;
- cEM_KCTimmutableInvokes = 0;
- cEM_UKCTimmutableInvokes = 0;
- cEM_KCTresidentGlobalInvokes = 0;
- cEM_UKCTresidentGlobalInvokes = 0;
-
- cINVK_InvokeFaults = 0;
- cINVK_RemoteInvokes = 0;
- cINVK_RemoteReturns = 0;
- cINVK_RemoteInvokesBytesSent = 0;
- cINVK_RemoteReturnsBytesSent = 0;
- cINVK_RemoteInvokesPacketsSent = 0;
- cINVK_RemoteReturnsPacketsSent = 0;
-
- cMV_MovesDone = 0;
- cMV_MovesPacketsSent = 0;
-
- cINVK_CallByMovesDone = 0;
- cINVK_CallByResultMovesDone = 0;
- cINVK_CallByVisitsDone = 0;
- cINVK_CallByVisitReturnsDone = 0;
- cMV_MovesBytesSent = 0;
- cINVK_CallByMovesBytesSent = 0;
- cINVK_CallByResultBytesSent = 0;
- cINVK_CallByVisitsBytesSent = 0;
- cINVK_CallByVisitReturnBytesSent= 0;
-
- cLOC_LocatesDone = 0;
- cLOC_ShoutsSent = 0;
- cLOC_ShoutBroadcastsSent = 0;
- cLOC_SearchsSent = 0;
- cLOC_SearchBroadcastsSent = 0;
- cLOC_SearchProdsSent = 0;
-
- cEM_moves = 0;
- cEM_fixes = 0;
- cEM_unfixes = 0;
- cEM_refixes = 0;
- cEM_locates = 0;
- cEM_callByMoves = 0;
- cEM_callByResultMoves = 0;
- cEM_callByVisits = 0;
- }
-
-
- void MeasureInit()
- {
- KMDSetSnap(EMDumpStats);
- KMDSetSnap(EMResetStats);
- KMDSetVar(cEM_directCreates);
- KMDSetVar(cEM_totalInvokes);
- KMDSetVar(cEM_directInvokes);
- KMDSetVar(cEM_inlinedInvokes);
- KMDSetVar(cEM_localInvokes);
- KMDSetVar(cEM_selfInvokes);
- KMDSetVar(cEM_KCTimmutableInvokes);
- KMDSetVar(cEM_UKCTimmutableInvokes);
- KMDSetVar(cEM_KCTresidentGlobalInvokes);
- KMDSetVar(cEM_UKCTresidentGlobalInvokes);
- KMDSetVar(cINVK_InvokeFaults);
- KMDSetVar(cINVK_RemoteInvokes);
- KMDSetVar(cINVK_RemoteReturns);
- KMDSetVar(cINVK_RemoteInvokesBytesSent);
- KMDSetVar(cINVK_RemoteReturnsBytesSent);
- KMDSetVar(cINVK_RemoteInvokesPacketsSent);
- KMDSetVar(cINVK_RemoteReturnsPacketsSent);
-
- KMDSetVar(cMV_MovesDone);
- KMDSetVar(cMV_MovesPacketsSent);
-
- KMDSetVar(cINVK_CallByMovesDone);
- KMDSetVar(cINVK_CallByResultMovesDone);
- KMDSetVar(cINVK_CallByVisitsDone);
- KMDSetVar(cINVK_CallByVisitReturnsDone);
-
- KMDSetVar(cMV_MovesBytesSent);
- KMDSetVar(cINVK_CallByMovesBytesSent);
- KMDSetVar(cINVK_CallByResultBytesSent);
- KMDSetVar(cINVK_CallByVisitsBytesSent);
- KMDSetVar(cINVK_CallByVisitReturnBytesSent);
-
- KMDSetVar(cLOC_LocatesDone);
- KMDSetVar(cLOC_ShoutsSent);
- KMDSetVar(cLOC_ShoutBroadcastsSent);
- KMDSetVar(cLOC_SearchsSent);
- KMDSetVar(cLOC_SearchBroadcastsSent);
- KMDSetVar(cLOC_SearchProdsSent);
-
- KMDSetVar(cEM_moves);
- KMDSetVar(cEM_fixes);
- KMDSetVar(cEM_unfixes);
- KMDSetVar(cEM_refixes);
- KMDSetVar(cEM_locates);
- KMDSetVar(cEM_callByMoves);
- KMDSetVar(cEM_callByResultMoves);
- KMDSetVar(cEM_callByVisits);
- }
-