Record and replay based virtual-machine introspection for system security