49 lines · c
1//===-- TraceIntelPTBundleSaver.h ----------------------------*- C++ //-*-===//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-exception6//7//===----------------------------------------------------------------------===//8 9#ifndef LLDB_SOURCE_PLUGINS_TRACE_INTEL_PT_TRACEINTELPTBUNDLESAVER_H10#define LLDB_SOURCE_PLUGINS_TRACE_INTEL_PT_TRACEINTELPTBUNDLESAVER_H11 12#include "TraceIntelPT.h"13#include "TraceIntelPTJSONStructs.h"14 15namespace lldb_private {16namespace trace_intel_pt {17 18class TraceIntelPTBundleSaver {19public:20 /// Save the Intel PT trace of a live process to the specified directory,21 /// which will be created if needed. This will also create a file22 /// \a <directory>/trace.json with the description of the trace23 /// bundle, along with others files which contain the actual trace data.24 /// The trace.json file can be used later as input for the "trace load"25 /// command to load the trace in LLDB.26 ///27 /// \param[in] trace_ipt28 /// The Intel PT trace to be saved to disk.29 ///30 /// \param[in] directory31 /// The directory where the trace bundle will be created.32 ///33 /// \param[in] compact34 /// Filter out information irrelevant to the traced processes in the35 /// context switch and intel pt traces when using per-cpu mode. This36 /// effectively reduces the size of those traces.37 ///38 /// \return39 /// A \a FileSpec pointing to the bundle description file, or an \a40 /// llvm::Error otherwise.41 llvm::Expected<FileSpec> SaveToDisk(TraceIntelPT &trace_ipt,42 FileSpec directory, bool compact);43};44 45} // namespace trace_intel_pt46} // namespace lldb_private47 48#endif // LLDB_SOURCE_PLUGINS_TRACE_INTEL_PT_TRACEINTELPTBUNDLESAVER_H49