summaryrefslogtreecommitdiff
path: root/src/cpu/base.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/cpu/base.cc')
-rw-r--r--src/cpu/base.cc6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/cpu/base.cc b/src/cpu/base.cc
index 76c7c964b..c37f45856 100644
--- a/src/cpu/base.cc
+++ b/src/cpu/base.cc
@@ -190,7 +190,11 @@ BaseCPU::BaseCPU(Params *p)
functionTracingEnabled = false;
if (p->function_trace) {
- functionTraceStream = simout.find(csprintf("ftrace.%s", name()));
+ const string fname = csprintf("ftrace.%s", name());
+ functionTraceStream = simout.find(fname);
+ if (!functionTraceStream)
+ functionTraceStream = simout.create(fname);
+
currentFunctionStart = currentFunctionEnd = 0;
functionEntryTick = p->function_trace_start;