Merge zizzer.eecs.umich.edu:/z/m5/Bitkeeper/m5
[gem5.git] / cpu / exetrace.cc
index 8e200f1e070f34d6447b8eea276e90c095afa317..8393a1b8528fb3c78fd38ad9d4defe0d87f6fd8f 100644 (file)
@@ -52,14 +52,22 @@ void
 Trace::InstRecord::dump(ostream &outs)
 {
     if (flags[INTEL_FORMAT]) {
-        ccprintf(outs, "%7d ) ", cycle);
-        outs << "0x" << hex << PC << ":\t";
-        if (staticInst->isLoad()) {
-            outs << "<RD 0x" << hex << addr;
-            outs << ">";
-        } else if (staticInst->isStore()) {
-            outs << "<WR 0x" << hex << addr;
-            outs << ">";
+#if FULL_SYSTEM
+        bool is_trace_system = (cpu->system->name() == trace_system);
+#else
+        bool is_trace_system = true;
+#endif
+        if (is_trace_system) {
+            ccprintf(outs, "%7d ) ", cycle);
+            outs << "0x" << hex << PC << ":\t";
+            if (staticInst->isLoad()) {
+                outs << "<RD 0x" << hex << addr;
+                outs << ">";
+            } else if (staticInst->isStore()) {
+                outs << "<WR 0x" << hex << addr;
+                outs << ">";
+            }
+            outs << endl;
         }
     } else {
         if (flags[PRINT_CYCLE])
@@ -135,15 +143,17 @@ Trace::InstRecord::dump(ostream &outs)
 
         if (flags[PRINT_CP_SEQ] && cp_seq_valid)
             outs << "  CPSeq=" << dec << cp_seq;
+
+        //
+        //  End of line...
+        //
+        outs << endl;
     }
-    //
-    //  End of line...
-    //
-    outs << endl;
 }
 
 
 vector<bool> Trace::InstRecord::flags(NUM_BITS);
+string Trace::InstRecord::trace_system;
 
 ////////////////////////////////////////////////////////////////////////
 //
@@ -184,6 +194,9 @@ Param<bool> exe_trace_print_cp_seq(&exeTraceParams, "print_cpseq",
                                   "print correct-path sequence number", false);
 Param<bool> exe_trace_intel_format(&exeTraceParams, "intel_format",
                                    "print trace in intel compatible format", false);
+Param<string> exe_trace_system(&exeTraceParams, "trace_system",
+                                   "print trace of which system (client or server)",
+                                   "client");
 
 
 //
@@ -204,6 +217,7 @@ Trace::InstRecord::setParams()
     flags[PRINT_FETCH_SEQ]   = exe_trace_print_fetchseq;
     flags[PRINT_CP_SEQ]      = exe_trace_print_cp_seq;
     flags[INTEL_FORMAT]      = exe_trace_intel_format;
+    trace_system            = exe_trace_system;
 }
 
 void