aras-p / ClangBuildAnalyzer

Clang build analysis tool using -ftime-trace
The Unlicense
1.01k stars 65 forks source link

Support parsing LLVM's new JSON streaming API #25

Closed mendsley closed 4 years ago

mendsley commented 5 years ago

LLVM added a JSON steaming output API in https://reviews.llvm.org/D60804 and updated the TimeProfiler to use it: https://github.com/llvm-mirror/llvm/blob/master/lib/Support/TimeProfiler.cpp#L164

This adds "prettifies" the JSON with whitespace and causes the "clang" metadata element to output as: { "args": { "name": "clang" }, "cat": "", "name": "process_name", "ph": "M", "pid": 1, "tid": 0, "ts": 0 }

This fails the quick check when scanning for files. The output from the JSON formatter appears to be deterministic; this change adds the new output format.

aras-p commented 4 years ago

Hmm I'm testing with current LLVM/Clang 10.0 RC2 builds, and everything "just works" without this PR even. The JSON emitted by clang has the marker like {"cat":"","pid":1,"tid":0,"ts":0,"ph":"M","name":"process_name","args":{"name":"clang-cl.exe"}} and the current detection code handles it just fine.

I guess I'll close the PR; reopen it if you see different behavior.