sim,base-stats: Fix leading "." bug when obtaining requestors

When requestor id is requested, it is stripped of the System name via
the `stripSystemName` function in `system.cc`. However, there is a bug
in this code that leaves a leading ".". E.g.:

`system.cpu.mmu.dtb.walker` is stripped to `.cpu.mmu.dtb.walker`.

This patch fixes this issue.

Change-Id: I825cbc60c7f7eaa84c8a0150c30e9f2902cff6cb
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/41513
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Bobby R. Bruce <bbruce@ucdavis.edu>
Maintainer: Bobby R. Bruce <bbruce@ucdavis.edu>
This commit is contained in:
Bobby R. Bruce
2021-02-16 17:14:56 -08:00
parent f11617736e
commit 1a1b53b9dd

View File

@@ -532,7 +532,7 @@ std::string
System::stripSystemName(const std::string& requestor_name) const
{
if (startswith(requestor_name, name())) {
return requestor_name.substr(name().size());
return requestor_name.substr(name().size() + 1);
} else {
return requestor_name;
}