usphinx.addnodesdocument)}( rawsourcechildren]( translations LanguagesNode)}(hhh](h pending_xref)}(hhh]docutils.nodesTextChinese (Simplified)}parenthsba attributes}(ids]classes]names]dupnames]backrefs] refdomainstdreftypedoc reftarget"/translations/zh_CN/trace/hisi-pttmodnameN classnameN refexplicitutagnamehhh ubh)}(hhh]hChinese (Traditional)}hh2sbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget"/translations/zh_TW/trace/hisi-pttmodnameN classnameN refexplicituh1hhh ubh)}(hhh]hItalian}hhFsbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget"/translations/it_IT/trace/hisi-pttmodnameN classnameN refexplicituh1hhh ubh)}(hhh]hJapanese}hhZsbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget"/translations/ja_JP/trace/hisi-pttmodnameN classnameN refexplicituh1hhh ubh)}(hhh]hKorean}hhnsbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget"/translations/ko_KR/trace/hisi-pttmodnameN classnameN refexplicituh1hhh ubh)}(hhh]hSpanish}hhsbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget"/translations/sp_SP/trace/hisi-pttmodnameN classnameN refexplicituh1hhh ubeh}(h]h ]h"]h$]h&]current_languageEnglishuh1h hh _documenthsourceNlineNubhcomment)}(h SPDX-License-Identifier: GPL-2.0h]h SPDX-License-Identifier: GPL-2.0}hhsbah}(h]h ]h"]h$]h&] xml:spacepreserveuh1hhhhhh_h]h9/sys/bus/event_source/devices/hisi_ptt_}hjsbah}(h]h ]h"]h$]h&]hhuh1hhhhK+hhhhubeh}(h] introductionah ]h"] introductionah$]h&]uh1hhhhhhhhKubh)}(hhh](h)}(hTuneh]hTune}(hj/hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj,hhhhhK.ubh)}(hPTT tune is designed for monitoring and adjusting PCIe link parameters (events). Currently we support events in 2 classes. The scope of the events covers the PCIe core to which the PTT device belongs.h]hPTT tune is designed for monitoring and adjusting PCIe link parameters (events). Currently we support events in 2 classes. The scope of the events covers the PCIe core to which the PTT device belongs.}(hj=hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK0hj,hhubh)}(hEach event is presented as a file under $(PTT PMU dir)/tune, and a simple open/read/write/close cycle will be used to tune the event. ::h]hEach event is presented as a file under $(PTT PMU dir)/tune, and a simple open/read/write/close cycle will be used to tune the event.}(hjKhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK4hj,hhubh)}(h$ cd /sys/bus/event_source/devices/hisi_ptt_/tune $ ls qos_tx_cpl qos_tx_np qos_tx_p tx_path_rx_req_alloc_buf_level tx_path_tx_req_alloc_buf_level $ cat qos_tx_dp 1 $ echo 2 > qos_tx_dp $ cat qos_tx_dp 2h]h$ cd /sys/bus/event_source/devices/hisi_ptt_/tune $ ls qos_tx_cpl qos_tx_np qos_tx_p tx_path_rx_req_alloc_buf_level tx_path_tx_req_alloc_buf_level $ cat qos_tx_dp 1 $ echo 2 > qos_tx_dp $ cat qos_tx_dp 2}hjYsbah}(h]h ]h"]h$]h&]hhuh1hhhhK8hj,hhubh)}(hCurrent value (numerical value) of the event can be simply read from the file, and the desired value written to the file to tune.h]hCurrent value (numerical value) of the event can be simply read from the file, and the desired value written to the file to tune.}(hjghhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKChj,hhubh)}(hhh](h)}(h1. Tx Path QoS Controlh]h1. Tx Path QoS Control}(hjxhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjuhhhhhKGubh)}(hQThe following files are provided to tune the QoS of the tx path of the PCIe core.h]hQThe following files are provided to tune the QoS of the tx path of the PCIe core.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKIhjuhhubh bullet_list)}(hhh](h list_item)}(h(qos_tx_cpl: weight of Tx completion TLPsh]h)}(hjh]h(qos_tx_cpl: weight of Tx completion TLPs}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKLhjubah}(h]h ]h"]h$]h&]uh1jhjhhhhhNubj)}(h'qos_tx_np: weight of Tx non-posted TLPsh]h)}(hjh]h'qos_tx_np: weight of Tx non-posted TLPs}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKMhjubah}(h]h ]h"]h$]h&]uh1jhjhhhhhNubj)}(h#qos_tx_p: weight of Tx posted TLPs h]h)}(h"qos_tx_p: weight of Tx posted TLPsh]h"qos_tx_p: weight of Tx posted TLPs}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKNhjubah}(h]h ]h"]h$]h&]uh1jhjhhhhhNubeh}(h]h ]h"]h$]h&]bullet-uh1jhhhKLhjuhhubh)}(hThe weight influences the proportion of certain packets on the PCIe link. For example, for the storage scenario, increase the proportion of the completion packets on the link to enhance the performance as more completions are consumed.h]hThe weight influences the proportion of certain packets on the PCIe link. For example, for the storage scenario, increase the proportion of the completion packets on the link to enhance the performance as more completions are consumed.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKPhjuhhubh)}(hThe available tune data of these events is [0, 1, 2]. Writing a negative value will return an error, and out of range values will be converted to 2. Note that the event value just indicates a probable level, but is not precise.h]hThe available tune data of these events is [0, 1, 2]. Writing a negative value will return an error, and out of range values will be converted to 2. Note that the event value just indicates a probable level, but is not precise.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKUhjuhhubeh}(h]tx-path-qos-controlah ]h"]1. tx path qos controlah$]h&]uh1hhj,hhhhhKGubh)}(hhh](h)}(h2. Tx Path Buffer Controlh]h2. Tx Path Buffer Control}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhj hhhhhK[ubh)}(hLFollowing files are provided to tune the buffer of tx path of the PCIe core.h]hLFollowing files are provided to tune the buffer of tx path of the PCIe core.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK]hj hhubj)}(hhh](j)}(h-rx_alloc_buf_level: watermark of Rx requestedh]h)}(hj1h]h-rx_alloc_buf_level: watermark of Rx requested}(hj3hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK_hj/ubah}(h]h ]h"]h$]h&]uh1jhj,hhhhhNubj)}(h.tx_alloc_buf_level: watermark of Tx requested h]h)}(h-tx_alloc_buf_level: watermark of Tx requestedh]h-tx_alloc_buf_level: watermark of Tx requested}(hjJhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK`hjFubah}(h]h ]h"]h$]h&]uh1jhj,hhhhhNubeh}(h]h ]h"]h$]h&]jjuh1jhhhK_hj hhubh)}(hXThese events influence the watermark of the buffer allocated for each type. Rx means the inbound while Tx means outbound. The packets will be stored in the buffer first and then transmitted either when the watermark reached or when timed out. For a busy direction, you should increase the related buffer watermark to avoid frequently posting and thus enhance the performance. In most cases just keep the default value.h]hXThese events influence the watermark of the buffer allocated for each type. Rx means the inbound while Tx means outbound. The packets will be stored in the buffer first and then transmitted either when the watermark reached or when timed out. For a busy direction, you should increase the related buffer watermark to avoid frequently posting and thus enhance the performance. In most cases just keep the default value.}(hjdhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKbhj hhubh)}(hThe available tune data of above events is [0, 1, 2]. Writing a negative value will return an error, and out of range values will be converted to 2. Note that the event value just indicates a probable level, but is not precise.h]hThe available tune data of above events is [0, 1, 2]. Writing a negative value will return an error, and out of range values will be converted to 2. Note that the event value just indicates a probable level, but is not precise.}(hjrhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKihj hhubeh}(h]tx-path-buffer-controlah ]h"]2. tx path buffer controlah$]h&]uh1hhj,hhhhhK[ubeh}(h]tuneah ]h"]tuneah$]h&]uh1hhhhhhhhK.ubh)}(hhh](h)}(hTraceh]hTrace}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhhhhhKoubh)}(hXzPTT trace is designed for dumping the TLP headers to the memory, which can be used to analyze the transactions and usage condition of the PCIe Link. You can choose to filter the traced headers by either Requester ID, or those downstream of a set of Root Ports on the same core of the PTT device. It's also supported to trace the headers of certain type and of certain direction.h]hX|PTT trace is designed for dumping the TLP headers to the memory, which can be used to analyze the transactions and usage condition of the PCIe Link. You can choose to filter the traced headers by either Requester ID, or those downstream of a set of Root Ports on the same core of the PTT device. It’s also supported to trace the headers of certain type and of certain direction.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKqhjhhubh)}(hX1You can use the perf command `perf record` to set the parameters, start trace and get the data. It's also supported to decode the trace data with `perf report`. The control parameters for trace is inputted as event code for each events, which will be further illustrated later. An example usage is like ::h](hYou can use the perf command }(hjhhhNhNubhtitle_reference)}(h `perf record`h]h perf record}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubhj to set the parameters, start trace and get the data. It’s also supported to decode the trace data with }(hjhhhNhNubj)}(h `perf report`h]h perf report}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubh. The control parameters for trace is inputted as event code for each events, which will be further illustrated later. An example usage is like}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKxhjhhubh)}(hV$ perf record -e hisi_ptt0_2/filter=0x80001,type=1,direction=1, format=1/ -- sleep 5h]hV$ perf record -e hisi_ptt0_2/filter=0x80001,type=1,direction=1, format=1/ -- sleep 5}hjsbah}(h]h ]h"]h$]h&]hhuh1hhhhKhjhhubh)}(hThis will trace the TLP headers downstream root port 0000:00:10.1 (event code for event 'filter' is 0x80001) with type of posted TLP requests, direction of inbound and traced data format of 8DW.h]hThis will trace the TLP headers downstream root port 0000:00:10.1 (event code for event ‘filter’ is 0x80001) with type of posted TLP requests, direction of inbound and traced data format of 8DW.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjhhubh)}(hhh](h)}(h 1. Filterh]h 1. Filter}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhhhhhKubh)}(hXThe TLP headers to trace can be filtered by the Root Ports or the Requester ID of the Endpoint, which are located on the same core of the PTT device. You can set the filter by specifying the `filter` parameter which is required to start the trace. The parameter value is 20 bit. Bit 19 indicates the filter type. 1 for Root Port filter and 0 for Requester filter. Bit[15:0] indicates the filter value. The value for a Root Port is a mask of the core port id which is calculated from its PCI Slot ID as (slotid & 7) * 2. The value for a Requester is the Requester ID (Device ID of the PCIe function). Bit[18:16] is currently reserved for extension.h](hThe TLP headers to trace can be filtered by the Root Ports or the Requester ID of the Endpoint, which are located on the same core of the PTT device. You can set the filter by specifying the }(hjhhhNhNubj)}(h`filter`h]hfilter}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubhX parameter which is required to start the trace. The parameter value is 20 bit. Bit 19 indicates the filter type. 1 for Root Port filter and 0 for Requester filter. Bit[15:0] indicates the filter value. The value for a Root Port is a mask of the core port id which is calculated from its PCI Slot ID as (slotid & 7) * 2. The value for a Requester is the Requester ID (Device ID of the PCIe function). Bit[18:16] is currently reserved for extension.}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKhjhhubh)}(hFor example, if the desired filter is Endpoint function 0000:01:00.1 the filter value will be 0x00101. If the desired filter is Root Port 0000:00:10.0 then then filter value is calculated as 0x80001.h]hFor example, if the desired filter is Endpoint function 0000:01:00.1 the filter value will be 0x00101. If the desired filter is Root Port 0000:00:10.0 then then filter value is calculated as 0x80001.}(hj0hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjhhubh)}(hXZThe driver also presents every supported Root Port and Requester filter through sysfs. Each filter will be an individual file with name of its related PCIe device name (domain:bus:device.function). The files of Root Port filters are under $(PTT PMU dir)/root_port_filters and files of Requester filters are under $(PTT PMU dir)/requester_filters.h]hXZThe driver also presents every supported Root Port and Requester filter through sysfs. Each filter will be an individual file with name of its related PCIe device name (domain:bus:device.function). The files of Root Port filters are under $(PTT PMU dir)/root_port_filters and files of Requester filters are under $(PTT PMU dir)/requester_filters.}(hj>hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjhhubh)}(hXNote that multiple Root Ports can be specified at one time, but only one Endpoint function can be specified in one trace. Specifying both Root Port and function at the same time is not supported. Driver maintains a list of available filters and will check the invalid inputs.h]hXNote that multiple Root Ports can be specified at one time, but only one Endpoint function can be specified in one trace. Specifying both Root Port and function at the same time is not supported. Driver maintains a list of available filters and will check the invalid inputs.}(hjLhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjhhubh)}(hThe available filters will be dynamically updated, which means you will always get correct filter information when hotplug events happen, or when you manually remove/rescan the devices.h]hThe available filters will be dynamically updated, which means you will always get correct filter information when hotplug events happen, or when you manually remove/rescan the devices.}(hjZhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjhhubeh}(h]filterah ]h"] 1. filterah$]h&]uh1hhjhhhhhKubh)}(hhh](h)}(h2. Typeh]h2. Type}(hjshhhNhNubah}(h]h ]h"]h$]h&]uh1hhjphhhhhKubh)}(hYou can trace the TLP headers of certain types by specifying the `type` parameter, which is required to start the trace. The parameter value is 8 bit. Current supported types and related values are shown below:h](hAYou can trace the TLP headers of certain types by specifying the }(hjhhhNhNubj)}(h`type`h]htype}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubh parameter, which is required to start the trace. The parameter value is 8 bit. Current supported types and related values are shown below:}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKhjphhubj)}(hhh](j)}(h 8'b00000001: posted requests (P)h]h)}(hjh]h"8’b00000001: posted requests (P)}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjubah}(h]h ]h"]h$]h&]uh1jhjhhhhhNubj)}(h%8'b00000010: non-posted requests (NP)h]h)}(hjh]h'8’b00000010: non-posted requests (NP)}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjubah}(h]h ]h"]h$]h&]uh1jhjhhhhhNubj)}(h8'b00000100: completions (CPL) h]h)}(h8'b00000100: completions (CPL)h]h 8’b00000100: completions (CPL)}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjubah}(h]h ]h"]h$]h&]uh1jhjhhhhhNubeh}(h]h ]h"]h$]h&]jjuh1jhhhKhjphhubh)}(h|You can specify multiple types when tracing inbound TLP headers, but can only specify one when tracing outbound TLP headers.h]h|You can specify multiple types when tracing inbound TLP headers, but can only specify one when tracing outbound TLP headers.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjphhubeh}(h]typeah ]h"]2. typeah$]h&]uh1hhjhhhhhKubh)}(hhh](h)}(h 3. Directionh]h 3. Direction}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhhhhhKubh)}(hXAYou can trace the TLP headers from certain direction, which is relative to the Root Port or the PCIe core, by specifying the `direction` parameter. This is optional and the default parameter is inbound. The parameter value is 4 bit. When the desired format is 4DW, directions and related values supported are shown below:h](h}You can trace the TLP headers from certain direction, which is relative to the Root Port or the PCIe core, by specifying the }(hjhhhNhNubj)}(h `direction`h]h direction}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubh parameter. This is optional and the default parameter is inbound. The parameter value is 4 bit. When the desired format is 4DW, directions and related values supported are shown below:}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKhjhhubj)}(hhh](j)}(h"4'b0000: inbound TLPs (P, NP, CPL)h]h)}(hj<h]h$4’b0000: inbound TLPs (P, NP, CPL)}(hj>hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj:ubah}(h]h ]h"]h$]h&]uh1jhj7hhhhhNubj)}(h#4'b0001: outbound TLPs (P, NP, CPL)h]h)}(hjSh]h%4’b0001: outbound TLPs (P, NP, CPL)}(hjUhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjQubah}(h]h ]h"]h$]h&]uh1jhj7hhhhhNubj)}(hC4'b0010: outbound TLPs (P, NP, CPL) and inbound TLPs (P, NP, CPL B)h]h)}(hjjh]hE4’b0010: outbound TLPs (P, NP, CPL) and inbound TLPs (P, NP, CPL B)}(hjlhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjhubah}(h]h ]h"]h$]h&]uh1jhj7hhhhhNubj)}(h=4'b0011: outbound TLPs (P, NP, CPL) and inbound TLPs (CPL A) h]h)}(h<4'b0011: outbound TLPs (P, NP, CPL) and inbound TLPs (CPL A)h]h>4’b0011: outbound TLPs (P, NP, CPL) and inbound TLPs (CPL A)}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjubah}(h]h ]h"]h$]h&]uh1jhj7hhhhhNubeh}(h]h ]h"]h$]h&]jjuh1jhhhKhjhhubh)}(hXWhen the desired format is 8DW, directions and related values supported are shown below:h]hXWhen the desired format is 8DW, directions and related values supported are shown below:}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjhhubj)}(hhh](j)}(h4'b0000: reservedh]h)}(hjh]h4’b0000: reserved}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjubah}(h]h ]h"]h$]h&]uh1jhjhhhhhNubj)}(h#4'b0001: outbound TLPs (P, NP, CPL)h]h)}(hjh]h%4’b0001: outbound TLPs (P, NP, CPL)}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjubah}(h]h ]h"]h$]h&]uh1jhjhhhhhNubj)}(h$4'b0010: inbound TLPs (P, NP, CPL B)h]h)}(hjh]h&4’b0010: inbound TLPs (P, NP, CPL B)}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjubah}(h]h ]h"]h$]h&]uh1jhjhhhhhNubj)}(h4'b0011: inbound TLPs (CPL A) h]h)}(h4'b0011: inbound TLPs (CPL A)h]h4’b0011: inbound TLPs (CPL A)}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjubah}(h]h ]h"]h$]h&]uh1jhjhhhhhNubeh}(h]h ]h"]h$]h&]jjuh1jhhhKhjhhubh)}(h2Inbound completions are classified into two types:h]h2Inbound completions are classified into two types:}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjhhubj)}(hhh](j)}(hXcompletion A (CPL A): completion of CHI/DMA/Native non-posted requests, except for CPL Bh]h)}(hj$h]hXcompletion A (CPL A): completion of CHI/DMA/Native non-posted requests, except for CPL B}(hj&hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj"ubah}(h]h ]h"]h$]h&]uh1jhjhhhhhNubj)}(hQcompletion B (CPL B): completion of DMA remote2local and P2P non-posted requests h]h)}(hPcompletion B (CPL B): completion of DMA remote2local and P2P non-posted requestsh]hPcompletion B (CPL B): completion of DMA remote2local and P2P non-posted requests}(hj=hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj9ubah}(h]h ]h"]h$]h&]uh1jhjhhhhhNubeh}(h]h ]h"]h$]h&]jjuh1jhhhKhjhhubeh}(h] directionah ]h"] 3. directionah$]h&]uh1hhjhhhhhKubh)}(hhh](h)}(h 4. Formath]h 4. Format}(hjbhhhNhNubah}(h]h ]h"]h$]h&]uh1hhj_hhhhhKubh)}(hYou can change the format of the traced TLP headers by specifying the `format` parameter. The default format is 4DW. The parameter value is 4 bit. Current supported formats and related values are shown below:h](hFYou can change the format of the traced TLP headers by specifying the }(hjphhhNhNubj)}(h`format`h]hformat}(hjxhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjpubh parameter. The default format is 4DW. The parameter value is 4 bit. Current supported formats and related values are shown below:}(hjphhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKhj_hhubj)}(hhh](j)}(h"4'b0000: 4DW length per TLP headerh]h)}(hjh]h$4’b0000: 4DW length per TLP header}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjubah}(h]h ]h"]h$]h&]uh1jhjhhhhhNubj)}(h#4'b0001: 8DW length per TLP header h]h)}(h"4'b0001: 8DW length per TLP headerh]h$4’b0001: 8DW length per TLP header}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjubah}(h]h ]h"]h$]h&]uh1jhjhhhhhNubeh}(h]h ]h"]h$]h&]jjuh1jhhhKhj_hhubh)}(hAThe traced TLP header format is different from the PCIe standard.h]hAThe traced TLP header format is different from the PCIe standard.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj_hhubh)}(hXWhen using the 8DW data format, the entire TLP header is logged (Header DW0-3 shown below). For example, the TLP header for Memory Reads with 64-bit addresses is shown in PCIe r5.0, Figure 2-17; the header for Configuration Requests is shown in Figure 2.20, etc.h]hXWhen using the 8DW data format, the entire TLP header is logged (Header DW0-3 shown below). For example, the TLP header for Memory Reads with 64-bit addresses is shown in PCIe r5.0, Figure 2-17; the header for Configuration Requests is shown in Figure 2.20, etc.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj_hhubh)}(hIn addition, 8DW trace buffer entries contain a timestamp and possibly a prefix for a PASID TLP prefix (see Figure 6-20, PCIe r5.0). Otherwise this field will be all 0.h]hIn addition, 8DW trace buffer entries contain a timestamp and possibly a prefix for a PASID TLP prefix (see Figure 6-20, PCIe r5.0). Otherwise this field will be all 0.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj_hhubh)}(hqThe bit[31:11] of DW0 is always 0x1fffff, which can be used to distinguish the data format. 8DW format is like ::h]hnThe bit[31:11] of DW0 is always 0x1fffff, which can be used to distinguish the data format. 8DW format is like}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj_hhubh)}(hXbits [ 31:11 ][ 10:0 ] |---------------------------------------|-------------------| DW0 [ 0x1fffff ][ Reserved (0x7ff) ] DW1 [ Prefix ] DW2 [ Header DW0 ] DW3 [ Header DW1 ] DW4 [ Header DW2 ] DW5 [ Header DW3 ] DW6 [ Reserved (0x0) ] DW7 [ Time ]h]hXbits [ 31:11 ][ 10:0 ] |---------------------------------------|-------------------| DW0 [ 0x1fffff ][ Reserved (0x7ff) ] DW1 [ Prefix ] DW2 [ Header DW0 ] DW3 [ Header DW1 ] DW4 [ Header DW2 ] DW5 [ Header DW3 ] DW6 [ Reserved (0x0) ] DW7 [ Time ]}hjsbah}(h]h ]h"]h$]h&]hhuh1hhhhKhj_hhubh)}(hWhen using the 4DW data format, DW0 of the trace buffer entry contains selected fields of DW0 of the TLP, together with a timestamp. DW1-DW3 of the trace buffer entry contain DW1-DW3 directly from the TLP header.h]hWhen using the 4DW data format, DW0 of the trace buffer entry contains selected fields of DW0 of the TLP, together with a timestamp. DW1-DW3 of the trace buffer entry contain DW1-DW3 directly from the TLP header.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj_hhubh)}(h4DW format is like ::h]h4DW format is like}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj_hhubh)}(hXbits [31:30] [ 29:25 ][24][23][22][21][ 20:11 ][ 10:0 ] |-----|---------|---|---|---|---|-------------|-------------| DW0 [ Fmt ][ Type ][T9][T8][TH][SO][ Length ][ Time ] DW1 [ Header DW1 ] DW2 [ Header DW2 ] DW3 [ Header DW3 ]h]hXbits [31:30] [ 29:25 ][24][23][22][21][ 20:11 ][ 10:0 ] |-----|---------|---|---|---|---|-------------|-------------| DW0 [ Fmt ][ Type ][T9][T8][TH][SO][ Length ][ Time ] DW1 [ Header DW1 ] DW2 [ Header DW2 ] DW3 [ Header DW3 ]}hj*sbah}(h]h ]h"]h$]h&]hhuh1hhhhKhj_hhubeh}(h]formatah ]h"] 4. formatah$]h&]uh1hhjhhhhhKubh)}(hhh](h)}(h5. Memory Managementh]h5. Memory Management}(hjChhhNhNubah}(h]h ]h"]h$]h&]uh1hhj@hhhhhMubh)}(hXThe traced TLP headers will be written to the memory allocated by the driver. The hardware accepts 4 DMA address with same size, and writes the buffer sequentially like below. If DMA addr 3 is finished and the trace is still on, it will return to addr 0. ::h]hThe traced TLP headers will be written to the memory allocated by the driver. The hardware accepts 4 DMA address with same size, and writes the buffer sequentially like below. If DMA addr 3 is finished and the trace is still on, it will return to addr 0.}(hjQhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj@hhubh)}(hw+->[DMA addr 0]->[DMA addr 1]->[DMA addr 2]->[DMA addr 3]-+ +---------------------------------------------------------+h]hw+->[DMA addr 0]->[DMA addr 1]->[DMA addr 2]->[DMA addr 3]-+ +---------------------------------------------------------+}hj_sbah}(h]h ]h"]h$]h&]hhuh1hhhhM hj@hhubh)}(hXDriver will allocate each DMA buffer of 4MiB. The finished buffer will be copied to the perf AUX buffer allocated by the perf core. Once the AUX buffer is full while the trace is still on, driver will commit the AUX buffer first and then apply for a new one with the same size. The size of AUX buffer is default to 16MiB. User can adjust the size by specifying the `-m` parameter of the perf command.h](hXmDriver will allocate each DMA buffer of 4MiB. The finished buffer will be copied to the perf AUX buffer allocated by the perf core. Once the AUX buffer is full while the trace is still on, driver will commit the AUX buffer first and then apply for a new one with the same size. The size of AUX buffer is default to 16MiB. User can adjust the size by specifying the }(hjmhhhNhNubj)}(h`-m`h]h-m}(hjuhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjmubh parameter of the perf command.}(hjmhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMhj@hhubeh}(h]memory-managementah ]h"]5. memory managementah$]h&]uh1hhjhhhhhMubh)}(hhh](h)}(h 6. Decodingh]h 6. Decoding}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhhhhhMubh)}(hYou can decode the traced data with `perf report -D` command (currently only support to dump the raw trace data). The traced data will be decoded according to the format described previously (take 8DW as an example): ::h](h$You can decode the traced data with }(hjhhhNhNubj)}(h`perf report -D`h]hperf report -D}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubh command (currently only support to dump the raw trace data). The traced data will be decoded according to the format described previously (take 8DW as an example):}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMhjhhubh)}(hX[...perf headers and other information] . ... HISI PTT data: size 4194304 bytes . 00000000: 00 00 00 00 Prefix . 00000004: 01 00 00 60 Header DW0 . 00000008: 0f 1e 00 01 Header DW1 . 0000000c: 04 00 00 00 Header DW2 . 00000010: 40 00 81 02 Header DW3 . 00000014: 33 c0 04 00 Time . 00000020: 00 00 00 00 Prefix . 00000024: 01 00 00 60 Header DW0 . 00000028: 0f 1e 00 01 Header DW1 . 0000002c: 04 00 00 00 Header DW2 . 00000030: 40 00 81 02 Header DW3 . 00000034: 02 00 00 00 Time . 00000040: 00 00 00 00 Prefix . 00000044: 01 00 00 60 Header DW0 . 00000048: 0f 1e 00 01 Header DW1 . 0000004c: 04 00 00 00 Header DW2 . 00000050: 40 00 81 02 Header DW3 [...]h]hX[...perf headers and other information] . ... HISI PTT data: size 4194304 bytes . 00000000: 00 00 00 00 Prefix . 00000004: 01 00 00 60 Header DW0 . 00000008: 0f 1e 00 01 Header DW1 . 0000000c: 04 00 00 00 Header DW2 . 00000010: 40 00 81 02 Header DW3 . 00000014: 33 c0 04 00 Time . 00000020: 00 00 00 00 Prefix . 00000024: 01 00 00 60 Header DW0 . 00000028: 0f 1e 00 01 Header DW1 . 0000002c: 04 00 00 00 Header DW2 . 00000030: 40 00 81 02 Header DW3 . 00000034: 02 00 00 00 Time . 00000040: 00 00 00 00 Prefix . 00000044: 01 00 00 60 Header DW0 . 00000048: 0f 1e 00 01 Header DW1 . 0000004c: 04 00 00 00 Header DW2 . 00000050: 40 00 81 02 Header DW3 [...]}hjsbah}(h]h ]h"]h$]h&]hhuh1hhhhMhjhhubeh}(h]decodingah ]h"] 6. decodingah$]h&]uh1hhjhhhhhMubeh}(h]traceah ]h"]traceah$]h&]uh1hhhhhhhhKoubeh}(h]$hisilicon-pcie-tune-and-trace-deviceah ]h"]$hisilicon pcie tune and trace deviceah$]h&]uh1hhhhhhhhKubeh}(h]h ]h"]h$]h&]sourcehuh1hcurrent_sourceN current_lineNsettingsdocutils.frontendValues)}(hN generatorN datestampN source_linkN source_urlN toc_backlinksentryfootnote_backlinksK sectnum_xformKstrip_commentsNstrip_elements_with_classesN strip_classesN report_levelK halt_levelKexit_status_levelKdebugNwarning_streamN tracebackinput_encoding utf-8-siginput_encoding_error_handlerstrictoutput_encodingutf-8output_encoding_error_handlerjerror_encodingutf-8error_encoding_error_handlerbackslashreplace language_codeenrecord_dependenciesNconfigN id_prefixhauto_id_prefixid dump_settingsNdump_internalsNdump_transformsNdump_pseudo_xmlNexpose_internalsNstrict_visitorN_disable_configN_sourceh _destinationN _config_files]7/var/lib/git/docbuild/linux/Documentation/docutils.confafile_insertion_enabled raw_enabledKline_length_limitM'pep_referencesN pep_base_urlhttps://peps.python.org/pep_file_url_templatepep-%04drfc_referencesN rfc_base_url&https://datatracker.ietf.org/doc/html/ tab_widthKtrim_footnote_reference_spacesyntax_highlightlong smart_quotessmartquotes_locales]character_level_inline_markupdoctitle_xform docinfo_xformKsectsubtitle_xform image_loadinglinkembed_stylesheetcloak_email_addressessection_self_linkenvNubreporterNindirect_targets]substitution_defs}substitution_names}refnames}refids}nameids}(jjj)j&jjj jjjjjjmjjjjj\jYj=j:jjjju nametypes}(jj)jj jjjmjj\j=jjuh}(jhj&hjj,jjujj jjjjjjjpjYjj:j_jj@jju footnote_refs} citation_refs} autofootnotes]autofootnote_refs]symbol_footnotes]symbol_footnote_refs] footnotes] citations]autofootnote_startKsymbol_footnote_startK id_counter collectionsCounter}Rparse_messages]hsystem_message)}(hhh]h)}(hfPossible title underline, too short for the title. Treating it as ordinary text because it's so short.h]hhPossible title underline, too short for the title. Treating it as ordinary text because it’s so short.}(hjvhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjsubah}(h]h ]h"]h$]h&]levelKtypeINFOlineKsourcehuh1jqhj_hhhhhKubatransform_messages] transformerN include_log] decorationNhhub.