Path: blob/main/contrib/llvm-project/llvm/tools/llvm-xray/xray-converter.h
35231 views
//===- xray-converter.h - XRay Trace Conversion ---------------------------===//1//2// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.3// See https://llvm.org/LICENSE.txt for license information.4// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception5//6//===----------------------------------------------------------------------===//7//8// Defines the TraceConverter class for turning binary traces into9// human-readable text and vice versa.10//11//===----------------------------------------------------------------------===//12#ifndef LLVM_TOOLS_LLVM_XRAY_XRAY_CONVERTER_H13#define LLVM_TOOLS_LLVM_XRAY_XRAY_CONVERTER_H1415#include "func-id-helper.h"16#include "llvm/XRay/Trace.h"17#include "llvm/XRay/XRayRecord.h"1819namespace llvm {20namespace xray {2122class TraceConverter {23FuncIdConversionHelper &FuncIdHelper;24bool Symbolize;2526public:27TraceConverter(FuncIdConversionHelper &FuncIdHelper, bool Symbolize = false)28: FuncIdHelper(FuncIdHelper), Symbolize(Symbolize) {}2930void exportAsYAML(const Trace &Records, raw_ostream &OS);31void exportAsRAWv1(const Trace &Records, raw_ostream &OS);3233/// For this conversion, the Function records within each thread are expected34/// to be in sorted TSC order. The trace event format encodes stack traces, so35/// the linear history is essential for correct output.36void exportAsChromeTraceEventFormat(const Trace &Records, raw_ostream &OS);37};3839} // namespace xray40} // namespace llvm4142#endif // LLVM_TOOLS_LLVM_XRAY_XRAY_CONVERTER_H434445