Andrew Scull | 0372a57 | 2018-11-16 15:47:06 +0000 | [diff] [blame] | 1 | //===- FileHeaderReader.h - XRay Trace File Header Reading Function -------===// |
| 2 | // |
Andrew Walbran | 16937d0 | 2019-10-22 13:54:20 +0100 | [diff] [blame] | 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 |
Andrew Scull | 0372a57 | 2018-11-16 15:47:06 +0000 | [diff] [blame] | 6 | // |
| 7 | //===----------------------------------------------------------------------===// |
| 8 | // |
| 9 | // This file declares functions that can load an XRay log header from various |
| 10 | // sources. |
| 11 | // |
| 12 | //===----------------------------------------------------------------------===// |
| 13 | #ifndef LLVM_LIB_XRAY_FILEHEADERREADER_H_ |
| 14 | #define LLVM_LIB_XRAY_FILEHEADERREADER_H_ |
| 15 | |
| 16 | #include "llvm/Support/DataExtractor.h" |
| 17 | #include "llvm/Support/Error.h" |
| 18 | #include "llvm/XRay/XRayRecord.h" |
| 19 | #include <cstdint> |
| 20 | |
| 21 | namespace llvm { |
| 22 | namespace xray { |
| 23 | |
| 24 | /// Convenience function for loading the file header given a data extractor at a |
| 25 | /// specified offset. |
| 26 | Expected<XRayFileHeader> readBinaryFormatHeader(DataExtractor &HeaderExtractor, |
Olivier Deprez | f4ef2d0 | 2021-04-20 13:36:24 +0200 | [diff] [blame] | 27 | uint64_t &OffsetPtr); |
Andrew Scull | 0372a57 | 2018-11-16 15:47:06 +0000 | [diff] [blame] | 28 | |
| 29 | } // namespace xray |
| 30 | } // namespace llvm |
| 31 | |
| 32 | #endif // LLVM_LIB_XRAY_FILEHEADERREADER_H_ |