From nobody Mon Feb 9 07:22:53 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1618143205; cv=none; d=zohomail.com; s=zohoarc; b=L+jRF40xDlBPdgEaRibPjuB5otnlUIJmuz8C7k8kaHtP5AgAUHAyyYQPk6aMQaqkbUmxC8ll5wOdNhvcVCgdcRg15ztGvm+jb3MOkCldM6nfwPCGRba7DDGSV+SOBMde1Eu1ziSc66tXSgp5/tL/nMI+RAghhxCmQsa1gLx0k5I= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1618143205; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=mLJe5TCOUz2BnNqe++ZYaoKvLMWgaoDMV8xcH1e8+ns=; b=esrTuOIEEGnCn+Oupgq9oKX1Rz3qGjQesuqT4YVIRfG1UwEkibp1XSjhyd418SIFZjYx4DfIvpuYWZwNUKZhkTuNlJTYcCR+g5VgB7DdimjFWK48NEXZTIREMg5RQoCV36CLdpLzcksXuz26wOG4jhX/DwCtOyFc0nHe7Kr3Hjc= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1618143205139867.052757836792; Sun, 11 Apr 2021 05:13:25 -0700 (PDT) Received: from localhost ([::1]:55602 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lVYxv-0001fG-SE for importer@patchew.org; Sun, 11 Apr 2021 08:13:23 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:46956) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lVYuU-0008Fd-Mq for qemu-devel@nongnu.org; Sun, 11 Apr 2021 08:09:50 -0400 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:28521) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lVYuO-0002AJ-AU for qemu-devel@nongnu.org; Sun, 11 Apr 2021 08:09:45 -0400 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-490-i8hwmUBnP8Wg3sOIPUiwzg-1; Sun, 11 Apr 2021 08:09:40 -0400 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 1B8A4802B40; Sun, 11 Apr 2021 12:09:38 +0000 (UTC) Received: from laptop.redhat.com (ovpn-112-22.ams2.redhat.com [10.36.112.22]) by smtp.corp.redhat.com (Postfix) with ESMTP id EC89910023B2; Sun, 11 Apr 2021 12:09:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1618142983; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=mLJe5TCOUz2BnNqe++ZYaoKvLMWgaoDMV8xcH1e8+ns=; b=WcsdsCbkt7xulSZQfeC0C5clWp0B8yB/8at04fIDH2KUqpGHhnMYIdov4EMeMUxpdAIcfM ZhB2dXYD4SiH/lIGKamzKfp/WUjr8zVCJH4suZuoag+YqvOMj4zKw/XqeD/hjAhpqVfr9v tTBFYJdMeI1nqklHapOFpG/EUG0FFLU= X-MC-Unique: i8hwmUBnP8Wg3sOIPUiwzg-1 From: Eric Auger To: eric.auger.pro@gmail.com, eric.auger@redhat.com, qemu-devel@nongnu.org, qemu-arm@nongnu.org, alex.williamson@redhat.com Subject: [RFC v9 01/29] hw/vfio/common: trace vfio_connect_container operations Date: Sun, 11 Apr 2021 14:08:44 +0200 Message-Id: <20210411120912.15770-2-eric.auger@redhat.com> In-Reply-To: <20210411120912.15770-1-eric.auger@redhat.com> References: <20210411120912.15770-1-eric.auger@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=eric.auger@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=63.128.21.124; envelope-from=eric.auger@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H4=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: peter.maydell@linaro.org, jacob.jun.pan@linux.intel.com, jean-philippe@linaro.org, tn@semihalf.com, chenxiang66@hisilicon.com, jiangkunkun@huawei.com, shameerali.kolothum.thodi@huawei.com, nicoleotsuka@gmail.com, vivek.gautam@arm.com, vdumpa@nvidia.com, yi.l.liu@intel.com, peterx@redhat.com, zhangfei.gao@gmail.com, yuzenghui@huawei.com, zhukeqian1@huawei.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" 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 --- 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 ae5654fcdb..a456455517 100644 --- a/hw/vfio/common.c +++ b/hw/vfio/common.c @@ -1742,6 +1742,8 @@ static int vfio_connect_container(VFIOGroup *group, A= ddressSpace *as, QLIST_FOREACH(container, &space->containers, next) { if (!ioctl(group->fd, VFIO_GROUP_SET_CONTAINER, &container->fd)) { group->container =3D container; + trace_vfio_connect_existing_container(group->groupid, + container->fd); QLIST_INSERT_HEAD(&container->group_list, group, container_nex= t); vfio_kvm_device_add_group(group); return 0; @@ -1775,6 +1777,7 @@ static int vfio_connect_container(VFIOGroup *group, A= ddressSpace *as, if (ret) { goto free_container_exit; } + trace_vfio_connect_new_container(group->groupid, container->fd); =20 switch (container->iommu_type) { case VFIO_TYPE1v2_IOMMU: diff --git a/hw/vfio/trace-events b/hw/vfio/trace-events index 079f53acf2..2a41326c0f 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, u= int64_t iova, uint64_t si vfio_listener_region_del_skip(uint64_t start, uint64_t end) "SKIPPING regi= on_del 0x%"PRIx64" - 0x%"PRIx64 vfio_listener_region_del(uint64_t start, uint64_t end) "region_del 0x%"PRI= x64" - 0x%"PRIx64 vfio_disconnect_container(int fd) "close container->fd=3D%d" +vfio_connect_existing_container(int groupid, int container_fd) "group=3D%d= existing container fd=3D%d" +vfio_connect_new_container(int groupid, int container_fd) "group=3D%d new = container fd=3D%d" vfio_put_group(int fd) "close group->fd=3D%d" vfio_get_device(const char * name, unsigned int flags, unsigned int num_re= gions, unsigned int num_irqs) "Device %s flags: %u, regions: %u, irqs: %u" vfio_put_base_device(int fd) "close vdev->fd=3D%d" --=20 2.26.3