From: Dean Michael Berris Date: Tue, 24 Jul 2018 01:45:34 +0000 (+0000) Subject: llvm-xray: Broken chrome trace event format output X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=46356154bf72d1912782ccc231d51c0a542dded8;p=llvm llvm-xray: Broken chrome trace event format output Summary: Missing comma separator for EXIT and TAIL_EXIT RecordTypes emit invalid JSON output for Chrome Trace Event Format. Reviewers: dberris Reviewed By: dberris Subscribers: sammccall, kpw, llvm-commits Differential Revision: https://reviews.llvm.org/D49687 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@337795 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/tools/llvm-xray/xray-converter.cpp b/tools/llvm-xray/xray-converter.cpp index 1563ef1faec..90e14d0d889 100644 --- a/tools/llvm-xray/xray-converter.cpp +++ b/tools/llvm-xray/xray-converter.cpp @@ -313,6 +313,9 @@ void TraceConverter::exportAsChromeTraceEventFormat(const Trace &Records, // (And/Or in loop termination below) StackTrieNode *PreviousCursor = nullptr; do { + if (PreviousCursor != nullptr) { + OS << ",\n"; + } writeTraceViewerRecord(Version, OS, StackCursor->FuncId, R.TId, R.PId, Symbolize, FuncIdHelper, EventTimestampUs, *StackCursor, "E");