[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[RFC v8 01/28] hw/vfio/common: trace vfio_connect_container operations
From: |
Eric Auger |
Subject: |
[RFC v8 01/28] hw/vfio/common: trace vfio_connect_container operations |
Date: |
Thu, 25 Feb 2021 11:52:06 +0100 |
We currently trace vfio_disconnect_container() but we do not trace
the container <-> group creation, which can be useful to understand
the VFIO topology.
Signed-off-by: Eric Auger <eric.auger@redhat.com>
---
hw/vfio/common.c | 3 +++
hw/vfio/trace-events | 2 ++
2 files changed, 5 insertions(+)
diff --git a/hw/vfio/common.c b/hw/vfio/common.c
index a50b10c801..fcf2c5049f 100644
--- a/hw/vfio/common.c
+++ b/hw/vfio/common.c
@@ -1709,6 +1709,8 @@ static int vfio_connect_container(VFIOGroup *group,
AddressSpace *as,
QLIST_FOREACH(container, &space->containers, next) {
if (!ioctl(group->fd, VFIO_GROUP_SET_CONTAINER, &container->fd)) {
group->container = container;
+ trace_vfio_connect_existing_container(group->groupid,
+ container->fd);
QLIST_INSERT_HEAD(&container->group_list, group, container_next);
vfio_kvm_device_add_group(group);
return 0;
@@ -1742,6 +1744,7 @@ static int vfio_connect_container(VFIOGroup *group,
AddressSpace *as,
if (ret) {
goto free_container_exit;
}
+ trace_vfio_connect_new_container(group->groupid, container->fd);
switch (container->iommu_type) {
case VFIO_TYPE1v2_IOMMU:
diff --git a/hw/vfio/trace-events b/hw/vfio/trace-events
index c0e75f24b7..c17ad82aa4 100644
--- a/hw/vfio/trace-events
+++ b/hw/vfio/trace-events
@@ -104,6 +104,8 @@ vfio_listener_region_add_no_dma_map(const char *name,
uint64_t iova, uint64_t si
vfio_listener_region_del_skip(uint64_t start, uint64_t end) "SKIPPING
region_del 0x%"PRIx64" - 0x%"PRIx64
vfio_listener_region_del(uint64_t start, uint64_t end) "region_del 0x%"PRIx64"
- 0x%"PRIx64
vfio_disconnect_container(int fd) "close container->fd=%d"
+vfio_connect_existing_container(int groupid, int container_fd) "group=%d
existing container fd=%d"
+vfio_connect_new_container(int groupid, int container_fd) "group=%d new
container fd=%d"
vfio_put_group(int fd) "close group->fd=%d"
vfio_get_device(const char * name, unsigned int flags, unsigned int
num_regions, unsigned int num_irqs) "Device %s flags: %u, regions: %u, irqs: %u"
vfio_put_base_device(int fd) "close vdev->fd=%d"
--
2.26.2
- [RFC v8 00/28] vSMMUv3/pSMMUv3 2 stage VFIO integration, Eric Auger, 2021/02/25
- [RFC v8 01/28] hw/vfio/common: trace vfio_connect_container operations,
Eric Auger <=
- [RFC v8 02/28] update-linux-headers: Import iommu.h, Eric Auger, 2021/02/25
- [RFC v8 03/28] header update against 5.11-rc2 and IOMMU/VFIO nested stage APIs, Eric Auger, 2021/02/25
- [RFC v8 05/28] hw/arm/smmuv3: Properly propagate S1 asid invalidation, Eric Auger, 2021/02/25
- [RFC v8 04/28] memory: Add new fields in IOTLBEntry, Eric Auger, 2021/02/25
- [RFC v8 06/28] memory: Add IOMMU_ATTR_VFIO_NESTED IOMMU memory region attribute, Eric Auger, 2021/02/25
- [RFC v8 07/28] memory: Add IOMMU_ATTR_MSI_TRANSLATE IOMMU memory region attribute, Eric Auger, 2021/02/25
- [RFC v8 08/28] memory: Introduce IOMMU Memory Region inject_faults API, Eric Auger, 2021/02/25
- [RFC v8 09/28] iommu: Introduce generic header, Eric Auger, 2021/02/25
- [RFC v8 10/28] pci: introduce PCIPASIDOps to PCIDevice, Eric Auger, 2021/02/25
- [RFC v8 11/28] vfio: Force nested if iommu requires it, Eric Auger, 2021/02/25