simple-thread: give a name() function for debugging w/the SimpleThread object
authorKorey Sewell <ksewell@umich.edu>
Mon, 20 Jun 2011 01:43:33 +0000 (21:43 -0400)
committerKorey Sewell <ksewell@umich.edu>
Mon, 20 Jun 2011 01:43:33 +0000 (21:43 -0400)
src/cpu/simple_thread.hh

index dcf0663e24a248c5ab6e4baeac573bc29b0c41cf..a74616a0d783a25faf856b242ea0c216a2b90271 100644 (file)
@@ -114,6 +114,11 @@ class SimpleThread : public ThreadState
     bool predicate;
 
   public:
+    std::string name() const
+    {
+        return csprintf("%s.[tid:%i]", cpu->name(), tc->threadId());
+    }
+
     // pointer to CPU associated with this SimpleThread
     BaseCPU *cpu;