Skip to content

Commit

Permalink
hwtracing: hisi_ptt: Add trace function support for HiSilicon PCIe Tu…
Browse files Browse the repository at this point in the history
…ne and Trace device

HiSilicon PCIe tune and trace device(PTT) is a PCIe Root Complex integrated
Endpoint(RCiEP) device, providing the capability to dynamically monitor and
tune the PCIe traffic and trace the TLP headers.

Add the driver for the device to enable the trace function. Register PMU
device of PTT trace, then users can use trace through perf command. The
driver makes use of perf AUX trace function and support the following
events to configure the trace:

- filter: select Root port or Endpoint to trace
- type: select the type of traced TLP headers
- direction: select the direction of traced TLP headers
- format: select the data format of the traced TLP headers

This patch initially add basic trace support of PTT device.

Acked-by: Mathieu Poirier <[email protected]>
Reviewed-by: Jonathan Cameron <[email protected]>
Reviewed-by: John Garry <[email protected]>
Signed-off-by: Yicong Yang <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Mathieu Poirier <[email protected]>
  • Loading branch information
Yicong Yang authored and mathieupoirier committed Sep 8, 2022
1 parent 24b6c77 commit ff0de06
Show file tree
Hide file tree
Showing 6 changed files with 1,110 additions and 0 deletions.
1 change: 1 addition & 0 deletions drivers/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,7 @@ obj-$(CONFIG_USB4) += thunderbolt/
obj-$(CONFIG_CORESIGHT) += hwtracing/coresight/
obj-y += hwtracing/intel_th/
obj-$(CONFIG_STM) += hwtracing/stm/
obj-$(CONFIG_HISI_PTT) += hwtracing/ptt/
obj-y += android/
obj-$(CONFIG_NVMEM) += nvmem/
obj-$(CONFIG_FPGA) += fpga/
Expand Down
2 changes: 2 additions & 0 deletions drivers/hwtracing/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,6 @@ source "drivers/hwtracing/stm/Kconfig"

source "drivers/hwtracing/intel_th/Kconfig"

source "drivers/hwtracing/ptt/Kconfig"

endmenu
12 changes: 12 additions & 0 deletions drivers/hwtracing/ptt/Kconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# SPDX-License-Identifier: GPL-2.0-only
config HISI_PTT
tristate "HiSilicon PCIe Tune and Trace Device"
depends on ARM64 || (COMPILE_TEST && 64BIT)
depends on PCI && HAS_DMA && HAS_IOMEM && PERF_EVENTS
help
HiSilicon PCIe Tune and Trace device exists as a PCIe RCiEP
device, and it provides support for PCIe traffic tuning and
tracing TLP headers to the memory.

This driver can also be built as a module. If so, the module
will be called hisi_ptt.
2 changes: 2 additions & 0 deletions drivers/hwtracing/ptt/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# SPDX-License-Identifier: GPL-2.0
obj-$(CONFIG_HISI_PTT) += hisi_ptt.o
Loading

0 comments on commit ff0de06

Please sign in to comment.