stat_control.hh revision 9262
18968Snilay@cs.wisc.edu/* 28968Snilay@cs.wisc.edu * Copyright (c) 2012 ARM Limited 38968Snilay@cs.wisc.edu * All rights reserved 48968Snilay@cs.wisc.edu * 58968Snilay@cs.wisc.edu * The license below extends only to copyright in the software and shall 68968Snilay@cs.wisc.edu * not be construed as granting a license to any other intellectual 78968Snilay@cs.wisc.edu * property including but not limited to intellectual property relating 88968Snilay@cs.wisc.edu * to a hardware implementation of the functionality of the software 98968Snilay@cs.wisc.edu * licensed hereunder. You may use the software subject to the license 108968Snilay@cs.wisc.edu * terms below provided that you ensure that this notice is replicated 118968Snilay@cs.wisc.edu * unmodified and in its entirety in all distributions of the software, 128968Snilay@cs.wisc.edu * modified or unmodified, in source code or in binary form. 138968Snilay@cs.wisc.edu * 148968Snilay@cs.wisc.edu * Copyright (c) 2004-2005 The Regents of The University of Michigan 158968Snilay@cs.wisc.edu * All rights reserved. 168968Snilay@cs.wisc.edu * 178968Snilay@cs.wisc.edu * Redistribution and use in source and binary forms, with or without 188968Snilay@cs.wisc.edu * modification, are permitted provided that the following conditions are 198968Snilay@cs.wisc.edu * met: redistributions of source code must retain the above copyright 208968Snilay@cs.wisc.edu * notice, this list of conditions and the following disclaimer; 218968Snilay@cs.wisc.edu * redistributions in binary form must reproduce the above copyright 228968Snilay@cs.wisc.edu * notice, this list of conditions and the following disclaimer in the 238968Snilay@cs.wisc.edu * documentation and/or other materials provided with the distribution; 248968Snilay@cs.wisc.edu * neither the name of the copyright holders nor the names of its 258968Snilay@cs.wisc.edu * contributors may be used to endorse or promote products derived from 268968Snilay@cs.wisc.edu * this software without specific prior written permission. 278968Snilay@cs.wisc.edu * 288968Snilay@cs.wisc.edu * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 298968Snilay@cs.wisc.edu * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 308968Snilay@cs.wisc.edu * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 318968Snilay@cs.wisc.edu * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 328968Snilay@cs.wisc.edu * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 338968Snilay@cs.wisc.edu * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 348968Snilay@cs.wisc.edu * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 358968Snilay@cs.wisc.edu * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 369123Sandreas.hansson@arm.com * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 378968Snilay@cs.wisc.edu * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 388968Snilay@cs.wisc.edu * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 398968Snilay@cs.wisc.edu * 408968Snilay@cs.wisc.edu * Authors: Nathan Binkert 418968Snilay@cs.wisc.edu * Sascha Bischoff 428968Snilay@cs.wisc.edu */ 438968Snilay@cs.wisc.edu 448968Snilay@cs.wisc.edu#ifndef __SIM_STAT_CONTROL_HH__ 458968Snilay@cs.wisc.edu#define __SIM_STAT_CONTROL_HH__ 468968Snilay@cs.wisc.edu 478968Snilay@cs.wisc.edunamespace Stats { 488968Snilay@cs.wisc.edu 498968Snilay@cs.wisc.eduvoid initSimStats(); 508968Snilay@cs.wisc.edu 518968Snilay@cs.wisc.edu/** 528968Snilay@cs.wisc.edu * Update the events after resuming from a checkpoint. When resuming from a 538968Snilay@cs.wisc.edu * checkpoint, curTick will be updated, and any already scheduled events can 548968Snilay@cs.wisc.edu * end up scheduled in the past. This function checks if the dumpEvent is 558968Snilay@cs.wisc.edu * scheduled in the past, and reschedules it appropriately. 568968Snilay@cs.wisc.edu */ 578968Snilay@cs.wisc.eduvoid updateEvents(); 589728Sandreas.hansson@arm.com 599793Sakash.bagdia@arm.com/** 609793Sakash.bagdia@arm.com * Schedule statistics dumping. This allows you to dump and/or reset the 618968Snilay@cs.wisc.edu * built-in statistics. This can either be done once, or it can be done on a 628968Snilay@cs.wisc.edu * regular basis. 639793Sakash.bagdia@arm.com * @param dump Set true to dump the statistics. 648968Snilay@cs.wisc.edu * @param reset Set true to reset the statistics. 658968Snilay@cs.wisc.edu * @param when When the dump and/or reset should occur. 669793Sakash.bagdia@arm.com * @param repeat How often the event should repeat. Set 0 to disable repeating. 679793Sakash.bagdia@arm.com */ 689793Sakash.bagdia@arm.comvoid schedStatEvent(bool dump, bool reset, Tick when = curTick(), 698968Snilay@cs.wisc.edu Tick repeat = 0); 708968Snilay@cs.wisc.edu 718968Snilay@cs.wisc.edu/** 728968Snilay@cs.wisc.edu * Schedule periodic statistics dumping. This allows you to dump and reset the 738968Snilay@cs.wisc.edu * built-in statistics on a regular basis, thereby allowing the extraction of 748968Snilay@cs.wisc.edu * temporal trends in the data. 758968Snilay@cs.wisc.edu * @param period The period at which the dumping should occur. 768968Snilay@cs.wisc.edu */ 778968Snilay@cs.wisc.eduvoid periodicStatDump(uint64_t period = 0); 788968Snilay@cs.wisc.edu} // namespace Stats 798968Snilay@cs.wisc.edu 808968Snilay@cs.wisc.edu#endif // __SIM_STAT_CONTROL_HH__ 819577Snilay@cs.wisc.edu