Lines Matching +full:write +full:- +full:data
1 //===- FDRTraceWriter.cpp - XRay FDR Trace Writer ---------------*- C++ -*-===//
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 //===----------------------------------------------------------------------===//
9 // Test a utility that can write out XRay FDR Mode formatted trace files.
11 //===----------------------------------------------------------------------===//
26 static size_t write(support::endian::Writer &OS, Tuple &&T) {
27 OS.write(std::get<Index>(T));
28 return sizeof(std::get<Index>(T)) + IndexedWriter<Index + 1>::write(OS, T);
36 static size_t write(support::endian::Writer &OS, Tuple &&) {
44 // we ensure this is the case when we write out the first byte of the record.
47 // Write in field order.
48 OS.write(FirstByte);
49 auto Bytes = IndexedWriter<0>::write(OS, T);
50 assert(Bytes <= 15 && "Must only ever write at most 16 byte metadata!");
53 OS.write('\0');
61 // We need to re-construct a header, by writing the fields we care about for
66 // For endian-correctness, we need to write these fields in the order they
68 OS.write(H.Version);
69 OS.write(H.Type);
70 OS.write(BitField);
71 OS.write(H.CycleFrequency);
74 OS.write(FreeFormBytes);
98 auto D = R.data();
99 ArrayRef<char> Bytes(D.data(), D.size());
100 OS.write(Bytes);
107 auto D = R.data();
108 ArrayRef<char> Bytes(D.data(), D.size());
109 OS.write(Bytes);
116 auto D = R.data();
117 ArrayRef<char> Bytes(D.data(), D.size());
118 OS.write(Bytes);
139 // Write out the data in "field" order, to be endian-aware.
145 OS.write(TypeRecordFuncId);
146 OS.write(R.delta());