!1055 Complementing PTT functions to the openEuler-22.03-LTS-SP2
Merge Pull Request from: @lujunhuaHW patch 1: From 60ab0114a9533d8181c381633a16d1612bd49f4e Mon Sep 17 00:00:00 2001 From: Yicong Yang yangyicong@hisilicon.com Date: Fri, 31 Mar 2023 14:05:12 +0800 Subject: [PATCH 1/5] hwtracing: hisi_ptt: Factor out filter allocation and release operation Factor out the allocation and release of filters. This will make it easier to extend and manage the function of the filter. patch 2: From d6574cff3915fc6c8ddbe9e802aaf6c55458209c Mon Sep 17 00:00:00 2001 From: Yicong Yang yangyicong@hisilicon.com Date: Tue, 11 Apr 2023 11:54:45 +0800 Subject: [PATCH 2/5] hwtracing: hisi_ptt: Add support for dynamically updating the filter list The PCIe devices supported by the PTT trace can be removed/rescanned by hotplug or through sysfs. Add support for dynamically updating the available filter list by registering a PCI bus notifier block. Then user can always get latest information about available tracing filters and driver can block the invalid filters of which related devices no longer exist in the system. patch 3: From 25ae6e1f2d62f781bde4ffc9aaea4dbf80b73baa Mon Sep 17 00:00:00 2001 From: Yicong Yang yangyicong@hisilicon.com Date: Tue, 11 Apr 2023 11:58:55 +0800 Subject: [PATCH 3/5] hwtracing: hisi_ptt: Export available filters through sysfs The PTT can only filter the traced TLP headers by the Root Ports or the Requester ID of the Endpoint, which are located on the same PCIe core of the PTT device. The filter value used is derived from the BDF number of the supported Root Port or the Endpoint. It's not friendly enough for the users since it requires the user to be familiar enough with the platform and calculate the filter value manually. This patch export the available filters through sysfs. Each available filters is presented as an individual file with the name of the BDF number of the related PCIe device. The files are created under (PTTPMUdir)/availablerootportfiltersand (PTT PMU dir)/available_requester_filters respectively. The filter value can be known by reading the related file. Then the users can easily know the available filters for trace and get the filter values without calculating. patch 4: From 480da5e8c8b2d9ae34591ae3055a21ae89b008de Mon Sep 17 00:00:00 2001 From: Yicong Yang yangyicong@hisilicon.com Date: Wed, 22 Feb 2023 14:30:26 +0800 Subject: [PATCH 4/5] hwtracing: hisi_ptt: Advertise PERF_PMU_CAP_NO_EXCLUDE for PTT PMU The PTT trace collects PCIe TLP headers from the PCIe link and don't have the ability to exclude certain context. It doesn't support itrace as well. So only advertise PERF_PMU_CAP_NO_EXCLUDE. This will greatly save the storage of final data. Tested tracing idle link for ~15s, without this patch we'll collect ~28.682MB data for context related information and with this patch it reduced to ~0.226MB. patch 5: From 2cf91daea11e1f5c2ba0ce187a156fcfadbcf2d1 Mon Sep 17 00:00:00 2001 From: Yicong Yang yangyicong@hisilicon.com Date: Thu, 1 Jun 2023 16:47:10 +0800 Subject: [PATCH 5/5] hwtracing: hisi_ptt: Fix potential sleep in atomic context We're using pci_irq_vector() to obtain the interrupt number and then bind it to the CPU start perf under the protection of spinlock in pmu::start(). pci_irq_vector() might sleep since [1] because it will call msi_domain_get_virq() to get the MSI interrupt number and it needs to acquire dev->msi.data->mutex. Getting a mutex will sleep on contention. So use pci_irq_vector() in an atomic context is problematic. This patch cached the interrupt number in the probe() and uses the cached data instead to avoid potential sleep. Link:https://gitee.com/openeuler/kernel/pulls/1055 Signed-off-by: Jialin Zhang <zhangjialin11@huawei.com>
Showing
想要评论请 注册 或 登录