FDRRecords.cpp 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. //===- FDRRecords.cpp - XRay Flight Data Recorder Mode Records -----------===//
  2. //
  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
  6. //
  7. //===----------------------------------------------------------------------===//
  8. //
  9. // Define types and operations on these types that represent the different kinds
  10. // of records we encounter in XRay flight data recorder mode traces.
  11. //
  12. //===----------------------------------------------------------------------===//
  13. #include "llvm/XRay/FDRRecords.h"
  14. namespace llvm {
  15. namespace xray {
  16. Error BufferExtents::apply(RecordVisitor &V) { return V.visit(*this); }
  17. Error WallclockRecord::apply(RecordVisitor &V) { return V.visit(*this); }
  18. Error NewCPUIDRecord::apply(RecordVisitor &V) { return V.visit(*this); }
  19. Error TSCWrapRecord::apply(RecordVisitor &V) { return V.visit(*this); }
  20. Error CustomEventRecord::apply(RecordVisitor &V) { return V.visit(*this); }
  21. Error CallArgRecord::apply(RecordVisitor &V) { return V.visit(*this); }
  22. Error PIDRecord::apply(RecordVisitor &V) { return V.visit(*this); }
  23. Error NewBufferRecord::apply(RecordVisitor &V) { return V.visit(*this); }
  24. Error EndBufferRecord::apply(RecordVisitor &V) { return V.visit(*this); }
  25. Error FunctionRecord::apply(RecordVisitor &V) { return V.visit(*this); }
  26. Error CustomEventRecordV5::apply(RecordVisitor &V) { return V.visit(*this); }
  27. Error TypedEventRecord::apply(RecordVisitor &V) { return V.visit(*this); }
  28. StringRef Record::kindToString(RecordKind K) {
  29. switch (K) {
  30. case RecordKind::RK_Metadata:
  31. return "Metadata";
  32. case RecordKind::RK_Metadata_BufferExtents:
  33. return "Metadata:BufferExtents";
  34. case RecordKind::RK_Metadata_WallClockTime:
  35. return "Metadata:WallClockTime";
  36. case RecordKind::RK_Metadata_NewCPUId:
  37. return "Metadata:NewCPUId";
  38. case RecordKind::RK_Metadata_TSCWrap:
  39. return "Metadata:TSCWrap";
  40. case RecordKind::RK_Metadata_CustomEvent:
  41. return "Metadata:CustomEvent";
  42. case RecordKind::RK_Metadata_CustomEventV5:
  43. return "Metadata:CustomEventV5";
  44. case RecordKind::RK_Metadata_CallArg:
  45. return "Metadata:CallArg";
  46. case RecordKind::RK_Metadata_PIDEntry:
  47. return "Metadata:PIDEntry";
  48. case RecordKind::RK_Metadata_NewBuffer:
  49. return "Metadata:NewBuffer";
  50. case RecordKind::RK_Metadata_EndOfBuffer:
  51. return "Metadata:EndOfBuffer";
  52. case RecordKind::RK_Metadata_TypedEvent:
  53. return "Metadata:TypedEvent";
  54. case RecordKind::RK_Metadata_LastMetadata:
  55. return "Metadata:LastMetadata";
  56. case RecordKind::RK_Function:
  57. return "Function";
  58. }
  59. return "Unknown";
  60. }
  61. } // namespace xray
  62. } // namespace llvm