1 //===- xray-converter.h - XRay Trace Conversion ---------------------------===//
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 //===----------------------------------------------------------------------===//
9 // Defines the TraceConverter class for turning binary traces into
10 // human-readable text and vice versa.
12 //===----------------------------------------------------------------------===//
13 #ifndef LLVM_TOOLS_LLVM_XRAY_XRAY_CONVERTER_H
14 #define LLVM_TOOLS_LLVM_XRAY_XRAY_CONVERTER_H
16 #include "func-id-helper.h"
17 #include "llvm/XRay/Trace.h"
18 #include "llvm/XRay/XRayRecord.h"
23 class TraceConverter
{
24 FuncIdConversionHelper
&FuncIdHelper
;
28 TraceConverter(FuncIdConversionHelper
&FuncIdHelper
, bool Symbolize
= false)
29 : FuncIdHelper(FuncIdHelper
), Symbolize(Symbolize
) {}
31 void exportAsYAML(const Trace
&Records
, raw_ostream
&OS
);
32 void exportAsRAWv1(const Trace
&Records
, raw_ostream
&OS
);
34 /// For this conversion, the Function records within each thread are expected
35 /// to be in sorted TSC order. The trace event format encodes stack traces, so
36 /// the linear history is essential for correct output.
37 void exportAsChromeTraceEventFormat(const Trace
&Records
, raw_ostream
&OS
);
43 #endif // LLVM_TOOLS_LLVM_XRAY_XRAY_CONVERTER_H