cpu: prefix ExecEnable to the native trace to match DPRINTF

The trace mechanism appears to be the only debug flag that does not
go through DPRINTF, presumably for performance reasons.

This patch manually adds that to make things uniform with other debug
flags, e.g. with FmtFlag,ExecAll,SyscallBase a sample output looks like
(truncated to fit into commit message lengths):

   0: ExecEnable: system.cpu : A0 T0 : @asm_main_after_prologue
 500: ExecEnable: system.cpu : A0 T0 : @asm_main_after_prologue+4
1000: ExecEnable: system.cpu : A0 T0 : @asm_main_after_prologue+8
1500: ExecEnable: system.cpu : A0 T0 : @asm_main_after_prologue+12
2000: ExecEnable: system.cpu : A0 T0 : @asm_main_after_prologue+16
2500: ExecEnable: system.cpu : A0 T0 : @asm_main_after_prologue+20
3000: ExecEnable: system.cpu : A0 T0 : @asm_main_after_prologue+24
3500: ExecEnable: system.cpu : A0 T0 : @asm_main_after_prologue+28

Change-Id: Ic371ebc8b0827656f1b78fcfd3f28505a5100274
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/22007
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Maintainer: Jason Lowe-Power <jason@lowepower.com>
Tested-by: kokoro <noreply+kokoro@google.com>
This commit is contained in:
Ciro Santilli
2019-10-08 14:52:03 +01:00
parent 1ef80a590e
commit ffd75f5942
2 changed files with 5 additions and 13 deletions

View File

@@ -46,6 +46,7 @@
#include "cpu/exetrace.hh"
#include <iomanip>
#include <sstream>
#include "arch/isa_traits.hh"
#include "arch/utility.hh"
@@ -63,16 +64,10 @@ using namespace TheISA;
namespace Trace {
void
ExeTracerRecord::dumpTicks(ostream &outs)
{
ccprintf(outs, "%7d: ", when);
}
void
Trace::ExeTracerRecord::traceInst(const StaticInstPtr &inst, bool ran)
{
ostream &outs = Trace::output();
std::stringstream outs;
if (!Debug::ExecUser || !Debug::ExecKernel) {
bool in_user_mode = TheISA::inUserMode(thread);
@@ -80,11 +75,6 @@ Trace::ExeTracerRecord::traceInst(const StaticInstPtr &inst, bool ran)
if (!in_user_mode && !Debug::ExecKernel) return;
}
if (!DTRACE(FmtTicksOff))
dumpTicks(outs);
outs << thread->getCpuPtr()->name() << " ";
if (Debug::ExecAsid)
outs << "A" << dec << TheISA::getExecutingAsid(thread) << " ";
@@ -185,6 +175,9 @@ Trace::ExeTracerRecord::traceInst(const StaticInstPtr &inst, bool ran)
// End of line...
//
outs << endl;
Trace::getDebugLogger()->dprintf_flag(
when, thread->getCpuPtr()->name(), "ExecEnable", outs.str().c_str());
}
void

View File

@@ -57,7 +57,6 @@ class ExeTracerRecord : public InstRecord
void traceInst(const StaticInstPtr &inst, bool ran);
void dump();
virtual void dumpTicks(std::ostream &outs);
};
class ExeTracer : public InstTracer