Helper code for dm-log-writes target.