summaryrefslogtreecommitdiff
path: root/tools/perf/scripts/python
diff options
context:
space:
mode:
authorYufan Dou <douyufan@picoheart.com>2026-07-08 16:45:04 +0800
committerWill Deacon <will@kernel.org>2026-07-31 16:32:06 +0000
commit18ec1f543ae1466fdd437803c64ab7c5e43cc36c (patch)
tree4bf4ecd5b28ee1f20cd99b86c78ff7bc4a3b7fe8 /tools/perf/scripts/python
parentcf65b4d765b5f09db46baaa2dadf10fd53708a64 (diff)
perf/dwc_pcie: Support narrowed time-based counter for long time monitoring
The DWC PCIe Time-Based Analysis Data Register (the counter for time-based events) is architected as 64-bit, but some hardware implementations do not implement the full width. On these implementations the counter stops after reaching its implemented width. This will limit the usage for short time monitoring only. The counter will only cover ~15s for monitoring RX TLP payloads on our platform. Add an optional hrtimer that fires every 2 seconds. It'll take the role as the counter overflow interrupt to read-update-reset the counter and event counts to break the limits of the narrow counters. It'll only apply on timer-based counter. The 2 seconds update period is the half of the maximum counting period (4s) of the time-based counter under period counting mode of the hardware. Because fully-implemented 64-bit counters do not need this workaround, enable this hrtimer on the platforms known to have narrowed counter. Before this patch, when counting fio for 10m the counts is incorrect: root@localhost:/tmp# perf stat -e dwc_rootport_20000/rx_pcie_tlp_data_payload/ -- fio --runtime=10m fio_job.config [...] Run status group 0 (all jobs): READ: bw=5594MiB/s (5865MB/s), 5594MiB/s-5594MiB/s (5865MB/s-5865MB/s), io=3278GiB (3519GB), run=600010-600010msec [...] Performance counter stats for 'system wide': 137,438,953,456 dwc_rootport_20000/rx_pcie_tlp_data_payload/ After this patch the counts is as expected: root@localhost:/tmp# perf stat -e dwc_rootport_20000/rx_pcie_tlp_data_payload/ -- fio --runtime=10m fio_job.config [...] Run status group 0 (all jobs): READ: bw=5632MiB/s (5905MB/s), 5632MiB/s-5632MiB/s (5905MB/s-5905MB/s), io=3300GiB (3543GB), run=600013-600013msec [...] Performance counter stats for 'system wide': 3,543,850,268,576 dwc_rootport_20000/rx_pcie_tlp_data_payload/ Signed-off-by: Yufan Dou <douyufan@picoheart.com> Signed-off-by: Yicong Yang <yang.yicong@picoheart.com> Signed-off-by: Will Deacon <will@kernel.org>
Diffstat (limited to 'tools/perf/scripts/python')
0 files changed, 0 insertions, 0 deletions