System and Method to Instrument References to Shared Memory