Main Page   Compound List   File List   Compound 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 
00014 //----------------------------------------------------------------------
00015 // Statistics::Statistics
00016 //      Initialize performance metrics to zero, at system startup.
00017 //----------------------------------------------------------------------
00018 
00019 Statistics::Statistics()
00020 {
00021     totalTicks = idleTicks = systemTicks = userTicks = 0;
00022     numDiskReads = numDiskWrites = 0;
00023     numConsoleCharsRead = numConsoleCharsWritten = 0;
00024     numPageFaults = numPacketsSent = numPacketsRecvd = 0;
00025 }
00026 
00027 //----------------------------------------------------------------------
00028 // Statistics::Print
00029 //      Print performance metrics, when we've finished everything
00030 //      at system shutdown.
00031 //----------------------------------------------------------------------
00032 
00033 void
00034 Statistics::Print()
00035 {
00036     printf("Ticks: total %d, idle %d, system %d, user %d\n", totalTicks, 
00037         idleTicks, systemTicks, userTicks);
00038     printf("Disk I/O: reads %d, writes %d\n", numDiskReads, numDiskWrites);
00039     printf("Console I/O: reads %d, writes %d\n", numConsoleCharsRead, 
00040         numConsoleCharsWritten);
00041     printf("Paging: faults %d\n", numPageFaults);
00042     printf("Network I/O: packets received %d, sent %d\n", numPacketsRecvd, 
00043         numPacketsSent);
00044 }

Generated on Mon Feb 10 09:54:47 2003 for nachos by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002
The University of Southern California does not screen or control the content on this website and thus does not guarantee the accuracy, integrity, or quality of such content. All content on this website is provided by and is the sole responsibility of the person from which such content originated, and such content does not necessarily reflect the opinions of the University administration or the Board of Trustees