From: Ciro Santilli Date: Tue, 8 Oct 2019 13:52:03 +0000 (+0100) Subject: cpu: prefix ExecEnable to the native trace to match DPRINTF X-Git-Tag: v19.0.0.0~258 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=ffd75f5942c6654950810a95dd07326ea85a5084;p=gem5.git 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 Maintainer: Jason Lowe-Power Tested-by: kokoro --- diff --git a/src/cpu/exetrace.cc b/src/cpu/exetrace.cc index bbfd3d3cd..aeb17078c 100644 --- a/src/cpu/exetrace.cc +++ b/src/cpu/exetrace.cc @@ -46,6 +46,7 @@ #include "cpu/exetrace.hh" #include +#include #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 diff --git a/src/cpu/exetrace.hh b/src/cpu/exetrace.hh index b7e808a2a..b9ffb41ae 100644 --- a/src/cpu/exetrace.hh +++ b/src/cpu/exetrace.hh @@ -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