[PowerPC] Keep vector int to fp conversions in vector domain
[llvm-core.git] / include / llvm / XRay / FDRTraceWriter.h
blob91488f89ecc529c3c8a2f239b54a60936a040ba7
1 //===- FDRTraceWriter.h - XRay FDR Trace Writer -----------------*- C++ -*-===//
2 //
3 // The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9 //
10 // Test a utility that can write out XRay FDR Mode formatted trace files.
12 //===----------------------------------------------------------------------===//
13 #ifndef LLVM_INCLUDE_LLVM_XRAY_FDRTRACEWRITER_H_
14 #define LLVM_INCLUDE_LLVM_XRAY_FDRTRACEWRITER_H_
16 #include "llvm/Support/raw_ostream.h"
17 #include "llvm/Support/EndianStream.h"
18 #include "llvm/XRay/FDRRecords.h"
19 #include "llvm/XRay/XRayRecord.h"
21 namespace llvm {
22 namespace xray {
24 /// The FDRTraceWriter allows us to hand-craft an XRay Flight Data Recorder
25 /// (FDR) mode log file. This is used primarily for testing, generating
26 /// sequences of FDR records that can be read/processed. It can also be used to
27 /// generate various kinds of execution traces without using the XRay runtime.
28 /// Note that this writer does not do any validation, but uses the types of
29 /// records defined in the FDRRecords.h file.
30 class FDRTraceWriter : public RecordVisitor {
31 public:
32 // Construct an FDRTraceWriter associated with an output stream.
33 explicit FDRTraceWriter(raw_ostream &O, const XRayFileHeader &H);
34 ~FDRTraceWriter();
36 Error visit(BufferExtents &) override;
37 Error visit(WallclockRecord &) override;
38 Error visit(NewCPUIDRecord &) override;
39 Error visit(TSCWrapRecord &) override;
40 Error visit(CustomEventRecord &) override;
41 Error visit(CallArgRecord &) override;
42 Error visit(PIDRecord &) override;
43 Error visit(NewBufferRecord &) override;
44 Error visit(EndBufferRecord &) override;
45 Error visit(FunctionRecord &) override;
47 private:
48 support::endian::Writer OS;
51 } // namespace xray
52 } // namespace llvm
54 #endif // LLVM_INCLUDE_LLVM_XRAY_FDRTRACEWRITER_H_