DIRECTORY Commander, IncrementalLoad, IO, Rope, UnixShm0, UXStrings; ResourceCommands: CEDAR MONITOR IMPORTS Commander, IncrementalLoad, IO, UnixShm0, UXStrings = BEGIN LoadStateCommand: Commander.CommandProc = TRUSTED { textSum, dataSum, bssSum: CARD32 ¬ 0; FOR fe: IncrementalLoad.FileEntry ¬ IncrementalLoad.GetPrevFileEntry[NIL], IncrementalLoad.GetPrevFileEntry[fe] WHILE fe#NIL DO fileName: Rope.ROPE ¬ UXStrings.ToRope[fe.fName]; textSize: CARD32 ¬ fe.text.len; dataSize: CARD32 ¬ fe.data.len; bssSize: CARD32 ¬ fe.bss.len; IO.PutF[cmd.out, "text:%8g data:%8g bss:%7g ", IO.card[textSize], IO.card[dataSize], IO.card[bssSize]]; IO.PutF1[cmd.out, "%g\n", IO.rope[fileName]]; textSum ¬ textSum+textSize; dataSum ¬ dataSum+dataSize; bssSum ¬ bssSum+bssSize; ENDLOOP; IO.PutF[cmd.out, "text:%8g data:%8g bss:%7g TOTAL\n", IO.card[textSum], IO.card[dataSum], IO.card[bssSum]]; }; VMStateCommand: Commander.CommandProc = TRUSTED { address: UnixShm0.RawVM ¬ UnixShm0.VMReserve[0]; value: CARD ¬ LOOPHOLE[address]; IO.PutF1[cmd.out, "VM reserved: %g \n", IO.card[value]]; }; GCCurrentByteCount: PROC [] RETURNS [CARD] = TRUSTED MACHINE CODE { ".XR_GCCurrentByteCount" }; GCCurrentObjectCount: PROC [] RETURNS [CARD] = TRUSTED MACHINE CODE { ".XR_GCCurrentObjectCount" }; GCTotalByteCount: PROC [] RETURNS [CARD] = TRUSTED MACHINE CODE { ".XR_GCTotalByteCount" }; GCTotalObjectCount: PROC [] RETURNS [CARD] = TRUSTED MACHINE CODE { ".XR_GCTotalObjectCount" }; GCHeapSize: PROC [] RETURNS [CARD] = TRUSTED MACHINE CODE { ".XR_GCHeapSize" }; GCCompositeInUse: PROC [] RETURNS [CARD] = TRUSTED MACHINE CODE { ".$GC_composite_in_use" }; GCAtomicInUse: PROC [] RETURNS [CARD] = TRUSTED MACHINE CODE { ".$GC_atomic_in_use" }; GCStateCommand: Commander.CommandProc = TRUSTED { currentByteCount: CARD ¬ GCCurrentByteCount[]; currentObjectCount: CARD ¬ GCCurrentObjectCount[]; totalByteCount: CARD ¬ GCTotalByteCount[]; totalObjectCount: CARD ¬ GCTotalObjectCount[]; heapSize: CARD ¬ GCHeapSize[]; atomic: CARD ¬ GCAtomicInUse[]*BYTES[CARD]; composite: CARD ¬ GCCompositeInUse[]*BYTES[CARD]; IO.PutF1[cmd.out, "heapSize: %g \n", IO.card[heapSize]]; IO.PutF1[cmd.out, "currentByteCount: %g \n", IO.card[currentByteCount]]; IO.PutF1[cmd.out, "totalByteCount: %g \n", IO.card[totalByteCount]]; IO.PutF1[cmd.out, "currentObjectCount: %g \n", IO.card[currentObjectCount]]; IO.PutF1[cmd.out, "totalObjectCount: %g \n", IO.card[totalObjectCount]]; IO.PutF1[cmd.out, "atomic bytes in use: %g \n", IO.card[atomic]]; IO.PutF1[cmd.out, "composite bytes in use: %g \n", IO.card[composite]]; }; TotalStateCommand: Commander.CommandProc = TRUSTED { IO.PutF[cmd.out, "%lLoad State%l\n", IO.rope["b"], IO.rope["B"]]; [] ¬ LoadStateCommand[cmd]; IO.PutF[cmd.out, "%lVM State%l\n", IO.rope["b"], IO.rope["B"]]; [] ¬ VMStateCommand[cmd]; IO.PutF[cmd.out, "%lGarbage Collector State%l\n", IO.rope["b"], IO.rope["B"]]; [] ¬ GCStateCommand[cmd]; }; Commander.Register["LoadState", LoadStateCommand, "Loadstate according to incremental loader"]; Commander.Register["VMState", VMStateCommand, "VM allocated according to VMReserve"]; Commander.Register["GCState", GCStateCommand, "Garbage collector info"]; Commander.Register["TotalState", TotalStateCommand, "Lots of info"]; END. ’ ResourceCommands.mesa Copyright Σ 1993 by Xerox Corporation. All rights reserved. Created by Christian Jacobi, February 17, 1993 4:48:29 pm PST Christian Jacobi, April 27, 1993 4:15 pm PDT Poor mans load state analysis. This application prints many different class of states and does the necessay imports. Eventually we will recognize certain packages which know how to print their states separately. If we would continue to import all the information sources we would create a monster. Number of longwords in accessible composite objects. Number of longwords in accessible atomic objects. Other interesting commands are ExamineStorage RopeFiles X11ShmUsage Κ•NewlineDelimiter –(cedarcode) style™™Icodešœ Οeœ1™K™,K™™K™K™—K™—šΟk ˜ Kšœžœ˜:K˜—šΟnœžœž˜Kšžœžœ˜=—Kšž˜K˜šŸœžœ˜3Kšœžœ˜%š žœBžœ(žœžœž˜Kšœžœ˜1Kšœ žœ˜Kšœ žœ˜Kšœ žœ˜Kšžœ/žœžœžœ˜iKšžœžœ˜-K˜K˜K˜Kšžœ˜—Kšžœ7žœžœžœ˜nK˜K˜—šŸœžœ˜1K˜0Kšœžœžœ ˜ Kšžœ&žœ˜8K˜K˜—šŸœžœžœžœžœžœžœ˜CK˜!Kšœ˜K˜—šŸœžœžœžœžœžœžœ˜EK˜#Kšœ˜K˜—šŸœžœžœžœžœžœžœ˜AK˜Kšœ˜K˜—šŸœžœžœžœžœžœžœ˜CK˜!Kšœ˜K˜—šŸ œžœžœžœžœžœžœ˜;K˜Kšœ˜K˜—šŸœžœžœžœžœžœžœ˜AK™4K˜ Kšœ˜K˜—šŸ œžœžœžœžœžœžœ˜>K™1K˜Kšœ˜K˜—šŸœžœ˜1Kšœžœ˜.Kšœžœ˜2Kšœžœ˜*Kšœžœ˜.Kšœ žœœ˜Kšœžœžœžœ˜+Kšœ žœžœžœ˜1Kšžœ#žœ˜8Kšžœ+žœ˜HKšžœ)žœ˜DKšžœ-žœ˜LKšžœ+žœ˜HKšžœ.žœ˜AKšžœ1žœ˜GK˜K˜—šŸœžœ˜4Kšžœ?˜AK˜Kšžœ=˜?K˜KšžœL˜NK˜K˜K˜—K˜_K˜UK˜HK˜DKšžœ˜K˜™K™K™ K™ ——…— §