xref: /freebsd-src/contrib/llvm-project/lldb/source/Plugins/Trace/intel-pt/TraceIntelPTOptions.td (revision 32a95656b51ebefcdf3e0b02c110825f59abd26f)
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: Option<"size", "s">,
10    Group<1>,
11    Arg<"Value">,
12    Desc<"Trace size in bytes per thread. It must be a power of 2 greater "
13         "than or equal to 4096 (2^12). The trace is circular keeping "
14         "the most recent data. Defaults to 4096 bytes.">;
15  def thread_trace_start_intel_pt_tsc: Option<"tsc", "t">,
16    Group<1>,
17    Desc<"Enable the use of TSC timestamps. This is supported on all devices "
18         "that support intel-pt.">;
19  def thread_trace_start_intel_pt_psb_period: Option<"psb-period", "p">,
20    Group<1>,
21    Arg<"Value">,
22    Desc<"This value defines the period in which PSB packets will be "
23         "generated. A PSB packet is a synchronization packet that contains a "
24         "TSC timestamp and the current absolute instruction pointer. "
25         "This parameter can only be used if "
26         "/sys/bus/event_source/devices/intel_pt/caps/psb_cyc is 1. Otherwise, "
27         "the PSB period will be defined by the processor. If supported, valid "
28         "values for this period can be found in "
29         "/sys/bus/event_source/devices/intel_pt/caps/psb_periods which "
30         "contains a hexadecimal number, whose bits represent valid values "
31         "e.g. if bit 2 is set, then value 2 is valid. The psb_period value is "
32         "converted to the approximate number of raw trace bytes between PSB "
33         "packets as: 2 ^ (value + 11), e.g. value 3 means 16KiB between PSB "
34         "packets. Defaults to 0 if supported.">;
35}
36
37let Command = "process trace start intel pt" in {
38  def process_trace_start_intel_pt_thread_size: Option<"thread-size", "s">,
39    Group<1>,
40    Arg<"Value">,
41    Desc<"Trace size in bytes per thread. It must be a power of 2 greater "
42         "than or equal to 4096 (2^12). The trace is circular keeping "
43         "the most recent data. Defaults to 4096 bytes.">;
44  def process_trace_start_intel_pt_process_size_limit: Option<"total-size-limit", "l">,
45    Group<1>,
46    Arg<"Value">,
47    Desc<"Maximum total trace size per process in bytes. This limit applies to "
48         "the sum of the sizes of all thread traces of this process, excluding "
49         "the ones created with the \"thread trace start\" command. "
50         "Whenever a thread is attempted to be traced due to this command and "
51         "the limit would be reached, the process is stopped with a "
52         "\"processor trace\" reason, so that the user can retrace the process "
53         "if needed. Defaults to 500MB.">;
54  def process_trace_start_intel_pt_tsc: Option<"tsc", "t">,
55    Group<1>,
56    Desc<"Enable the use of TSC timestamps. This is supported on all devices "
57         "that support intel-pt.">;
58  def process_trace_start_intel_pt_psb_period: Option<"psb-period", "p">,
59    Group<1>,
60    Arg<"Value">,
61    Desc<"This value defines the period in which PSB packets will be "
62         "generated. A PSB packet is a synchronization packet that contains a "
63         "TSC timestamp and the current absolute instruction pointer. "
64         "This parameter can only be used if "
65         "/sys/bus/event_source/devices/intel_pt/caps/psb_cyc is 1. Otherwise, "
66         "the PSB period will be defined by the processor. If supported, valid "
67         "values for this period can be found in "
68         "/sys/bus/event_source/devices/intel_pt/caps/psb_periods which "
69         "contains a hexadecimal number, whose bits represent valid values "
70         "e.g. if bit 2 is set, then value 2 is valid. The psb_period value is "
71         "converted to the approximate number of raw trace bytes between PSB "
72         "packets as: 2 ^ (value + 11), e.g. value 3 means 16KiB between PSB "
73         "packets. Defaults to 0 if supported.">;
74}
75