[Lldb-commits] [lldb] c4fb631 - [NFC][lldb][trace] Fix formatting of tracing files

Walter Erquinigo via lldb-commits lldb-commits at lists.llvm.org
Thu Aug 11 11:00:34 PDT 2022


Author: Walter Erquinigo
Date: 2022-08-11T11:00:26-07:00
New Revision: c4fb631ceeeff2a292cc9cf5232b491afe09744d

URL: https://github.com/llvm/llvm-project/commit/c4fb631ceeeff2a292cc9cf5232b491afe09744d
DIFF: https://github.com/llvm/llvm-project/commit/c4fb631ceeeff2a292cc9cf5232b491afe09744d.diff

LOG: [NFC][lldb][trace] Fix formatting of tracing files

Pavel Labath taught me that clang-format sorts headers automatically
using llvm's rules, and it's better not to have spaces between

So in this diff I'm removing those spaces and formatting them as well.

I used `clang-format -i` to format these files.

Added: 
    

Modified: 
    lldb/source/Plugins/Process/Linux/IntelPTCollector.cpp
    lldb/source/Plugins/Process/Linux/IntelPTCollector.h
    lldb/source/Plugins/Process/Linux/IntelPTMultiCoreTrace.cpp
    lldb/source/Plugins/Process/Linux/IntelPTMultiCoreTrace.h
    lldb/source/Plugins/Process/Linux/IntelPTProcessTrace.h
    lldb/source/Plugins/Process/Linux/IntelPTSingleBufferTrace.cpp
    lldb/source/Plugins/Process/Linux/IntelPTSingleBufferTrace.h
    lldb/source/Plugins/Process/Linux/Perf.cpp
    lldb/source/Plugins/Process/Linux/Perf.h
    lldb/source/Plugins/Process/Linux/Procfs.h
    lldb/source/Plugins/Trace/intel-pt/CommandObjectTraceStartIntelPT.cpp
    lldb/source/Plugins/Trace/intel-pt/DecodedThread.cpp
    lldb/source/Plugins/Trace/intel-pt/DecodedThread.h
    lldb/source/Plugins/Trace/intel-pt/LibiptDecoder.cpp
    lldb/source/Plugins/Trace/intel-pt/LibiptDecoder.h
    lldb/source/Plugins/Trace/intel-pt/PerfContextSwitchDecoder.h
    lldb/source/Plugins/Trace/intel-pt/TaskTimer.cpp
    lldb/source/Plugins/Trace/intel-pt/TaskTimer.h
    lldb/source/Plugins/Trace/intel-pt/ThreadDecoder.cpp
    lldb/source/Plugins/Trace/intel-pt/ThreadDecoder.h
    lldb/source/Plugins/Trace/intel-pt/TraceCursorIntelPT.cpp
    lldb/source/Plugins/Trace/intel-pt/TraceIntelPT.cpp
    lldb/source/Plugins/Trace/intel-pt/TraceIntelPT.h
    lldb/source/Plugins/Trace/intel-pt/TraceIntelPTBundleLoader.cpp
    lldb/source/Plugins/Trace/intel-pt/TraceIntelPTBundleSaver.cpp
    lldb/source/Plugins/Trace/intel-pt/TraceIntelPTBundleSaver.h
    lldb/source/Plugins/Trace/intel-pt/TraceIntelPTConstants.h
    lldb/source/Plugins/Trace/intel-pt/TraceIntelPTJSONStructs.cpp
    lldb/source/Plugins/Trace/intel-pt/TraceIntelPTJSONStructs.h
    lldb/source/Plugins/Trace/intel-pt/TraceIntelPTMultiCpuDecoder.cpp
    lldb/source/Plugins/Trace/intel-pt/TraceIntelPTOptions.td

Removed: 
    


################################################################################
diff  --git a/lldb/source/Plugins/Process/Linux/IntelPTCollector.cpp b/lldb/source/Plugins/Process/Linux/IntelPTCollector.cpp
index f89936445b2ba..5f4be5b00fdb6 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 <algorithm>
 #include <cstddef>
 #include <fcntl.h>

diff  --git a/lldb/source/Plugins/Process/Linux/IntelPTCollector.h b/lldb/source/Plugins/Process/Linux/IntelPTCollector.h
index b77c434b3a3ac..4598616650b85 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 <linux/perf_event.h>
 #include <sys/mman.h>
 #include <unistd.h>

diff  --git a/lldb/source/Plugins/Process/Linux/IntelPTMultiCoreTrace.cpp b/lldb/source/Plugins/Process/Linux/IntelPTMultiCoreTrace.cpp
index a4794e7c8ca34..d8ee3e5600c9e 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 3343057042e90..b522e9fede659 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 <memory>
 
 namespace lldb_private {

diff  --git a/lldb/source/Plugins/Process/Linux/IntelPTProcessTrace.h b/lldb/source/Plugins/Process/Linux/IntelPTProcessTrace.h
index c26945af6132b..2fa6d8576c9a0 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 <memory>
 
 namespace lldb_private {

diff  --git a/lldb/source/Plugins/Process/Linux/IntelPTSingleBufferTrace.cpp b/lldb/source/Plugins/Process/Linux/IntelPTSingleBufferTrace.cpp
index 0b52c5c6ab7a6..03cfb1e0a3eee 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 <sstream>
-
 #include <linux/perf_event.h>
+#include <sstream>
 #include <sys/syscall.h>
 #include <unistd.h>
 

diff  --git a/lldb/source/Plugins/Process/Linux/IntelPTSingleBufferTrace.h b/lldb/source/Plugins/Process/Linux/IntelPTSingleBufferTrace.h
index 3b4e66f5e03fd..29369cc5e46d0 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 <memory>
 
 namespace lldb_private {

diff  --git a/lldb/source/Plugins/Process/Linux/Perf.cpp b/lldb/source/Plugins/Process/Linux/Perf.cpp
index fa4e8fb42e6cd..19bdca536673f 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 <linux/version.h>
 #include <sys/ioctl.h>
 #include <sys/mman.h>
@@ -27,7 +25,7 @@ using namespace llvm;
 
 Expected<LinuxPerfZeroTscConversion>
 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<uint8_t> PerfEvent::GetDataBuffer() const {
   perf_event_mmap_page &mmap_metadata = GetMetadataPage();
   return {reinterpret_cast<uint8_t *>(m_metadata_data_base.get()) +
               mmap_metadata.data_offset,
-           static_cast<size_t>(mmap_metadata.data_size)};
+          static_cast<size_t>(mmap_metadata.data_size)};
 }
 
 ArrayRef<uint8_t> PerfEvent::GetAuxBuffer() const {
   perf_event_mmap_page &mmap_metadata = GetMetadataPage();
   return {reinterpret_cast<uint8_t *>(m_aux_base.get()),
-           static_cast<size_t>(mmap_metadata.aux_size)};
+          static_cast<size_t>(mmap_metadata.aux_size)};
 }
 
 Expected<std::vector<uint8_t>> PerfEvent::GetReadOnlyDataBuffer() {

diff  --git a/lldb/source/Plugins/Process/Linux/Perf.h b/lldb/source/Plugins/Process/Linux/Perf.h
index 5887b0a2a0a45..86056c7c9927a 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 <chrono>
 #include <cstdint>
 #include <linux/perf_event.h>

diff  --git a/lldb/source/Plugins/Process/Linux/Procfs.h b/lldb/source/Plugins/Process/Linux/Procfs.h
index 3a068432074b7..ed4b1b35f0f37 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 <sys/ptrace.h>
-
 #include "lldb/lldb-types.h"
-
 #include "llvm/Support/Error.h"
-
+#include <sys/ptrace.h>
 #include <vector>
 
 #ifdef __ANDROID__

diff  --git a/lldb/source/Plugins/Trace/intel-pt/CommandObjectTraceStartIntelPT.cpp b/lldb/source/Plugins/Trace/intel-pt/CommandObjectTraceStartIntelPT.cpp
index dd28292c1daf4..f1b0b4bd871a7 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 312f721fd5cc2..89119c68e9d26 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 <intel-pt.h>
-
 #include "TraceCursorIntelPT.h"
-
+#include <intel-pt.h>
 #include <memory>
 
 using namespace lldb;

diff  --git a/lldb/source/Plugins/Trace/intel-pt/DecodedThread.h b/lldb/source/Plugins/Trace/intel-pt/DecodedThread.h
index 00fb1363619e5..7f112a5fd2d19 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 <utility>
-#include <vector>
-
-#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 <utility>
+#include <vector>
 
 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 16f5744cdf02e..8ac6c73150df5 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 14bbecb5042d0..8f1091ea04d9a 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 a16a437e1888e..4ea7738810ce1 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 <set>
 #include <vector>
 

diff  --git a/lldb/source/Plugins/Trace/intel-pt/TaskTimer.cpp b/lldb/source/Plugins/Trace/intel-pt/TaskTimer.cpp
index 9603b25fc81cf..55d48ae35ff0c 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 2b85ed30334f3..fb196e8fc32af 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 <chrono>
 #include <functional>
 #include <unordered_map>

diff  --git a/lldb/source/Plugins/Trace/intel-pt/ThreadDecoder.cpp b/lldb/source/Plugins/Trace/intel-pt/ThreadDecoder.cpp
index c88daf7a7e2a5..21b1aacfccc62 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 <utility>
 
 using namespace lldb;

diff  --git a/lldb/source/Plugins/Trace/intel-pt/ThreadDecoder.h b/lldb/source/Plugins/Trace/intel-pt/ThreadDecoder.h
index d580bc4dd3351..ad7c124d301bc 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 ed0f62e75a9cb..3969881bc0eb0 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 <cstdlib>
 
 using namespace lldb;

diff  --git a/lldb/source/Plugins/Trace/intel-pt/TraceIntelPT.cpp b/lldb/source/Plugins/Trace/intel-pt/TraceIntelPT.cpp
index a3c9064505af2..5f57480a04da5 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 82034b0bfbc63..542cad0b819b0 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 dae17ec522491..cac91e801c926 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 2e92ea1129a21..d1c13298bfc45 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 <fstream>
 #include <iostream>
 #include <sstream>

diff  --git a/lldb/source/Plugins/Trace/intel-pt/TraceIntelPTBundleSaver.h b/lldb/source/Plugins/Trace/intel-pt/TraceIntelPTBundleSaver.h
index 7224636f0c749..f5a0301217c77 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 c2b73b5cb092f..8418065ba955b 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 <cstddef>
-
 #include <llvm/ADT/Optional.h>
 
 namespace lldb_private {

diff  --git a/lldb/source/Plugins/Trace/intel-pt/TraceIntelPTJSONStructs.cpp b/lldb/source/Plugins/Trace/intel-pt/TraceIntelPTJSONStructs.cpp
index cbde0432793eb..209b22cb59ee3 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 <string>
 

diff  --git a/lldb/source/Plugins/Trace/intel-pt/TraceIntelPTJSONStructs.h b/lldb/source/Plugins/Trace/intel-pt/TraceIntelPTJSONStructs.h
index f39b33fc7ff34..135287d4f3b4e 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 <intel-pt.h>
 #include <vector>
 

diff  --git a/lldb/source/Plugins/Trace/intel-pt/TraceIntelPTMultiCpuDecoder.cpp b/lldb/source/Plugins/Trace/intel-pt/TraceIntelPTMultiCpuDecoder.cpp
index f7cb1669ac305..b52d5c0e9c566 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 95bd5c3d1cce1..4fb79448a3a09 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.">;
 }


        


More information about the lldb-commits mailing list