From f769117fd1905f8b30a5e59a96ce617eba9b12bc Mon Sep 17 00:00:00 2001 From: "Bobby R. Bruce" Date: Fri, 19 Feb 2021 22:58:48 -0800 Subject: [PATCH] base-stats,python: Add Units to the Python Stats Change-Id: Ic8d3c9a5c2bb7fbe51b8672b74b0e5fb17906a5e Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/41754 Tested-by: kokoro Reviewed-by: Bobby R. Bruce Maintainer: Bobby R. Bruce --- src/python/m5/stats/gem5stats.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/python/m5/stats/gem5stats.py b/src/python/m5/stats/gem5stats.py index 3afc7766c5..944604509c 100644 --- a/src/python/m5/stats/gem5stats.py +++ b/src/python/m5/stats/gem5stats.py @@ -148,7 +148,7 @@ def __get_statistic(statistic: _m5.stats.Info) -> Optional[Statistic]: def __get_scaler(statistic: _m5.stats.ScalarInfo) -> Scalar: value = statistic.value - unit = None # TODO https://gem5.atlassian.net/browse/GEM5-850. + unit = statistic.unit description = statistic.desc # ScalarInfo uses the C++ `double`. datatype = StorageType["f64"] @@ -161,7 +161,7 @@ def __get_scaler(statistic: _m5.stats.ScalarInfo) -> Scalar: ) def __get_distribution(statistic: _m5.stats.DistInfo) -> Distribution: - unit = None # TODO https://gem5.atlassian.net/browse/GEM5-850. + unit = statistic.unit description = statistic.desc value = statistic.values bin_size = statistic.bucket_size @@ -198,7 +198,7 @@ def __get_vector(statistic: _m5.stats.VectorInfo) -> Vector: for index in range(statistic.size): # All the values in a Vector are Scalar values value = statistic.value[index] - unit = None # TODO https://gem5.atlassian.net/browse/GEM5-850. + unit = statistic.unit description = statistic.subdescs[index] # ScalarInfo uses the C++ `double`. datatype = StorageType["f64"]