summaryrefslogtreecommitdiff
path: root/src/mem/comm_monitor.hh
diff options
context:
space:
mode:
authorAndreas Hansson <andreas.hansson@arm.com>2013-01-07 13:05:37 -0500
committerAndreas Hansson <andreas.hansson@arm.com>2013-01-07 13:05:37 -0500
commitf456c7983ded455b006d25a9c5e17401f6c22dca (patch)
tree622f60618aa3158e8f4d757e3dcc3536a5bb3057 /src/mem/comm_monitor.hh
parent11ab30fa5a4f56e4f7ea3b5b51e529bc246d1d35 (diff)
downloadgem5-f456c7983ded455b006d25a9c5e17401f6c22dca.tar.xz
mem: Add tracing support in the communication monitor
This patch adds packet tracing to the communication monitor using a protobuf as the mechanism for creating the trace. If no file is specified, then the tracing is disabled. If a file is specified, then for every packet that is successfully sent, a protobuf message is serialized to the file.
Diffstat (limited to 'src/mem/comm_monitor.hh')
-rw-r--r--src/mem/comm_monitor.hh12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/mem/comm_monitor.hh b/src/mem/comm_monitor.hh
index e59b8c467..271ae5fff 100644
--- a/src/mem/comm_monitor.hh
+++ b/src/mem/comm_monitor.hh
@@ -45,6 +45,7 @@
#include "base/time.hh"
#include "mem/mem_object.hh"
#include "params/CommMonitor.hh"
+#include "proto/protoio.hh"
/**
* The communication monitor is a MemObject which can monitor statistics of
@@ -75,7 +76,13 @@ class CommMonitor : public MemObject
CommMonitor(Params* params);
/** Destructor */
- ~CommMonitor() { }
+ ~CommMonitor() {}
+
+ /**
+ * Callback to flush and close all open output streams on exit. If
+ * we were calling the destructor it could be done there.
+ */
+ void closeStreams();
virtual BaseMasterPort& getMasterPort(const std::string& if_name,
PortID idx = InvalidPortID);
@@ -427,6 +434,9 @@ class CommMonitor : public MemObject
/** Instantiate stats */
MonitorStats stats;
+
+ /** Output stream for a potential trace. */
+ ProtoOutputStream* traceStream;
};
#endif //__MEM_COMM_MONITOR_HH__