pub fn write_trace(path: &str, frames: &[TraceFrame]) -> Result<(), String>
写出 trace JSON(末尾补换行,便于 diff)。