mem: Add PacketInfo to be used for packet probe points
authorAndreas Hansson <andreas.hansson@arm.com>
Fri, 25 Sep 2015 17:25:34 +0000 (13:25 -0400)
committerAndreas Hansson <andreas.hansson@arm.com>
Fri, 25 Sep 2015 17:25:34 +0000 (13:25 -0400)
commit9a0129dcbf3cc223c88b8c0bc46ac9b375c11abf
tree184f8bcb5f9ef6a1bc530608c00f7469a556e65f
parent806e1fbf0f63d386d4ae80ff0d4ab77e6c37f9d6
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.
src/mem/comm_monitor.cc
src/mem/probes/base.hh
src/mem/probes/mem_trace.cc
src/mem/probes/mem_trace.hh
src/mem/probes/stack_dist.cc
src/mem/probes/stack_dist.hh
src/sim/probe/mem.hh