<<>> <> <> <> <> <<>> <> <<>> <> <<>> 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. <> <> <> <>