summaryrefslogtreecommitdiff
path: root/src/cpu/exetrace.cc
diff options
context:
space:
mode:
authorCiro Santilli <ciro.santilli@arm.com>2019-10-08 14:52:03 +0100
committerCiro Santilli <ciro.santilli@arm.com>2019-11-26 12:46:59 +0000
commitffd75f5942c6654950810a95dd07326ea85a5084 (patch)
tree259b29e4fc22a71ee52ebc38b9373255f00c2c10 /src/cpu/exetrace.cc
parent1ef80a590e509daa70e08c44f22f8f2cfbcf4bc1 (diff)
downloadgem5-ffd75f5942c6654950810a95dd07326ea85a5084.tar.xz
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>
Diffstat (limited to 'src/cpu/exetrace.cc')
-rw-r--r--src/cpu/exetrace.cc17
1 files changed, 5 insertions, 12 deletions
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 <iomanip>
+#include <sstream>
#include "arch/isa_traits.hh"
#include "arch/utility.hh"
@@ -64,15 +65,9 @@ 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