44 #include "config/use_hdf5.hh" 46 #include "pybind11/pybind11.h" 47 #include "pybind11/stl.h" 58 namespace py = pybind11;
65 py::module
m = py::module::import(
"m5.stats");
72 py::module
m = py::module::import(
"m5.stats");
81 py::module
m = m_native.def_submodule(
"stats");
89 .def(
"registerPythonStatsHandlers",
101 py::class_<Stats::Output>(
m,
"Output")
109 py::class_<Stats::Info, std::unique_ptr<Stats::Info, py::nodelete>>(
114 .def_property_readonly(
"flags", [](
const Stats::Info &info) {
126 py::class_<Stats::Group, std::unique_ptr<Stats::Group, py::nodelete>>(
std::string name
The name of the stat.
void processDumpQueue()
Process all the callbacks in the dump callbacks queue.
const std::map< std::string, Group * > & getStatGroups() const
Get all child groups associated with this object.
virtual bool zero() const =0
virtual void endGroup()=0
virtual void enable()
Enable the stat for use.
virtual void beginGroup(const char *name)=0
virtual void regStats()
Callback to set stat parameters.
const std::vector< Info * > & getStats() const
Get all stats associated with this object.
list< Info * > & statsList()
virtual void prepare()=0
Prepare the stat for dumping.
Declaration of Statistics objects.
void registerPythonStatsHandlers()
Register py_...
virtual void reset()=0
Reset the stat to the default state.
Flags flags
The formatting flags.
virtual void preDumpStats()
Callback before stats are dumped.
virtual void resetStats()
Callback to reset stats.
void periodicStatDump(Tick period)
Schedule periodic statistics dumping.
virtual bool check() const =0
Check that this stat has been set up properly and is ready for use.
void processResetQueue()
Process all the callbacks in the reset callbacks queue.
void updateEvents()
Update the events after resuming from a checkpoint.
void schedStatEvent(bool dump, bool reset, Tick when, Tick repeat)
Schedule statistics dumping.
Output * initText(const string &filename, bool desc)
std::unique_ptr< Output > initHDF5(const std::string &filename, unsigned chunking, bool desc, bool formulas)
virtual bool valid() const =0
void addStatGroup(const char *name, Group *block)
Add a stat block as a child of this block.
void pybind_init_stats(py::module &m_native)
virtual void visit(Output &visitor)=0
Visitor entry for outputing statistics data.
std::string desc
The description of the stat.