[05/15] Backend: Add profiling registers to curbe.

Submitted by junyan.he@inbox.com on Aug. 12, 2015, 8:48 a.m.

Details

Message ID 1439369333-21547-1-git-send-email-junyan.he@inbox.com
State New
Headers show

Not browsing as part of any series.

Commit Message

junyan.he@inbox.com Aug. 12, 2015, 8:48 a.m.
From: Junyan He <junyan.he@linux.intel.com>

Add four timestamp reigsters and one pointer register
into curbe. The four timestamp reigsters will hold
all the infomation of profiling timestamps, includes
20 uint timestamps for each point, 1 ulong prolog holding
the start time and and 1 ulong epilog holding the
end time of that kernel. The pointer reigster will hold
the log buffer address.

Signed-off-by: Junyan He <junyan.he@linux.intel.com>
---
 backend/src/backend/program.h |    5 +++++
 backend/src/ir/profile.cpp    |   12 +++++++++++-
 backend/src/ir/profile.hpp    |    7 ++++++-
 3 files changed, 22 insertions(+), 2 deletions(-)

Patch hide | download patch | download mbox

diff --git a/backend/src/backend/program.h b/backend/src/backend/program.h
index 3637ebb..bf1c1ba 100644
--- a/backend/src/backend/program.h
+++ b/backend/src/backend/program.h
@@ -104,6 +104,11 @@  enum gbe_curbe_type {
   GBE_CURBE_LANE_ID,
   GBE_CURBE_SLM_OFFSET,
   GBE_CURBE_BTI_UTIL,
+  GBE_CURBE_PROFILING_BUF_POINTER,
+  GBE_CURBE_PROFILING_TIMESTAMP0,
+  GBE_CURBE_PROFILING_TIMESTAMP1,
+  GBE_CURBE_PROFILING_TIMESTAMP2,
+  GBE_CURBE_PROFILING_TIMESTAMP3,
 };
 
 /*! Extra arguments use the negative range of sub-values */
diff --git a/backend/src/ir/profile.cpp b/backend/src/ir/profile.cpp
index af9f698..084bfdd 100644
--- a/backend/src/ir/profile.cpp
+++ b/backend/src/ir/profile.cpp
@@ -46,7 +46,12 @@  namespace ir {
         "dwblockip",
         "lane_id",
         "invalid",
-        "bti_utility"
+        "bti_utility",
+        "profiling_buffer_pointer",
+        "profiling_timestamps0",
+        "profiling_timestamps1",
+        "profiling_timestamps2",
+        "profiling_timestamps3"
     };
 
 #if GBE_DEBUG
@@ -93,6 +98,11 @@  namespace ir {
       DECL_NEW_REG(FAMILY_DWORD, laneid, 0);
       DECL_NEW_REG(FAMILY_DWORD, invalid, 1);
       DECL_NEW_REG(FAMILY_DWORD, btiUtil, 1);
+      DECL_NEW_REG(FAMILY_DWORD, profilingbptr, 1);
+      DECL_NEW_REG(FAMILY_DWORD, profilingts0, 0);
+      DECL_NEW_REG(FAMILY_DWORD, profilingts1, 0);
+      DECL_NEW_REG(FAMILY_DWORD, profilingts2, 0);
+      DECL_NEW_REG(FAMILY_DWORD, profilingts3, 0);
     }
 #undef DECL_NEW_REG
 
diff --git a/backend/src/ir/profile.hpp b/backend/src/ir/profile.hpp
index 9323824..d06f831 100644
--- a/backend/src/ir/profile.hpp
+++ b/backend/src/ir/profile.hpp
@@ -75,7 +75,12 @@  namespace ir {
     static const Register laneid = Register(31);  // lane id.
     static const Register invalid = Register(32);  // used for valid comparation.
     static const Register btiUtil = Register(33);  // used for mixed pointer as bti utility.
-    static const uint32_t regNum = 34;             // number of special registers
+    static const Register profilingbptr = Register(34); // buffer addr for profiling.
+    static const Register profilingts0 = Register(35); // timestamp for profiling.
+    static const Register profilingts1 = Register(36); // timestamp for profiling.
+    static const Register profilingts2 = Register(37); // timestamp for profiling.
+    static const Register profilingts3 = Register(38); // timestamp for profiling.
+    static const uint32_t regNum = 39;             // number of special registers
     extern const char *specialRegMean[];           // special register name.
   } /* namespace ocl */