Main Page | Alphabetical List | Class List | File List | Class Members | File Members

stats.cc

Go to the documentation of this file.
00001 // stats.h 00002 // Routines for managing statistics about Nachos performance. 00003 // 00004 // DO NOT CHANGE -- these stats are maintained by the machine emulation. 00005 // 00006 // Copyright (c) 1992-1993 The Regents of the University of California. 00007 // All rights reserved. See copyright.h for copyright notice and limitation 00008 // of liability and disclaimer of warranty provisions. 00009 00010 #include "copyright.h" 00011 #include "utility.h" 00012 #include "stats.h" 00013 #include "system.h" 00014 00015 //---------------------------------------------------------------------- 00016 // Statistics::Statistics 00017 // Initialize performance metrics to zero, at system startup. 00018 //---------------------------------------------------------------------- 00019 00020 Statistics::Statistics() 00021 { 00022 totalTicks = idleTicks = systemTicks = userTicks = 0; 00023 numDiskReads = numDiskWrites = 0; 00024 numConsoleCharsRead = numConsoleCharsWritten = 0; 00025 numPageFaults = numPacketsSent = numPacketsRecvd = 0; 00026 } 00027 00028 //---------------------------------------------------------------------- 00029 // Statistics::Print 00030 // Print performance metrics, when we've finished everything 00031 // at system shutdown. 00032 //---------------------------------------------------------------------- 00033 00034 void 00035 Statistics::Print() 00036 { 00037 //printf("Ticks: total %d, idle %d, system %d, user %d\n", totalTicks, 00038 //idleTicks, systemTicks, userTicks); 00039 printf("Ticks: total %d, sec %d, system %d, user %d\n", timerCount, 00040 secCount, systemTicks, userTicks); 00041 printf("Disk I/O: reads %d, writes %d\n", numDiskReads, numDiskWrites); 00042 printf("Console I/O: reads %d, writes %d\n", numConsoleCharsRead, 00043 numConsoleCharsWritten); 00044 printf("Paging: faults %d\n", numPageFaults); 00045 printf("Network I/O: packets received %d, sent %d\n", numPacketsRecvd, 00046 numPacketsSent); 00047 }

Generated on Thu Sep 16 12:33:45 2004 for NachOS by doxygen 1.3.8