Eden Avivi has uploaded this change for review. ( https://gem5-review.googlesource.com/c/public/gem5/+/33400 )

Change subject: cpu: convert thread_state to new style stats
......................................................................

cpu: convert thread_state to new style stats

Change-Id: Ib8cc8633ca5fced63918a7a6d10e15126f7c7459
---
M src/cpu/thread_state.cc
M src/cpu/thread_state.hh
2 files changed, 21 insertions(+), 6 deletions(-)



diff --git a/src/cpu/thread_state.cc b/src/cpu/thread_state.cc
index f681abc..6b72769 100644
--- a/src/cpu/thread_state.cc
+++ b/src/cpu/thread_state.cc
@@ -39,7 +39,8 @@
 #include "sim/system.hh"

 ThreadState::ThreadState(BaseCPU *cpu, ThreadID _tid, Process *_process)
-    : numInst(0), numOp(0), numLoad(0), startNumLoad(0),
+    : numInst(0), numOp(0), stats_thread(cpu, this),
+      numLoad(0), startNumLoad(0),
       _status(ThreadContext::Halted), baseCpu(cpu),
       _contextId(0), _threadId(_tid), lastActivate(0), lastSuspend(0),
       process(_process), physProxy(NULL), virtProxy(NULL),
@@ -116,3 +117,12 @@
     assert(virtProxy != NULL);
     return *virtProxy;
 }
+ThreadState::
+ThreadStateStats::ThreadStateStats(BaseCPU *cpu, ThreadState *thread)
+      : Stats::Group(cpu, "thread"),
+      ADD_STAT(numInsts, "Number of Instructions committed"),
+      ADD_STAT(numOps, "Number of Ops committed"),
+      ADD_STAT(numMemRefs, "Number of Memory References")
+      {
+
+      }
diff --git a/src/cpu/thread_state.hh b/src/cpu/thread_state.hh
index 1cc92a1..7615c27 100644
--- a/src/cpu/thread_state.hh
+++ b/src/cpu/thread_state.hh
@@ -106,14 +106,19 @@

     /** Number of instructions committed. */
     Counter numInst;
-    /** Stat for number instructions committed. */
-    Stats::Scalar numInsts;
-    /** Number of ops (including micro ops) committed. */
+     /** Number of ops (including micro ops) committed. */
     Counter numOp;
+        // Defining the a stat group
+    struct ThreadStateStats : public Stats::Group
+    {
+        ThreadStateStats(BaseCPU *cpu, ThreadState *thread);
+    /** Stat for number instructions committed. */
+        Stats::Scalar numInsts;
     /** Stat for number ops (including micro ops) committed. */
-    Stats::Scalar numOps;
+        Stats::Scalar numOps;
     /** Stat for number of memory references. */
-    Stats::Scalar numMemRefs;
+        Stats::Scalar numMemRefs;
+    } stats_thread;

     /** Number of simulated loads, used for tracking events based on
      * the number of loads committed.

--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/33400
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: Ib8cc8633ca5fced63918a7a6d10e15126f7c7459
Gerrit-Change-Number: 33400
Gerrit-PatchSet: 1
Gerrit-Owner: Eden Avivi <[email protected]>
Gerrit-MessageType: newchange
_______________________________________________
gem5-dev mailing list -- [email protected]
To unsubscribe send an email to [email protected]
%(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s

Reply via email to