Tiago Mück has submitted this change. ( https://gem5-review.googlesource.com/c/public/gem5/+/41158 )

Change subject: mem-ruby: extended transaction profiling
......................................................................

mem-ruby: extended transaction profiling

Adds additional stats to accounts for incoming and outgoing retries.

Calling incomingTransactionStart with retried==true indicates the
received request initiating the transaction is a retried request.

Calling outgoingTransactionEnd with retried==true indicates the request
was retried by the requester.

Change-Id: I22fd971d4997fce0c114b5ec030cbbf9b463d0c6
Signed-off-by: Tiago Mück <[email protected]>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/41158
Reviewed-by: Hoa Nguyen <[email protected]>
Reviewed-by: Jason Lowe-Power <[email protected]>
Maintainer: Jason Lowe-Power <[email protected]>
Tested-by: kokoro <[email protected]>
---
M src/mem/ruby/slicc_interface/AbstractController.hh
M src/mem/slicc/symbols/StateMachine.py
2 files changed, 30 insertions(+), 3 deletions(-)

Approvals:
  Jason Lowe-Power: Looks good to me, approved; Looks good to me, approved
  Hoa Nguyen: Looks good to me, approved
  kokoro: Regressions pass



diff --git a/src/mem/ruby/slicc_interface/AbstractController.hh b/src/mem/ruby/slicc_interface/AbstractController.hh
index 214b072..95be144 100644
--- a/src/mem/ruby/slicc_interface/AbstractController.hh
+++ b/src/mem/ruby/slicc_interface/AbstractController.hh
@@ -216,10 +216,12 @@
      */
     template<typename EventType, typename StateType>
     void incomingTransactionStart(Addr addr,
-        EventType type, StateType initialState)
+        EventType type, StateType initialState, bool retried)
     {
         assert(m_inTrans.find(addr) == m_inTrans.end());
         m_inTrans[addr] = {type, initialState, curTick()};
+        if (retried)
+          ++(*stats.inTransLatRetries[type]);
     }

     /**
@@ -237,6 +239,7 @@
                               [iter->second.state]
                               [(unsigned)finalState]->sample(
ticksToCycles(curTick() - iter->second.time));
+        ++(*stats.inTransLatTotal[iter->second.transaction]);
        m_inTrans.erase(iter);
     }

@@ -260,12 +263,14 @@
      *
      * @param addr address of the line with an outstanding transaction
      */
-    void outgoingTransactionEnd(Addr addr)
+    void outgoingTransactionEnd(Addr addr, bool retried)
     {
         auto iter = m_outTrans.find(addr);
         assert(iter != m_outTrans.end());
         stats.outTransLatHist[iter->second.transaction]->sample(
             ticksToCycles(curTick() - iter->second.time));
+        if (retried)
+          ++(*stats.outTransLatHistRetries[iter->second.transaction]);
         m_outTrans.erase(iter);
     }

@@ -356,10 +361,13 @@
         // states. Only histograms with samples will appear in the stats
         std::vector<std::vector<std::vector<Stats::Histogram*>>>
           inTransLatHist;
+        std::vector<Stats::Scalar*> inTransLatRetries;
+        std::vector<Stats::Scalar*> inTransLatTotal;

         // Initialized by the SLICC compiler for all events.
         // Only histograms with samples will appear in the stats.
         std::vector<Stats::Histogram*> outTransLatHist;
+        std::vector<Stats::Scalar*> outTransLatHistRetries;

//! Counter for the number of cycles when the transitions carried out
         //! were equal to the maximum allowed
diff --git a/src/mem/slicc/symbols/StateMachine.py b/src/mem/slicc/symbols/StateMachine.py
index 23f8707..012441d 100644
--- a/src/mem/slicc/symbols/StateMachine.py
+++ b/src/mem/slicc/symbols/StateMachine.py
@@ -1,4 +1,4 @@
-# Copyright (c) 2019-2020 ARM Limited
+# Copyright (c) 2019-2021 ARM Limited
 # All rights reserved.
 #
 # The license below extends only to copyright in the software and shall
@@ -849,6 +849,7 @@
             }
         }
     }
+
     for (${ident}_Event event = ${ident}_Event_FIRST;
                  event < ${ident}_Event_NUM; ++event) {
         std::string stat_name =
@@ -858,9 +859,27 @@
         t->init(5);
         t->flags(Stats::pdf | Stats::total |
                  Stats::oneline | Stats::nozero);
+
+        Stats::Scalar* r = new Stats::Scalar(&stats,
+ (stat_name + ".retries").c_str());
+        stats.outTransLatHistRetries.push_back(r);
+        r->flags(Stats::nozero);
     }
+
     for (${ident}_Event event = ${ident}_Event_FIRST;
                  event < ${ident}_Event_NUM; ++event) {
+        std::string stat_name = ".inTransLatHist." +
+                                ${ident}_Event_to_string(event);
+        Stats::Scalar* r = new Stats::Scalar(&stats,
+ (stat_name + ".total").c_str());
+        stats.inTransLatTotal.push_back(r);
+        r->flags(Stats::nozero);
+
+        r = new Stats::Scalar(&stats,
+                              (stat_name + ".retries").c_str());
+        stats.inTransLatRetries.push_back(r);
+        r->flags(Stats::nozero);
+
         stats.inTransLatHist.emplace_back();
         for (${ident}_State initial_state = ${ident}_State_FIRST;
              initial_state < ${ident}_State_NUM; ++initial_state) {

--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/41158
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: I22fd971d4997fce0c114b5ec030cbbf9b463d0c6
Gerrit-Change-Number: 41158
Gerrit-PatchSet: 5
Gerrit-Owner: Tiago Mück <[email protected]>
Gerrit-Reviewer: Hoa Nguyen <[email protected]>
Gerrit-Reviewer: Jason Lowe-Power <[email protected]>
Gerrit-Reviewer: Jason Lowe-Power <[email protected]>
Gerrit-Reviewer: Tiago Mück <[email protected]>
Gerrit-Reviewer: kokoro <[email protected]>
Gerrit-CC: Giacomo Travaglini <[email protected]>
Gerrit-MessageType: merged
_______________________________________________
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