Hoa Nguyen has uploaded this change for review. ( https://gem5-review.googlesource.com/c/public/gem5/+/37995 )

Change subject: sim: Update stats style of System and Process
......................................................................

sim: Update stats style of System and Process

Change-Id: I3af072a61a18f4fbba3f7d4b632c58501e7b7ae8
Signed-off-by: Hoa Nguyen <hoangu...@ucdavis.edu>
---
M src/sim/process.cc
M src/sim/process.hh
M src/sim/system.cc
3 files changed, 5 insertions(+), 20 deletions(-)



diff --git a/src/sim/process.cc b/src/sim/process.cc
index 315f86b..7819820 100644
--- a/src/sim/process.cc
+++ b/src/sim/process.cc
@@ -128,7 +128,8 @@
       _pid(params.pid), _ppid(params.ppid),
       _pgid(params.pgid), drivers(params.drivers),
fds(make_shared<FDArray>(params.input, params.output, params.errout)),
-      childClearTID(0)
+      childClearTID(0),
+      ADD_STAT(numSyscalls, "Number of system calls")
 {
     if (_pid >= System::maxPID)
         fatal("_pid is too large: %d", _pid);
@@ -252,19 +253,6 @@
 }

 void
-Process::regStats()
-{
-    SimObject::regStats();
-
-    using namespace Stats;
-
-    numSyscalls
-        .name(name() + ".numSyscalls")
-        .desc("Number of system calls")
-        ;
-}
-
-void
 Process::revokeThreadContext(int context_id)
 {
     std::vector<ContextID>::iterator it;
diff --git a/src/sim/process.hh b/src/sim/process.hh
index 2234cb0..c9e6a8b 100644
--- a/src/sim/process.hh
+++ b/src/sim/process.hh
@@ -105,9 +105,6 @@
     Addr getStartPC();
     ::Loader::ObjectFile *getInterpreter();

-    // override of virtual SimObject method: register statistics
-    void regStats() override;
-
     void allocateMem(Addr vaddr, int64_t size, bool clobber = false);

/// Attempt to fix up a fault at vaddr by allocating a page on the stack.
@@ -162,8 +159,6 @@
     // system object which owns this process
     System *system;

-    Stats::Scalar numSyscalls;  // track how many system calls are executed
-
     // flag for using architecture specific page table
     bool useArchPT;
     // running KVM requires special initialization
@@ -286,6 +281,8 @@

     // Process was forked with SIGCHLD set.
     bool *sigchld;
+
+    Stats::Scalar numSyscalls;  // track how many system calls are executed
 };

 #endif // __PROCESS_HH__
diff --git a/src/sim/system.cc b/src/sim/system.cc
index d31238c..44daeb8 100644
--- a/src/sim/system.cc
+++ b/src/sim/system.cc
@@ -490,7 +490,7 @@
     SimObject::regStats();

     for (uint32_t j = 0; j < numWorkIds ; j++) {
-        workItemStats[j] = new Stats::Histogram();
+        workItemStats[j] = new Stats::Histogram(this);
         stringstream namestr;
         ccprintf(namestr, "work_item_type%d", j);
         workItemStats[j]->init(20)

--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/37995
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: I3af072a61a18f4fbba3f7d4b632c58501e7b7ae8
Gerrit-Change-Number: 37995
Gerrit-PatchSet: 1
Gerrit-Owner: Hoa Nguyen <hoangu...@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

Reply via email to