base: Add support for resolving stats within groups by name
authorNikos Nikoleris <nikos.nikoleris@arm.com>
Fri, 3 Apr 2020 10:57:31 +0000 (11:57 +0100)
committerNikos Nikoleris <nikos.nikoleris@arm.com>
Wed, 29 Apr 2020 21:02:32 +0000 (21:02 +0000)
commit8cac579e5ea3b8b43ecaec4a07925cbd1813fdfa
tree69f2e955b48efbb77ab7a2cc7de389b2ffe0ebb4
parentee5f32a3824ad95b53990e81e963e2cae54bff0f
base: Add support for resolving stats within groups by name

This change adds a member function to the Group class that returns a
stat given its name. The function will go through all stats in the
group and its subgroups and will return the stat that matches the
name. For example, if g is the Group system.bigCluster.cpus then a
call to

p = g.resolveStat("ipc")

will return a pointer to the stat system.bigCluster.cpus.ipc.

Change-Id: I5af8401b38b41aee611728f6d1a595f99d22d9de
Signed-off-by: Nikos Nikoleris <nikos.nikoleris@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/27890
Reviewed-by: Bobby R. Bruce <bbruce@ucdavis.edu>
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
src/base/stats/group.cc
src/base/stats/group.hh
src/python/pybind11/stats.cc