1 //===- BlockPrinter.cpp - FDR Block Pretty Printer Implementation --------===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
9 #include "llvm/XRay/BlockPrinter.h"
14 Error
BlockPrinter::visit(BufferExtents
&R
) {
15 OS
<< "\n[New Block]\n";
16 CurrentState
= State::Preamble
;
21 Error
BlockPrinter::visit(NewBufferRecord
&R
) {
22 if (CurrentState
== State::Start
)
23 OS
<< "\n[New Block]\n";
26 CurrentState
= State::Preamble
;
30 Error
BlockPrinter::visit(WallclockRecord
&R
) {
31 CurrentState
= State::Preamble
;
35 Error
BlockPrinter::visit(PIDRecord
&R
) {
36 CurrentState
= State::Preamble
;
41 Error
BlockPrinter::visit(NewCPUIDRecord
&R
) {
42 if (CurrentState
== State::Preamble
)
44 if (CurrentState
== State::Function
)
46 CurrentState
= State::Metadata
;
52 Error
BlockPrinter::visit(TSCWrapRecord
&R
) {
53 if (CurrentState
== State::Function
)
55 CurrentState
= State::Metadata
;
61 // Custom events will be rendered like "function" events.
62 Error
BlockPrinter::visit(CustomEventRecord
&R
) {
63 if (CurrentState
== State::Metadata
)
65 CurrentState
= State::CustomEvent
;
71 // Function call printing.
72 Error
BlockPrinter::visit(FunctionRecord
&R
) {
73 if (CurrentState
== State::Metadata
)
75 CurrentState
= State::Function
;
81 Error
BlockPrinter::visit(CallArgRecord
&R
) {
82 CurrentState
= State::Arg
;
88 Error
BlockPrinter::visit(EndBufferRecord
&R
) {
89 CurrentState
= State::End
;