[tools/perf]: Atomically move results of trace2html, and fix a bug
If pinpoint_traces.py is interrupted while html2trace is busy, the next extraction would take partial results. To make the process robust in presence of interruptions, create a temporary directory for html2trace, then atomically rename it to the directory that will be searched on extraction. The operation may seem not equivalent to creating a '.tmp.json' and renaming it, because this is indeed not equivalent. This change fixes the bug that I missed in previous testing when I forgot to delete the json_cache, hence this code was not executing. This time json_cache was deleted before testing. Bug: 1119406 Change-Id: I7cfb19572a9ffa26827dd113bb92b2253b0a2b2c Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2637838Reviewed-by:John Chen <johnchen@chromium.org> Commit-Queue: Egor Pasko <pasko@chromium.org> Cr-Commit-Position: refs/heads/master@{#844817}
Showing
Please register or sign in to comment