summaryrefslogtreecommitdiff
path: root/src/cpu
diff options
context:
space:
mode:
Diffstat (limited to 'src/cpu')
-rw-r--r--src/cpu/base.cc4
-rw-r--r--src/cpu/o3/thread_state.hh6
-rw-r--r--src/cpu/simple/probes/simpoint.cc6
-rw-r--r--src/cpu/simple/probes/simpoint.hh3
-rw-r--r--src/cpu/simple_thread.cc6
5 files changed, 13 insertions, 12 deletions
diff --git a/src/cpu/base.cc b/src/cpu/base.cc
index 0e8c2930f..22fca4dc5 100644
--- a/src/cpu/base.cc
+++ b/src/cpu/base.cc
@@ -218,9 +218,7 @@ BaseCPU::BaseCPU(Params *p, bool is_checker)
functionTracingEnabled = false;
if (p->function_trace) {
const string fname = csprintf("ftrace.%s", name());
- functionTraceStream = simout.find(fname);
- if (!functionTraceStream)
- functionTraceStream = simout.create(fname);
+ functionTraceStream = simout.findOrCreate(fname)->stream();
currentFunctionStart = currentFunctionEnd = 0;
functionEntryTick = p->function_trace_start;
diff --git a/src/cpu/o3/thread_state.hh b/src/cpu/o3/thread_state.hh
index 19235c44c..7765f86ea 100644
--- a/src/cpu/o3/thread_state.hh
+++ b/src/cpu/o3/thread_state.hh
@@ -144,8 +144,10 @@ struct O3ThreadState : public ThreadState {
void dumpFuncProfile()
{
- std::ostream *os = simout.create(csprintf("profile.%s.dat", cpu->name()));
- profile->dump(tc, *os);
+ OutputStream *os(
+ simout.create(csprintf("profile.%s.dat", cpu->name())));
+ profile->dump(tc, *os->stream());
+ simout.close(os);
}
};
diff --git a/src/cpu/simple/probes/simpoint.cc b/src/cpu/simple/probes/simpoint.cc
index 2de3cd420..4f4b5da39 100644
--- a/src/cpu/simple/probes/simpoint.cc
+++ b/src/cpu/simple/probes/simpoint.cc
@@ -126,13 +126,13 @@ SimPoint::profile(const std::pair<SimpleThread*, StaticInstPtr>& p)
std::sort(counts.begin(), counts.end());
// Print output BBV info
- *simpointStream << "T";
+ *simpointStream->stream() << "T";
for (auto cnt_itr = counts.begin(); cnt_itr != counts.end();
++cnt_itr) {
- *simpointStream << ":" << cnt_itr->first
+ *simpointStream->stream() << ":" << cnt_itr->first
<< ":" << cnt_itr->second << " ";
}
- *simpointStream << "\n";
+ *simpointStream->stream() << "\n";
intervalDrift = (intervalCount + intervalDrift) - intervalSize;
intervalCount = 0;
diff --git a/src/cpu/simple/probes/simpoint.hh b/src/cpu/simple/probes/simpoint.hh
index 2f4ed080d..2873ae410 100644
--- a/src/cpu/simple/probes/simpoint.hh
+++ b/src/cpu/simple/probes/simpoint.hh
@@ -43,6 +43,7 @@
#include <unordered_map>
+#include "base/output.hh"
#include "cpu/simple_thread.hh"
#include "params/SimPoint.hh"
#include "sim/probe/probe.hh"
@@ -97,7 +98,7 @@ class SimPoint : public ProbeListenerObject
/** Excess inst count from previous interval*/
uint64_t intervalDrift;
/** Pointer to SimPoint BBV output stream */
- std::ostream *simpointStream;
+ OutputStream *simpointStream;
/** Basic Block information */
struct BBInfo {
diff --git a/src/cpu/simple_thread.cc b/src/cpu/simple_thread.cc
index 5e457f692..33c5b47ea 100644
--- a/src/cpu/simple_thread.cc
+++ b/src/cpu/simple_thread.cc
@@ -154,9 +154,9 @@ SimpleThread::startup()
void
SimpleThread::dumpFuncProfile()
{
- std::ostream *os = simout.create(csprintf("profile.%s.dat",
- baseCpu->name()));
- profile->dump(tc, *os);
+ OutputStream *os(simout.create(csprintf("profile.%s.dat", baseCpu->name())));
+ profile->dump(tc, *os->stream());
+ simout.close(os);
}
void