arch,base,sim: Move Process loader hooks into the Process class.
[gem5.git] / src / sim / stat_control.hh
index a22ce76af9fbd915d9d09f02dc5bff7078247d67..73961e8b702739bed3f65be3a056f4c25ca9403b 100644 (file)
@@ -1,4 +1,16 @@
 /*
+ * Copyright (c) 2012 ARM Limited
+ * All rights reserved
+ *
+ * The license below extends only to copyright in the software and shall
+ * not be construed as granting a license to any other intellectual
+ * property including but not limited to intellectual property relating
+ * to a hardware implementation of the functionality of the software
+ * licensed hereunder.  You may use the software subject to the license
+ * terms below provided that you ensure that this notice is replicated
+ * unmodified and in its entirety in all distributions of the software,
+ * modified or unmodified, in source code or in binary form.
+ *
  * Copyright (c) 2004-2005 The Regents of The University of Michigan
  * All rights reserved.
  *
  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * Authors: Nathan Binkert
+ *          Sascha Bischoff
  */
 
 #ifndef __SIM_STAT_CONTROL_HH__
 #define __SIM_STAT_CONTROL_HH__
 
-#include <fstream>
-#include <list>
+#include "base/types.hh"
+#include "sim/core.hh"
 
 namespace Stats {
 
-enum {
-    Reset = 0x1,
-    Dump = 0x2
-};
+double statElapsedTime();
+
+Tick statElapsedTicks();
 
-class Output;
-extern std::list<Output *> OutputList;
+Tick statFinalTick();
 
-void DumpNow();
-void SetupEvent(int flags, Tick when, Tick repeat = 0);
+void initSimStats();
 
-void InitSimStats();
+/**
+ * Update the events after resuming from a checkpoint. When resuming from a
+ * checkpoint, curTick will be updated, and any already scheduled events can
+ * end up scheduled in the past. This function checks if the dumpEvent is
+ * scheduled in the past, and reschedules it appropriately.
+ */
+void updateEvents();
+
+/**
+ * Schedule statistics dumping. This allows you to dump and/or reset the
+ * built-in statistics. This can either be done once, or it can be done on a
+ * regular basis.
+ * @param dump Set true to dump the statistics.
+ * @param reset Set true to reset the statistics.
+ * @param when When the dump and/or reset should occur.
+ * @param repeat How often the event should repeat. Set 0 to disable repeating.
+ */
+void schedStatEvent(bool dump, bool reset, Tick when = curTick(),
+                    Tick repeat = 0);
 
-/* namespace Stats */ }
+/**
+ * Schedule periodic statistics dumping. This allows you to dump and reset the
+ * built-in statistics on a regular basis, thereby allowing the extraction of
+ * temporal trends in the data.
+ * @param period The period at which the dumping should occur.
+ */
+void periodicStatDump(Tick period = 0);
+} // namespace Stats
 
 #endif // __SIM_STAT_CONTROL_HH__