1 //===- XRayRecord.h - XRay Trace Record -----------------------------------===//
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 //===----------------------------------------------------------------------===//
10 // This file replicates the record definition for XRay log entries. This should
11 // follow the evolution of the log record versions supported in the compiler-rt
14 //===----------------------------------------------------------------------===//
15 #ifndef LLVM_XRAY_XRAY_RECORD_H
16 #define LLVM_XRAY_XRAY_RECORD_H
23 /// XRay traces all have a header providing some top-matter information useful
24 /// to help tools determine how to interpret the information available in the
26 struct XRayFileHeader {
27 /// Version of the XRay implementation that produced this file.
30 /// A numeric identifier for the type of file this is. Best used in
31 /// combination with Version.
34 /// Whether the CPU that produced the timestamp counters (TSC) move at a
38 /// Whether the CPU that produced the timestamp counters (TSC) do not stop.
41 /// The number of cycles per second for the CPU that produced the timestamp
42 /// counter (TSC) values. Useful for estimating the amount of time that
43 /// elapsed between two TSCs on some platforms.
44 uint64_t CycleFrequency = 0;
46 // This is different depending on the type of xray record. The naive format
47 // stores a Wallclock timespec. FDR logging stores the size of a thread
49 char FreeFormData[16];
52 /// Determines the supported types of records that could be seen in XRay traces.
53 /// This may or may not correspond to actual record types in the raw trace (as
54 /// the loader implementation may synthesize this information in the process of
56 enum class RecordTypes { ENTER, EXIT };
59 /// The type of record.
62 /// The CPU where the thread is running. We assume number of CPUs <= 65536.
65 /// Identifies the type of record.
68 /// The function ID for the record.
71 /// Get the full 8 bytes of the TSC when we get the log record.
74 /// The thread ID for the currently running thread.
81 #endif // LLVM_XRAY_XRAY_RECORD_H