diff --git a/lldb/source/Plugins/Process/Linux/IntelPTCollector.cpp b/lldb/source/Plugins/Process/Linux/IntelPTCollector.cpp index f89936445b2b..5f4be5b00fdb 100644 --- a/lldb/source/Plugins/Process/Linux/IntelPTCollector.cpp +++ b/lldb/source/Plugins/Process/Linux/IntelPTCollector.cpp @@ -1,4 +1,4 @@ -//===-- IntelPTCollector.cpp ------------------------------------------------===// +//===-- IntelPTCollector.cpp ----------------------------------------------===// // // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. // See https://llvm.org/LICENSE.txt for license information. @@ -7,18 +7,14 @@ //===----------------------------------------------------------------------===// #include "IntelPTCollector.h" - #include "Perf.h" -#include "Procfs.h" - #include "Plugins/Process/POSIX/ProcessPOSIXLog.h" +#include "Procfs.h" #include "lldb/Host/linux/Support.h" #include "lldb/Utility/StreamString.h" - #include "llvm/ADT/StringRef.h" #include "llvm/Support/Error.h" #include "llvm/Support/MathExtras.h" - #include #include #include diff --git a/lldb/source/Plugins/Process/Linux/IntelPTCollector.h b/lldb/source/Plugins/Process/Linux/IntelPTCollector.h index b77c434b3a3a..4598616650b8 100644 --- a/lldb/source/Plugins/Process/Linux/IntelPTCollector.h +++ b/lldb/source/Plugins/Process/Linux/IntelPTCollector.h @@ -9,17 +9,14 @@ #ifndef liblldb_IntelPTCollector_H_ #define liblldb_IntelPTCollector_H_ -#include "Perf.h" - #include "IntelPTMultiCoreTrace.h" #include "IntelPTPerThreadProcessTrace.h" #include "IntelPTSingleBufferTrace.h" - +#include "Perf.h" #include "lldb/Host/common/NativeProcessProtocol.h" #include "lldb/Utility/Status.h" #include "lldb/Utility/TraceIntelPTGDBRemotePackets.h" #include "lldb/lldb-types.h" - #include #include #include diff --git a/lldb/source/Plugins/Process/Linux/IntelPTMultiCoreTrace.cpp b/lldb/source/Plugins/Process/Linux/IntelPTMultiCoreTrace.cpp index a4794e7c8ca3..d8ee3e5600c9 100644 --- a/lldb/source/Plugins/Process/Linux/IntelPTMultiCoreTrace.cpp +++ b/lldb/source/Plugins/Process/Linux/IntelPTMultiCoreTrace.cpp @@ -7,10 +7,8 @@ //===----------------------------------------------------------------------===// #include "IntelPTMultiCoreTrace.h" - -#include "Procfs.h" - #include "Plugins/Process/POSIX/ProcessPOSIXLog.h" +#include "Procfs.h" using namespace lldb; using namespace lldb_private; @@ -29,7 +27,8 @@ static Error IncludePerfEventParanoidMessageInError(Error &&error) { return createStringError( inconvertibleErrorCode(), "%s\nYou might need to rerun as sudo or to set " - "/proc/sys/kernel/perf_event_paranoid to a value of 0 or -1. You can use `sudo sysctl -w kernel.perf_event_paranoid=-1` for that.", + "/proc/sys/kernel/perf_event_paranoid to a value of 0 or -1. You can use " + "`sudo sysctl -w kernel.perf_event_paranoid=-1` for that.", toString(std::move(error)).c_str()); } @@ -110,8 +109,7 @@ TraceIntelPTGetStateResponse IntelPTMultiCoreTrace::GetState() { state.using_cgroup_filtering = m_using_cgroup_filtering; for (NativeThreadProtocol &thread : m_process.Threads()) - state.traced_threads.push_back( - TraceThreadState{thread.GetID(), {}}); + state.traced_threads.push_back(TraceThreadState{thread.GetID(), {}}); state.cpus.emplace(); ForEachCore([&](lldb::cpu_id_t cpu_id, diff --git a/lldb/source/Plugins/Process/Linux/IntelPTMultiCoreTrace.h b/lldb/source/Plugins/Process/Linux/IntelPTMultiCoreTrace.h index 3343057042e9..b522e9fede65 100644 --- a/lldb/source/Plugins/Process/Linux/IntelPTMultiCoreTrace.h +++ b/lldb/source/Plugins/Process/Linux/IntelPTMultiCoreTrace.h @@ -11,13 +11,10 @@ #include "IntelPTProcessTrace.h" #include "IntelPTSingleBufferTrace.h" - #include "lldb/Host/common/NativeProcessProtocol.h" #include "lldb/Utility/TraceIntelPTGDBRemotePackets.h" #include "lldb/lldb-types.h" - #include "llvm/Support/Error.h" - #include namespace lldb_private { diff --git a/lldb/source/Plugins/Process/Linux/IntelPTProcessTrace.h b/lldb/source/Plugins/Process/Linux/IntelPTProcessTrace.h index c26945af6132..2fa6d8576c9a 100644 --- a/lldb/source/Plugins/Process/Linux/IntelPTProcessTrace.h +++ b/lldb/source/Plugins/Process/Linux/IntelPTProcessTrace.h @@ -10,7 +10,6 @@ #define liblldb_IntelPTProcessTrace_H_ #include "lldb/Utility/TraceIntelPTGDBRemotePackets.h" - #include namespace lldb_private { diff --git a/lldb/source/Plugins/Process/Linux/IntelPTSingleBufferTrace.cpp b/lldb/source/Plugins/Process/Linux/IntelPTSingleBufferTrace.cpp index 0b52c5c6ab7a..03cfb1e0a3ee 100644 --- a/lldb/source/Plugins/Process/Linux/IntelPTSingleBufferTrace.cpp +++ b/lldb/source/Plugins/Process/Linux/IntelPTSingleBufferTrace.cpp @@ -7,17 +7,13 @@ //===----------------------------------------------------------------------===// #include "IntelPTSingleBufferTrace.h" - #include "Plugins/Process/POSIX/ProcessPOSIXLog.h" #include "lldb/Utility/Status.h" #include "lldb/Utility/StreamString.h" - #include "llvm/Support/Host.h" #include "llvm/Support/MemoryBuffer.h" - -#include - #include +#include #include #include diff --git a/lldb/source/Plugins/Process/Linux/IntelPTSingleBufferTrace.h b/lldb/source/Plugins/Process/Linux/IntelPTSingleBufferTrace.h index 3b4e66f5e03f..29369cc5e46d 100644 --- a/lldb/source/Plugins/Process/Linux/IntelPTSingleBufferTrace.h +++ b/lldb/source/Plugins/Process/Linux/IntelPTSingleBufferTrace.h @@ -10,12 +10,9 @@ #define liblldb_IntelPTSingleBufferTrace_H_ #include "Perf.h" - #include "lldb/Utility/TraceIntelPTGDBRemotePackets.h" #include "lldb/lldb-types.h" - #include "llvm/Support/Error.h" - #include namespace lldb_private { diff --git a/lldb/source/Plugins/Process/Linux/Perf.cpp b/lldb/source/Plugins/Process/Linux/Perf.cpp index fa4e8fb42e6c..19bdca536673 100644 --- a/lldb/source/Plugins/Process/Linux/Perf.cpp +++ b/lldb/source/Plugins/Process/Linux/Perf.cpp @@ -10,11 +10,9 @@ #include "Plugins/Process/POSIX/ProcessPOSIXLog.h" #include "lldb/Host/linux/Support.h" - #include "llvm/Support/FormatVariadic.h" #include "llvm/Support/MathExtras.h" #include "llvm/Support/MemoryBuffer.h" - #include #include #include @@ -27,7 +25,7 @@ using namespace llvm; Expected lldb_private::process_linux::LoadPerfTscConversionParameters() { -#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0) +#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 12, 0) lldb::pid_t pid = getpid(); perf_event_attr attr; memset(&attr, 0, sizeof(attr)); @@ -175,13 +173,13 @@ ArrayRef PerfEvent::GetDataBuffer() const { perf_event_mmap_page &mmap_metadata = GetMetadataPage(); return {reinterpret_cast(m_metadata_data_base.get()) + mmap_metadata.data_offset, - static_cast(mmap_metadata.data_size)}; + static_cast(mmap_metadata.data_size)}; } ArrayRef PerfEvent::GetAuxBuffer() const { perf_event_mmap_page &mmap_metadata = GetMetadataPage(); return {reinterpret_cast(m_aux_base.get()), - static_cast(mmap_metadata.aux_size)}; + static_cast(mmap_metadata.aux_size)}; } Expected> PerfEvent::GetReadOnlyDataBuffer() { diff --git a/lldb/source/Plugins/Process/Linux/Perf.h b/lldb/source/Plugins/Process/Linux/Perf.h index 5887b0a2a0a4..86056c7c9927 100644 --- a/lldb/source/Plugins/Process/Linux/Perf.h +++ b/lldb/source/Plugins/Process/Linux/Perf.h @@ -17,9 +17,7 @@ #include "lldb/Utility/TraceIntelPTGDBRemotePackets.h" #include "lldb/lldb-types.h" - #include "llvm/Support/Error.h" - #include #include #include diff --git a/lldb/source/Plugins/Process/Linux/Procfs.h b/lldb/source/Plugins/Process/Linux/Procfs.h index 3a068432074b..ed4b1b35f0f3 100644 --- a/lldb/source/Plugins/Process/Linux/Procfs.h +++ b/lldb/source/Plugins/Process/Linux/Procfs.h @@ -9,12 +9,9 @@ // source/Plugins/Process/Linux/Procfs.h defines the symbols we need from // sys/procfs.h on Android/Linux for all supported architectures. -#include - #include "lldb/lldb-types.h" - #include "llvm/Support/Error.h" - +#include #include #ifdef __ANDROID__ diff --git a/lldb/source/Plugins/Trace/intel-pt/CommandObjectTraceStartIntelPT.cpp b/lldb/source/Plugins/Trace/intel-pt/CommandObjectTraceStartIntelPT.cpp index dd28292c1daf..f1b0b4bd871a 100644 --- a/lldb/source/Plugins/Trace/intel-pt/CommandObjectTraceStartIntelPT.cpp +++ b/lldb/source/Plugins/Trace/intel-pt/CommandObjectTraceStartIntelPT.cpp @@ -7,7 +7,6 @@ //===----------------------------------------------------------------------===// #include "CommandObjectTraceStartIntelPT.h" - #include "TraceIntelPT.h" #include "TraceIntelPTConstants.h" #include "lldb/Host/OptionParser.h" diff --git a/lldb/source/Plugins/Trace/intel-pt/DecodedThread.cpp b/lldb/source/Plugins/Trace/intel-pt/DecodedThread.cpp index 312f721fd5cc..89119c68e9d2 100644 --- a/lldb/source/Plugins/Trace/intel-pt/DecodedThread.cpp +++ b/lldb/source/Plugins/Trace/intel-pt/DecodedThread.cpp @@ -7,11 +7,8 @@ //===----------------------------------------------------------------------===// #include "DecodedThread.h" - -#include - #include "TraceCursorIntelPT.h" - +#include #include using namespace lldb; diff --git a/lldb/source/Plugins/Trace/intel-pt/DecodedThread.h b/lldb/source/Plugins/Trace/intel-pt/DecodedThread.h index 00fb1363619e..7f112a5fd2d1 100644 --- a/lldb/source/Plugins/Trace/intel-pt/DecodedThread.h +++ b/lldb/source/Plugins/Trace/intel-pt/DecodedThread.h @@ -9,16 +9,13 @@ #ifndef LLDB_SOURCE_PLUGINS_TRACE_INTEL_PT_DECODEDTHREAD_H #define LLDB_SOURCE_PLUGINS_TRACE_INTEL_PT_DECODEDTHREAD_H -#include -#include - -#include "llvm/Support/Errc.h" -#include "llvm/Support/Error.h" - +#include "intel-pt.h" #include "lldb/Target/Trace.h" #include "lldb/Utility/TraceIntelPTGDBRemotePackets.h" - -#include "intel-pt.h" +#include "llvm/Support/Errc.h" +#include "llvm/Support/Error.h" +#include +#include namespace lldb_private { namespace trace_intel_pt { diff --git a/lldb/source/Plugins/Trace/intel-pt/LibiptDecoder.cpp b/lldb/source/Plugins/Trace/intel-pt/LibiptDecoder.cpp index 16f5744cdf02..8ac6c73150df 100644 --- a/lldb/source/Plugins/Trace/intel-pt/LibiptDecoder.cpp +++ b/lldb/source/Plugins/Trace/intel-pt/LibiptDecoder.cpp @@ -6,9 +6,7 @@ //===----------------------------------------------------------------------===// #include "LibiptDecoder.h" - #include "TraceIntelPT.h" - #include "lldb/Target/Process.h" using namespace lldb; diff --git a/lldb/source/Plugins/Trace/intel-pt/LibiptDecoder.h b/lldb/source/Plugins/Trace/intel-pt/LibiptDecoder.h index 14bbecb5042d..8f1091ea04d9 100644 --- a/lldb/source/Plugins/Trace/intel-pt/LibiptDecoder.h +++ b/lldb/source/Plugins/Trace/intel-pt/LibiptDecoder.h @@ -12,7 +12,6 @@ #include "DecodedThread.h" #include "PerfContextSwitchDecoder.h" #include "forward-declarations.h" - #include "intel-pt.h" namespace lldb_private { diff --git a/lldb/source/Plugins/Trace/intel-pt/PerfContextSwitchDecoder.h b/lldb/source/Plugins/Trace/intel-pt/PerfContextSwitchDecoder.h index a16a437e1888..4ea7738810ce 100644 --- a/lldb/source/Plugins/Trace/intel-pt/PerfContextSwitchDecoder.h +++ b/lldb/source/Plugins/Trace/intel-pt/PerfContextSwitchDecoder.h @@ -11,9 +11,7 @@ #include "lldb/Utility/TraceIntelPTGDBRemotePackets.h" #include "lldb/lldb-types.h" - #include "llvm/Support/Error.h" - #include #include diff --git a/lldb/source/Plugins/Trace/intel-pt/TaskTimer.cpp b/lldb/source/Plugins/Trace/intel-pt/TaskTimer.cpp index 9603b25fc81c..55d48ae35ff0 100644 --- a/lldb/source/Plugins/Trace/intel-pt/TaskTimer.cpp +++ b/lldb/source/Plugins/Trace/intel-pt/TaskTimer.cpp @@ -1,3 +1,11 @@ +//===-- TaskTimer.cpp -----------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + #include "TaskTimer.h" using namespace lldb; diff --git a/lldb/source/Plugins/Trace/intel-pt/TaskTimer.h b/lldb/source/Plugins/Trace/intel-pt/TaskTimer.h index 2b85ed30334f..fb196e8fc32a 100644 --- a/lldb/source/Plugins/Trace/intel-pt/TaskTimer.h +++ b/lldb/source/Plugins/Trace/intel-pt/TaskTimer.h @@ -10,10 +10,8 @@ #define LLDB_SOURCE_PLUGINS_TRACE_INTEL_PT_TASKTIMER_H #include "lldb/lldb-types.h" - #include "llvm/ADT/DenseMap.h" #include "llvm/ADT/StringRef.h" - #include #include #include diff --git a/lldb/source/Plugins/Trace/intel-pt/ThreadDecoder.cpp b/lldb/source/Plugins/Trace/intel-pt/ThreadDecoder.cpp index c88daf7a7e2a..21b1aacfccc6 100644 --- a/lldb/source/Plugins/Trace/intel-pt/ThreadDecoder.cpp +++ b/lldb/source/Plugins/Trace/intel-pt/ThreadDecoder.cpp @@ -6,13 +6,10 @@ //===----------------------------------------------------------------------===// #include "ThreadDecoder.h" - -#include "llvm/Support/MemoryBuffer.h" - #include "../common/ThreadPostMortemTrace.h" #include "LibiptDecoder.h" #include "TraceIntelPT.h" - +#include "llvm/Support/MemoryBuffer.h" #include using namespace lldb; diff --git a/lldb/source/Plugins/Trace/intel-pt/ThreadDecoder.h b/lldb/source/Plugins/Trace/intel-pt/ThreadDecoder.h index d580bc4dd335..ad7c124d301b 100644 --- a/lldb/source/Plugins/Trace/intel-pt/ThreadDecoder.h +++ b/lldb/source/Plugins/Trace/intel-pt/ThreadDecoder.h @@ -9,10 +9,9 @@ #ifndef LLDB_SOURCE_PLUGINS_TRACE_THREAD_DECODER_H #define LLDB_SOURCE_PLUGINS_TRACE_THREAD_DECODER_H -#include "intel-pt.h" - #include "DecodedThread.h" #include "forward-declarations.h" +#include "intel-pt.h" #include "lldb/Target/Process.h" #include "lldb/Utility/FileSpec.h" diff --git a/lldb/source/Plugins/Trace/intel-pt/TraceCursorIntelPT.cpp b/lldb/source/Plugins/Trace/intel-pt/TraceCursorIntelPT.cpp index ed0f62e75a9c..3969881bc0eb 100644 --- a/lldb/source/Plugins/Trace/intel-pt/TraceCursorIntelPT.cpp +++ b/lldb/source/Plugins/Trace/intel-pt/TraceCursorIntelPT.cpp @@ -9,7 +9,6 @@ #include "TraceCursorIntelPT.h" #include "DecodedThread.h" #include "TraceIntelPT.h" - #include using namespace lldb; diff --git a/lldb/source/Plugins/Trace/intel-pt/TraceIntelPT.cpp b/lldb/source/Plugins/Trace/intel-pt/TraceIntelPT.cpp index a3c9064505af..5f57480a04da 100644 --- a/lldb/source/Plugins/Trace/intel-pt/TraceIntelPT.cpp +++ b/lldb/source/Plugins/Trace/intel-pt/TraceIntelPT.cpp @@ -8,11 +8,10 @@ #include "TraceIntelPT.h" -#include "TraceCursorIntelPT.h" - #include "../common/ThreadPostMortemTrace.h" #include "CommandObjectTraceStartIntelPT.h" #include "DecodedThread.h" +#include "TraceCursorIntelPT.h" #include "TraceIntelPTBundleLoader.h" #include "TraceIntelPTBundleSaver.h" #include "TraceIntelPTConstants.h" diff --git a/lldb/source/Plugins/Trace/intel-pt/TraceIntelPT.h b/lldb/source/Plugins/Trace/intel-pt/TraceIntelPT.h index 82034b0bfbc6..542cad0b819b 100644 --- a/lldb/source/Plugins/Trace/intel-pt/TraceIntelPT.h +++ b/lldb/source/Plugins/Trace/intel-pt/TraceIntelPT.h @@ -13,7 +13,6 @@ #include "ThreadDecoder.h" #include "TraceIntelPTBundleLoader.h" #include "TraceIntelPTMultiCpuDecoder.h" - #include "lldb/Utility/FileSpec.h" #include "lldb/lldb-types.h" #include "llvm/Support/raw_ostream.h" diff --git a/lldb/source/Plugins/Trace/intel-pt/TraceIntelPTBundleLoader.cpp b/lldb/source/Plugins/Trace/intel-pt/TraceIntelPTBundleLoader.cpp index dae17ec52249..cac91e801c92 100644 --- a/lldb/source/Plugins/Trace/intel-pt/TraceIntelPTBundleLoader.cpp +++ b/lldb/source/Plugins/Trace/intel-pt/TraceIntelPTBundleLoader.cpp @@ -12,7 +12,6 @@ #include "TraceIntelPT.h" #include "TraceIntelPTConstants.h" #include "TraceIntelPTJSONStructs.h" - #include "lldb/Core/Debugger.h" #include "lldb/Core/Module.h" #include "lldb/Target/Process.h" diff --git a/lldb/source/Plugins/Trace/intel-pt/TraceIntelPTBundleSaver.cpp b/lldb/source/Plugins/Trace/intel-pt/TraceIntelPTBundleSaver.cpp index 2e92ea1129a2..d1c13298bfc4 100644 --- a/lldb/source/Plugins/Trace/intel-pt/TraceIntelPTBundleSaver.cpp +++ b/lldb/source/Plugins/Trace/intel-pt/TraceIntelPTBundleSaver.cpp @@ -7,12 +7,10 @@ //===----------------------------------------------------------------------===// #include "TraceIntelPTBundleSaver.h" - #include "PerfContextSwitchDecoder.h" #include "TraceIntelPT.h" #include "TraceIntelPTConstants.h" #include "TraceIntelPTJSONStructs.h" - #include "lldb/Core/Module.h" #include "lldb/Core/ModuleList.h" #include "lldb/Target/Process.h" @@ -23,7 +21,6 @@ #include "llvm/ADT/None.h" #include "llvm/Support/Error.h" #include "llvm/Support/JSON.h" - #include #include #include diff --git a/lldb/source/Plugins/Trace/intel-pt/TraceIntelPTBundleSaver.h b/lldb/source/Plugins/Trace/intel-pt/TraceIntelPTBundleSaver.h index 7224636f0c74..f5a0301217c7 100644 --- a/lldb/source/Plugins/Trace/intel-pt/TraceIntelPTBundleSaver.h +++ b/lldb/source/Plugins/Trace/intel-pt/TraceIntelPTBundleSaver.h @@ -10,7 +10,6 @@ #define LLDB_SOURCE_PLUGINS_TRACE_INTEL_PT_TRACEINTELPTBUNDLESAVER_H #include "TraceIntelPT.h" - #include "TraceIntelPTJSONStructs.h" namespace lldb_private { diff --git a/lldb/source/Plugins/Trace/intel-pt/TraceIntelPTConstants.h b/lldb/source/Plugins/Trace/intel-pt/TraceIntelPTConstants.h index c2b73b5cb092..8418065ba955 100644 --- a/lldb/source/Plugins/Trace/intel-pt/TraceIntelPTConstants.h +++ b/lldb/source/Plugins/Trace/intel-pt/TraceIntelPTConstants.h @@ -9,8 +9,8 @@ #ifndef LLDB_SOURCE_PLUGINS_TRACE_INTEL_PT_CONSTANTS_H #define LLDB_SOURCE_PLUGINS_TRACE_INTEL_PT_CONSTANTS_H +#include "lldb/lldb-types.h" #include - #include namespace lldb_private { diff --git a/lldb/source/Plugins/Trace/intel-pt/TraceIntelPTJSONStructs.cpp b/lldb/source/Plugins/Trace/intel-pt/TraceIntelPTJSONStructs.cpp index cbde0432793e..209b22cb59ee 100644 --- a/lldb/source/Plugins/Trace/intel-pt/TraceIntelPTJSONStructs.cpp +++ b/lldb/source/Plugins/Trace/intel-pt/TraceIntelPTJSONStructs.cpp @@ -7,7 +7,6 @@ //===----------------------------------------------------------------------===// #include "TraceIntelPTJSONStructs.h" - #include "llvm/Support/JSON.h" #include diff --git a/lldb/source/Plugins/Trace/intel-pt/TraceIntelPTJSONStructs.h b/lldb/source/Plugins/Trace/intel-pt/TraceIntelPTJSONStructs.h index f39b33fc7ff3..135287d4f3b4 100644 --- a/lldb/source/Plugins/Trace/intel-pt/TraceIntelPTJSONStructs.h +++ b/lldb/source/Plugins/Trace/intel-pt/TraceIntelPTJSONStructs.h @@ -9,13 +9,10 @@ #ifndef LLDB_SOURCE_PLUGINS_TRACE_INTEL_PT_TRACEINTELPTJSONSTRUCTS_H #define LLDB_SOURCE_PLUGINS_TRACE_INTEL_PT_TRACEINTELPTJSONSTRUCTS_H -#include "lldb/lldb-types.h" - #include "lldb/Utility/TraceIntelPTGDBRemotePackets.h" - +#include "lldb/lldb-types.h" #include "llvm/ADT/Optional.h" #include "llvm/Support/JSON.h" - #include #include diff --git a/lldb/source/Plugins/Trace/intel-pt/TraceIntelPTMultiCpuDecoder.cpp b/lldb/source/Plugins/Trace/intel-pt/TraceIntelPTMultiCpuDecoder.cpp index f7cb1669ac30..b52d5c0e9c56 100644 --- a/lldb/source/Plugins/Trace/intel-pt/TraceIntelPTMultiCpuDecoder.cpp +++ b/lldb/source/Plugins/Trace/intel-pt/TraceIntelPTMultiCpuDecoder.cpp @@ -7,9 +7,7 @@ //===----------------------------------------------------------------------===// #include "TraceIntelPTMultiCpuDecoder.h" - #include "TraceIntelPT.h" - #include "llvm/Support/Error.h" using namespace lldb; diff --git a/lldb/source/Plugins/Trace/intel-pt/TraceIntelPTOptions.td b/lldb/source/Plugins/Trace/intel-pt/TraceIntelPTOptions.td index 95bd5c3d1cce..4fb79448a3a0 100644 --- a/lldb/source/Plugins/Trace/intel-pt/TraceIntelPTOptions.td +++ b/lldb/source/Plugins/Trace/intel-pt/TraceIntelPTOptions.td @@ -6,92 +6,127 @@ include "../../../../source/Commands/OptionsBase.td" // the API help message of TraceIntelPT::GetStartConfigurationHelp(). let Command = "thread trace start intel pt" in { - def thread_trace_start_intel_pt_size: Option<"size", "s">, - Group<1>, - Arg<"Value">, - Desc<"Trace size in bytes per thread. It must be a power of 2 greater " - "than or equal to 4096 (2^12). The trace is circular keeping " - "the most recent data. Defaults to 4096 bytes. It's possible to " - "specify size using multiples of unit bytes, e.g., 4KB, 1MB, 1MiB, " - "where 1K is 1024 bytes and 1M is 1048576 bytes.">; - def thread_trace_start_intel_pt_tsc: Option<"tsc", "t">, - Group<1>, - Desc<"Enable the use of TSC timestamps. This is supported on all devices " - "that support intel-pt.">; - def thread_trace_start_intel_pt_psb_period: Option<"psb-period", "p">, - Group<1>, - Arg<"Value">, - Desc<"This value defines the period in which PSB packets will be " - "generated. A PSB packet is a synchronization packet that contains a " - "TSC timestamp and the current absolute instruction pointer. " - "This parameter can only be used if " - "/sys/bus/event_source/devices/intel_pt/caps/psb_cyc is 1. Otherwise, " - "the PSB period will be defined by the processor. If supported, valid " - "values for this period can be found in " - "/sys/bus/event_source/devices/intel_pt/caps/psb_periods which " - "contains a hexadecimal number, whose bits represent valid values " - "e.g. if bit 2 is set, then value 2 is valid. The psb_period value is " - "converted to the approximate number of raw trace bytes between PSB " - "packets as: 2 ^ (value + 11), e.g. value 3 means 16KiB between PSB " - "packets. Defaults to 0 if supported.">; + def thread_trace_start_intel_pt_size + : Option<"size", "s">, + Group<1>, + Arg<"Value">, + Desc< + "Trace size in bytes per thread. It must be a power of 2 greater " + "than or equal to 4096 (2^12). The trace is circular keeping " + "the most recent data. Defaults to 4096 bytes. It's possible to " + "specify size using multiples of unit bytes, e.g., 4KB, 1MB, 1MiB, " + "where 1K is 1024 bytes and 1M is 1048576 bytes.">; + def thread_trace_start_intel_pt_tsc + : Option<"tsc", "t">, + Group<1>, + Desc<"Enable the use of TSC timestamps. This is supported on all " + "devices " + "that support intel-pt.">; + def thread_trace_start_intel_pt_psb_period + : Option<"psb-period", "p">, + Group<1>, + Arg<"Value">, + Desc<"This value defines the period in which PSB packets will be " + "generated. A PSB packet is a synchronization packet that " + "contains a " + "TSC timestamp and the current absolute instruction pointer. " + "This parameter can only be used if " + "/sys/bus/event_source/devices/intel_pt/caps/psb_cyc is 1. " + "Otherwise, " + "the PSB period will be defined by the processor. If supported, " + "valid " + "values for this period can be found in " + "/sys/bus/event_source/devices/intel_pt/caps/psb_periods which " + "contains a hexadecimal number, whose bits represent valid values " + "e.g. if bit 2 is set, then value 2 is valid. The psb_period " + "value is " + "converted to the approximate number of raw trace bytes between " + "PSB " + "packets as: 2 ^ (value + 11), e.g. value 3 means 16KiB between " + "PSB " + "packets. Defaults to 0 if supported.">; } let Command = "process trace start intel pt" in { - def process_trace_start_intel_pt_buffer_size: Option<"buffer-size", "s">, - Group<1>, - Arg<"Value">, - Desc<"Size in bytes used by each individual per-thread or per-cpu trace " - "buffer. It must be a power of 2 greater than or equal to 4096 (2^12) " - "bytes. It's possible to specify a unit for these bytes, like 4KB, " - "16KiB or 1MB. Lower case units are allowed for convenience.">; - def process_trace_start_intel_pt_per_cpu_tracing: - Option<"per-cpu-tracing", "c">, - Group<1>, - Desc<"Instead of having an individual trace buffer per thread, which uses " - "a number trace buffers proportional to the number of running " - "threads, this option triggers the collection on a per cpu core " - "basis. This effectively traces the entire activity on all cpus " - "using a limited amount of trace buffers regardless of the number of " - "threads. This might cause data loss for less frequent threads. This " - "option forces the capture of TSC timestamps (see --tsc). Also, this " - "option can't be used simulatenously with any other trace sessions " - "because of its system-wide nature.">; - def process_trace_start_intel_pt_process_size_limit: - Option<"total-size-limit", "l">, - Group<1>, - Arg<"Value">, - Desc<"Maximum total trace size per process in bytes. This limit applies to " - "the sum of the sizes of all thread and cpu traces of this process, " - "excluding the ones created with the \"thread trace start\" command. " - "Whenever a thread is attempted to be traced due to this command and " - "the limit would be reached, the process is stopped with a " - "\"processor trace\" reason, so that the user can retrace the process " - "if needed. Defaults to 500MB. It's possible to specify a unit for " - "these bytes, like 4KB, 16KiB or 1MB. Lower case units are allowed " - "for convenience.">; - def process_trace_start_intel_pt_tsc: Option<"tsc", "t">, - Group<1>, - Desc<"Enable the use of TSC timestamps. This is supported on all devices " - "that support intel-pt.">; - def process_trace_start_intel_pt_psb_period: Option<"psb-period", "p">, - Group<1>, - Arg<"Value">, - Desc<"This value defines the period in which PSB packets will be " - "generated. A PSB packet is a synchronization packet that contains a " - "TSC timestamp and the current absolute instruction pointer. " - "This parameter can only be used if " - "/sys/bus/event_source/devices/intel_pt/caps/psb_cyc is 1. Otherwise, " - "the PSB period will be defined by the processor. If supported, valid " - "values for this period can be found in " - "/sys/bus/event_source/devices/intel_pt/caps/psb_periods which " - "contains a hexadecimal number, whose bits represent valid values " - "e.g. if bit 2 is set, then value 2 is valid. The psb_period value is " - "converted to the approximate number of raw trace bytes between PSB " - "packets as: 2 ^ (value + 11), e.g. value 3 means 16KiB between PSB " - "packets. Defaults to 0 if supported.">; - def process_trace_start_intel_pt_disable_cgroup_filtering: - Option<"disable-cgroup-filtering", "d">, - Desc<"Disable the automatic cgroup filtering that is applied if --per-cpu " - "is provided. Cgroup filtering allows collecting intel pt data " - "exclusively of processes of the same cgroup as the target.">; + def process_trace_start_intel_pt_buffer_size + : Option<"buffer-size", "s">, + Group<1>, + Arg<"Value">, + Desc< + "Size in bytes used by each individual per-thread or per-cpu trace " + "buffer. It must be a power of 2 greater than or equal to 4096 " + "(2^12) " + "bytes. It's possible to specify a unit for these bytes, like 4KB, " + "16KiB or 1MB. Lower case units are allowed for convenience.">; + def process_trace_start_intel_pt_per_cpu_tracing + : Option<"per-cpu-tracing", "c">, + Group<1>, + Desc< + "Instead of having an individual trace buffer per thread, which " + "uses " + "a number trace buffers proportional to the number of running " + "threads, this option triggers the collection on a per cpu core " + "basis. This effectively traces the entire activity on all cpus " + "using a limited amount of trace buffers regardless of the number " + "of " + "threads. This might cause data loss for less frequent threads. " + "This " + "option forces the capture of TSC timestamps (see --tsc). Also, " + "this " + "option can't be used simulatenously with any other trace sessions " + "because of its system-wide nature.">; + def process_trace_start_intel_pt_process_size_limit + : Option<"total-size-limit", "l">, + Group<1>, + Arg<"Value">, + Desc< + "Maximum total trace size per process in bytes. This limit applies " + "to " + "the sum of the sizes of all thread and cpu traces of this " + "process, " + "excluding the ones created with the \"thread trace start\" " + "command. " + "Whenever a thread is attempted to be traced due to this command " + "and " + "the limit would be reached, the process is stopped with a " + "\"processor trace\" reason, so that the user can retrace the " + "process " + "if needed. Defaults to 500MB. It's possible to specify a unit for " + "these bytes, like 4KB, 16KiB or 1MB. Lower case units are allowed " + "for convenience.">; + def process_trace_start_intel_pt_tsc + : Option<"tsc", "t">, + Group<1>, + Desc<"Enable the use of TSC timestamps. This is supported on all " + "devices " + "that support intel-pt.">; + def process_trace_start_intel_pt_psb_period + : Option<"psb-period", "p">, + Group<1>, + Arg<"Value">, + Desc<"This value defines the period in which PSB packets will be " + "generated. A PSB packet is a synchronization packet that " + "contains a " + "TSC timestamp and the current absolute instruction pointer. " + "This parameter can only be used if " + "/sys/bus/event_source/devices/intel_pt/caps/psb_cyc is 1. " + "Otherwise, " + "the PSB period will be defined by the processor. If supported, " + "valid " + "values for this period can be found in " + "/sys/bus/event_source/devices/intel_pt/caps/psb_periods which " + "contains a hexadecimal number, whose bits represent valid values " + "e.g. if bit 2 is set, then value 2 is valid. The psb_period " + "value is " + "converted to the approximate number of raw trace bytes between " + "PSB " + "packets as: 2 ^ (value + 11), e.g. value 3 means 16KiB between " + "PSB " + "packets. Defaults to 0 if supported.">; + def process_trace_start_intel_pt_disable_cgroup_filtering + : Option<"disable-cgroup-filtering", "d">, + Desc<"Disable the automatic cgroup filtering that is applied if " + "--per-cpu " + "is provided. Cgroup filtering allows collecting intel pt data " + "exclusively of processes of the same cgroup as the target.">; }