1754SN/A/* 21762SN/A * Copyright (c) 2004-2005 The Regents of The University of Michigan 3754SN/A * All rights reserved. 4754SN/A * 5754SN/A * Redistribution and use in source and binary forms, with or without 6754SN/A * modification, are permitted provided that the following conditions are 7754SN/A * met: redistributions of source code must retain the above copyright 8754SN/A * notice, this list of conditions and the following disclaimer; 9754SN/A * redistributions in binary form must reproduce the above copyright 10754SN/A * notice, this list of conditions and the following disclaimer in the 11754SN/A * documentation and/or other materials provided with the distribution; 12754SN/A * neither the name of the copyright holders nor the names of its 13754SN/A * contributors may be used to endorse or promote products derived from 14754SN/A * this software without specific prior written permission. 15754SN/A * 16754SN/A * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 17754SN/A * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 18754SN/A * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 19754SN/A * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 20754SN/A * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 21754SN/A * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 22754SN/A * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 23754SN/A * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 24754SN/A * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 25754SN/A * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 26754SN/A * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 272665Ssaidi@eecs.umich.edu * 282665Ssaidi@eecs.umich.edu * Authors: Lisa Hsu 292665Ssaidi@eecs.umich.edu * Nathan Binkert 30754SN/A */ 31754SN/A 32754SN/A#ifndef __KERNEL_STATS_HH__ 33754SN/A#define __KERNEL_STATS_HH__ 34754SN/A 35754SN/A#include <string> 36754SN/A 378229Snate@binkert.org#include "sim/serialize.hh" 387678Sgblack@eecs.umich.edu#include "sim/stats.hh" 391917SN/A 401681SN/A// What does kernel stats expect is included? 411070SN/Anamespace Kernel { 421070SN/A 431070SN/Aclass Statistics : public Serializable 441070SN/A{ 453548SN/A protected: 461070SN/A std::string myname; 471070SN/A 483548SN/A protected: 495999Snate@binkert.org Stats::Scalar _arm; 505999Snate@binkert.org Stats::Scalar _quiesce; 511070SN/A 521070SN/A public: 533548SN/A virtual ~Statistics() {} 541070SN/A 551070SN/A const std::string name() const { return myname; } 5613905Sgabeblack@google.com virtual void regStats(const std::string &name); 571070SN/A 581070SN/A public: 591070SN/A void arm() { _arm++; } 601070SN/A void quiesce() { _quiesce++; } 611070SN/A 621070SN/A public: 6312182Sgabeblack@google.com void serialize(CheckpointOut &cp) const override {} 6412182Sgabeblack@google.com void unserialize(CheckpointIn &cp) override {} 651070SN/A}; 661070SN/A 677811Ssteve.reinhardt@amd.com} // namespace Kernel 681070SN/A 69754SN/A#endif // __KERNEL_STATS_HH__ 70