RecordPrinter.h 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. #pragma once
  2. #ifdef __GNUC__
  3. #pragma GCC diagnostic push
  4. #pragma GCC diagnostic ignored "-Wunused-parameter"
  5. #endif
  6. //===- RecordPrinter.h - FDR Record Printer -------------------------------===//
  7. //
  8. // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
  9. // See https://llvm.org/LICENSE.txt for license information.
  10. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
  11. //
  12. //===----------------------------------------------------------------------===//
  13. //
  14. // An implementation of the RecordVisitor which prints an individual record's
  15. // data in an adhoc format, suitable for human inspection.
  16. //
  17. //===----------------------------------------------------------------------===//
  18. #ifndef LLVM_INCLUDE_LLVM_XRAY_RECORDPRINTER_H_
  19. #define LLVM_INCLUDE_LLVM_XRAY_RECORDPRINTER_H_
  20. #include "llvm/Support/raw_ostream.h"
  21. #include "llvm/XRay/FDRRecords.h"
  22. namespace llvm {
  23. namespace xray {
  24. class RecordPrinter : public RecordVisitor {
  25. raw_ostream &OS;
  26. std::string Delim;
  27. public:
  28. explicit RecordPrinter(raw_ostream &O, std::string D)
  29. : RecordVisitor(), OS(O), Delim(std::move(D)) {}
  30. explicit RecordPrinter(raw_ostream &O) : RecordPrinter(O, ""){};
  31. Error visit(BufferExtents &) override;
  32. Error visit(WallclockRecord &) override;
  33. Error visit(NewCPUIDRecord &) override;
  34. Error visit(TSCWrapRecord &) override;
  35. Error visit(CustomEventRecord &) override;
  36. Error visit(CallArgRecord &) override;
  37. Error visit(PIDRecord &) override;
  38. Error visit(NewBufferRecord &) override;
  39. Error visit(EndBufferRecord &) override;
  40. Error visit(FunctionRecord &) override;
  41. Error visit(CustomEventRecordV5 &) override;
  42. Error visit(TypedEventRecord &) override;
  43. };
  44. } // namespace xray
  45. } // namespace llvm
  46. #endif // LLVM_INCLUDE_LLVM_XRAY_RECORDPRINTER_H
  47. #ifdef __GNUC__
  48. #pragma GCC diagnostic pop
  49. #endif