Path: blob/main/contrib/llvm-project/lldb/source/Plugins/Trace/intel-pt/TraceIntelPTBundleSaver.h
39646 views
//===-- TraceIntelPTBundleSaver.h ----------------------------*- C++ //-*-===//1//2// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.3// See https://llvm.org/LICENSE.txt for license information.4// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception5//6//===----------------------------------------------------------------------===//78#ifndef LLDB_SOURCE_PLUGINS_TRACE_INTEL_PT_TRACEINTELPTBUNDLESAVER_H9#define LLDB_SOURCE_PLUGINS_TRACE_INTEL_PT_TRACEINTELPTBUNDLESAVER_H1011#include "TraceIntelPT.h"12#include "TraceIntelPTJSONStructs.h"1314namespace lldb_private {15namespace trace_intel_pt {1617class TraceIntelPTBundleSaver {18public:19/// Save the Intel PT trace of a live process to the specified directory,20/// which will be created if needed. This will also create a file21/// \a <directory>/trace.json with the description of the trace22/// bundle, along with others files which contain the actual trace data.23/// The trace.json file can be used later as input for the "trace load"24/// command to load the trace in LLDB.25///26/// \param[in] trace_ipt27/// The Intel PT trace to be saved to disk.28///29/// \param[in] directory30/// The directory where the trace bundle will be created.31///32/// \param[in] compact33/// Filter out information irrelevant to the traced processes in the34/// context switch and intel pt traces when using per-cpu mode. This35/// effectively reduces the size of those traces.36///37/// \return38/// A \a FileSpec pointing to the bundle description file, or an \a39/// llvm::Error otherwise.40llvm::Expected<FileSpec> SaveToDisk(TraceIntelPT &trace_ipt,41FileSpec directory, bool compact);42};4344} // namespace trace_intel_pt45} // namespace lldb_private4647#endif // LLDB_SOURCE_PLUGINS_TRACE_INTEL_PT_TRACEINTELPTBUNDLESAVER_H484950