[NFC][lldb][trace] Fix formatting of tracing files
authorWalter Erquinigo <wallace@fb.com>
Thu, 11 Aug 2022 16:44:52 +0000 (09:44 -0700)
committerWalter Erquinigo <wallace@fb.com>
Thu, 11 Aug 2022 18:00:26 +0000 (11:00 -0700)
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.

31 files changed:
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

index f899364..5f4be5b 100644 (file)
@@ -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>
index b77c434..4598616 100644 (file)
@@ -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>
index a4794e7..d8ee3e5 100644 (file)
@@ -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,
index 3343057..b522e9f 100644 (file)
 
 #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 {
index c26945a..2fa6d85 100644 (file)
@@ -10,7 +10,6 @@
 #define liblldb_IntelPTProcessTrace_H_
 
 #include "lldb/Utility/TraceIntelPTGDBRemotePackets.h"
-
 #include <memory>
 
 namespace lldb_private {
index 0b52c5c..03cfb1e 100644 (file)
@@ -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>
 
index 3b4e66f..29369cc 100644 (file)
 #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 {
index fa4e8fb..19bdca5 100644 (file)
 
 #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() {
index 5887b0a..86056c7 100644 (file)
@@ -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>
index 3a06843..ed4b1b3 100644 (file)
@@ -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__
index dd28292..f1b0b4b 100644 (file)
@@ -7,7 +7,6 @@
 //===----------------------------------------------------------------------===//
 
 #include "CommandObjectTraceStartIntelPT.h"
-
 #include "TraceIntelPT.h"
 #include "TraceIntelPTConstants.h"
 #include "lldb/Host/OptionParser.h"
index 312f721..89119c6 100644 (file)
@@ -7,11 +7,8 @@
 //===----------------------------------------------------------------------===//
 
 #include "DecodedThread.h"
-
-#include <intel-pt.h>
-
 #include "TraceCursorIntelPT.h"
-
+#include <intel-pt.h>
 #include <memory>
 
 using namespace lldb;
index 00fb136..7f112a5 100644 (file)
@@ -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 {
index 16f5744..8ac6c73 100644 (file)
@@ -6,9 +6,7 @@
 //===----------------------------------------------------------------------===//
 
 #include "LibiptDecoder.h"
-
 #include "TraceIntelPT.h"
-
 #include "lldb/Target/Process.h"
 
 using namespace lldb;
index 14bbecb..8f1091e 100644 (file)
@@ -12,7 +12,6 @@
 #include "DecodedThread.h"
 #include "PerfContextSwitchDecoder.h"
 #include "forward-declarations.h"
-
 #include "intel-pt.h"
 
 namespace lldb_private {
index a16a437..4ea7738 100644 (file)
@@ -11,9 +11,7 @@
 
 #include "lldb/Utility/TraceIntelPTGDBRemotePackets.h"
 #include "lldb/lldb-types.h"
-
 #include "llvm/Support/Error.h"
-
 #include <set>
 #include <vector>
 
index 9603b25..55d48ae 100644 (file)
@@ -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;
index 2b85ed3..fb196e8 100644 (file)
 #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>
index c88daf7..21b1aac 100644 (file)
@@ -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;
index d580bc4..ad7c124 100644 (file)
@@ -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"
 
index ed0f62e..3969881 100644 (file)
@@ -9,7 +9,6 @@
 #include "TraceCursorIntelPT.h"
 #include "DecodedThread.h"
 #include "TraceIntelPT.h"
-
 #include <cstdlib>
 
 using namespace lldb;
index a3c9064..5f57480 100644 (file)
@@ -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"
index 82034b0..542cad0 100644 (file)
@@ -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"
index dae17ec..cac91e8 100644 (file)
@@ -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"
index 2e92ea1..d1c1329 100644 (file)
@@ -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>
index 7224636..f5a0301 100644 (file)
@@ -10,7 +10,6 @@
 #define LLDB_SOURCE_PLUGINS_TRACE_INTEL_PT_TRACEINTELPTBUNDLESAVER_H
 
 #include "TraceIntelPT.h"
-
 #include "TraceIntelPTJSONStructs.h"
 
 namespace lldb_private {
index c2b73b5..8418065 100644 (file)
@@ -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 {
index cbde043..209b22c 100644 (file)
@@ -7,7 +7,6 @@
 //===----------------------------------------------------------------------===//
 
 #include "TraceIntelPTJSONStructs.h"
-
 #include "llvm/Support/JSON.h"
 #include <string>
 
index f39b33f..135287d 100644 (file)
@@ -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>
 
index f7cb166..b52d5c0 100644 (file)
@@ -7,9 +7,7 @@
 //===----------------------------------------------------------------------===//
 
 #include "TraceIntelPTMultiCpuDecoder.h"
-
 #include "TraceIntelPT.h"
-
 #include "llvm/Support/Error.h"
 
 using namespace lldb;
index 95bd5c3..4fb7944 100644 (file)
@@ -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.">;
 }