diff options
author | Andreas Hansson <andreas.hansson@arm.com> | 2015-09-25 13:25:34 -0400 |
---|---|---|
committer | Andreas Hansson <andreas.hansson@arm.com> | 2015-09-25 13:25:34 -0400 |
commit | 9a0129dcbf3cc223c88b8c0bc46ac9b375c11abf (patch) | |
tree | 184f8bcb5f9ef6a1bc530608c00f7469a556e65f /src/mem/probes/mem_trace.hh | |
parent | 806e1fbf0f63d386d4ae80ff0d4ab77e6c37f9d6 (diff) | |
download | gem5-9a0129dcbf3cc223c88b8c0bc46ac9b375c11abf.tar.xz |
mem: Add PacketInfo to be used for packet probe points
This patch fixes a use-after-delete issue in the packet probe points
by adding a PacketInfo struct to retain the key fields before passing
the packet onwards. We want to probe the packet after it is
successfully sent, but by that time the fields may be modified, and
the packet may even be deleted.
Amazingly enough the issue has gone undetected for months, and only
recently popped up in our regressions.
Diffstat (limited to 'src/mem/probes/mem_trace.hh')
-rw-r--r-- | src/mem/probes/mem_trace.hh | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/mem/probes/mem_trace.hh b/src/mem/probes/mem_trace.hh index 677b8ae32..51f272812 100644 --- a/src/mem/probes/mem_trace.hh +++ b/src/mem/probes/mem_trace.hh @@ -52,7 +52,8 @@ class MemTraceProbe : public BaseMemProbe MemTraceProbe(MemTraceProbeParams *params); protected: - void handleRequest(const PacketPtr &pkt) M5_ATTR_OVERRIDE; + void handleRequest(const ProbePoints::PacketInfo &pkt_info) \ + M5_ATTR_OVERRIDE; /** * Callback to flush and close all open output streams on exit. If |