Merge "Add API for writing WM trace to file"