Bobby R. Bruce has uploaded this change for review. (
https://gem5-review.googlesource.com/c/public/gem5/+/41753 )
Change subject: base-stats,python: Expose a stat's unit via PyBind11
......................................................................
base-stats,python: Expose a stat's unit via PyBind11
Change-Id: I77df868a6bc92e5bb0a39592b5aca8e0d259bb05
---
M src/python/pybind11/stats.cc
1 file changed, 3 insertions(+), 0 deletions(-)
diff --git a/src/python/pybind11/stats.cc b/src/python/pybind11/stats.cc
index 1e6773f..f1b1e9c 100644
--- a/src/python/pybind11/stats.cc
+++ b/src/python/pybind11/stats.cc
@@ -132,6 +132,9 @@
py::class_<Stats::Info, std::unique_ptr<Stats::Info, py::nodelete>>(
m, "Info")
.def_readwrite("name", &Stats::Info::name)
+ .def_property_readonly("unit", [](const Stats::Info &info) {
+ return info.unit->getUnitString();
+ })
.def_readonly("desc", &Stats::Info::desc)
.def_readonly("id", &Stats::Info::id)
.def_property_readonly("flags", [](const Stats::Info &info) {
--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/41753
To unsubscribe, or for help writing mail filters, visit
https://gem5-review.googlesource.com/settings
Gerrit-Project: public/gem5
Gerrit-Branch: develop
Gerrit-Change-Id: I77df868a6bc92e5bb0a39592b5aca8e0d259bb05
Gerrit-Change-Number: 41753
Gerrit-PatchSet: 1
Gerrit-Owner: Bobby R. Bruce <bbr...@ucdavis.edu>
Gerrit-MessageType: newchange
_______________________________________________
gem5-dev mailing list -- gem5-dev@gem5.org
To unsubscribe send an email to gem5-dev-le...@gem5.org
%(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s