xref: /openbsd-src/gnu/llvm/lldb/source/Plugins/Trace/intel-pt/TraceIntelPTOptions.td (revision f6aab3d83b51b91c24247ad2c2573574de475a82)
1include "../../../../source/Commands/OptionsBase.td"
2
3// The information of the start commands here should match the description of
4// the intel-pt section of the jLLDBTraceStart packet in the
5// lldb/docs/lldb-gdb-remote.txt documentation file. Similarly, it should match
6// the API help message of TraceIntelPT::GetStartConfigurationHelp().
7
8let Command = "thread trace start intel pt" in {
9  def thread_trace_start_intel_pt_size
10      : Option<"size", "s">,
11        Group<1>,
12        Arg<"Value">,
13        Desc<
14            "Trace size in bytes per thread. It must be a power of 2 greater "
15            "than or equal to 4096 (2^12). The trace is circular keeping "
16            "the most recent data. Defaults to 4096 bytes. It's possible to "
17            "specify size using multiples of unit bytes, e.g., 4KB, 1MB, 1MiB, "
18            "where 1K is 1024 bytes and 1M is 1048576 bytes.">;
19  def thread_trace_start_intel_pt_tsc
20      : Option<"tsc", "t">,
21        Group<1>,
22        Desc<"Enable the use of TSC timestamps. This is supported on all "
23             "devices "
24             "that support intel-pt.">;
25  def thread_trace_start_intel_pt_psb_period
26      : Option<"psb-period", "p">,
27        Group<1>,
28        Arg<"Value">,
29        Desc<"This value defines the period in which PSB packets will be "
30             "generated. A PSB packet is a synchronization packet that "
31             "contains a "
32             "TSC timestamp and the current absolute instruction pointer. "
33             "This parameter can only be used if "
34             "/sys/bus/event_source/devices/intel_pt/caps/psb_cyc is 1. "
35             "Otherwise, "
36             "the PSB period will be defined by the processor. If supported, "
37             "valid "
38             "values for this period can be found in "
39             "/sys/bus/event_source/devices/intel_pt/caps/psb_periods which "
40             "contains a hexadecimal number, whose bits represent valid values "
41             "e.g. if bit 2 is set, then value 2 is valid. The psb_period "
42             "value is "
43             "converted to the approximate number of raw trace bytes between "
44             "PSB "
45             "packets as: 2 ^ (value + 11), e.g. value 3 means 16KiB between "
46             "PSB "
47             "packets. Defaults to 0 if supported.">;
48}
49
50let Command = "process trace start intel pt" in {
51  def process_trace_start_intel_pt_buffer_size
52      : Option<"buffer-size", "s">,
53        Group<1>,
54        Arg<"Value">,
55        Desc<
56            "Size in bytes used by each individual per-thread or per-cpu trace "
57            "buffer. It must be a power of 2 greater than or equal to 4096 "
58            "(2^12) "
59            "bytes. It's possible to specify a unit for these bytes, like 4KB, "
60            "16KiB or 1MB. Lower case units are allowed for convenience.">;
61  def process_trace_start_intel_pt_per_cpu_tracing
62      : Option<"per-cpu-tracing", "c">,
63        Group<1>,
64        Desc<
65            "Instead of having an individual trace buffer per thread, which "
66            "uses "
67            "a number trace buffers proportional to the number of running "
68            "threads, this option triggers the collection on a per cpu core "
69            "basis. This effectively traces the entire activity on all cpus "
70            "using a limited amount of trace buffers regardless of the number "
71            "of "
72            "threads. This might cause data loss for less frequent threads. "
73            "This "
74            "option forces the capture of TSC timestamps (see --tsc). Also, "
75            "this "
76            "option can't be used simulatenously with any other trace sessions "
77            "because of its system-wide nature.">;
78  def process_trace_start_intel_pt_process_size_limit
79      : Option<"total-size-limit", "l">,
80        Group<1>,
81        Arg<"Value">,
82        Desc<
83            "Maximum total trace size per process in bytes. This limit applies "
84            "to "
85            "the sum of the sizes of all thread and cpu traces of this "
86            "process, "
87            "excluding the ones created with the \"thread trace start\" "
88            "command. "
89            "Whenever a thread is attempted to be traced due to this command "
90            "and "
91            "the limit would be reached, the process is stopped with a "
92            "\"processor trace\" reason, so that the user can retrace the "
93            "process "
94            "if needed. Defaults to 500MB. It's possible to specify a unit for "
95            "these bytes, like 4KB, 16KiB or 1MB. Lower case units are allowed "
96            "for convenience.">;
97  def process_trace_start_intel_pt_tsc
98      : Option<"tsc", "t">,
99        Group<1>,
100        Desc<"Enable the use of TSC timestamps. This is supported on all "
101             "devices "
102             "that support intel-pt.">;
103  def process_trace_start_intel_pt_psb_period
104      : Option<"psb-period", "p">,
105        Group<1>,
106        Arg<"Value">,
107        Desc<"This value defines the period in which PSB packets will be "
108             "generated. A PSB packet is a synchronization packet that "
109             "contains a "
110             "TSC timestamp and the current absolute instruction pointer. "
111             "This parameter can only be used if "
112             "/sys/bus/event_source/devices/intel_pt/caps/psb_cyc is 1. "
113             "Otherwise, "
114             "the PSB period will be defined by the processor. If supported, "
115             "valid "
116             "values for this period can be found in "
117             "/sys/bus/event_source/devices/intel_pt/caps/psb_periods which "
118             "contains a hexadecimal number, whose bits represent valid values "
119             "e.g. if bit 2 is set, then value 2 is valid. The psb_period "
120             "value is "
121             "converted to the approximate number of raw trace bytes between "
122             "PSB "
123             "packets as: 2 ^ (value + 11), e.g. value 3 means 16KiB between "
124             "PSB "
125             "packets. Defaults to 0 if supported.">;
126  def process_trace_start_intel_pt_disable_cgroup_filtering
127      : Option<"disable-cgroup-filtering", "d">,
128        Desc<"Disable the automatic cgroup filtering that is applied if "
129             "--per-cpu "
130             "is provided. Cgroup filtering allows collecting intel pt data "
131             "exclusively of processes of the same cgroup as the target.">;
132}
133