From patchwork Mon Oct 10 17:29:02 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: "Michael S. Tsirkin" X-Patchwork-Id: 613763 Delivered-To: patch@linaro.org Received: by 2002:a17:522:c983:b0:460:3032:e3c4 with SMTP id kr3csp2121618pvb; Mon, 10 Oct 2022 10:42:34 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7bRjKjG9yL3xFu1eorhAmp2xzR2bGxl7uyJw0U+rb5ARzYvbG30cerhbWKyeG/4D4REALu X-Received: by 2002:ae9:f50a:0:b0:6e3:3b4f:2ab1 with SMTP id o10-20020ae9f50a000000b006e33b4f2ab1mr13460406qkg.314.1665423754448; Mon, 10 Oct 2022 10:42:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1665423754; cv=none; d=google.com; s=arc-20160816; b=sb3vHIx+/XSR+0rz3kVRDmZqIKJiFzUfjJ+BPPCVf8C3F64h4xJ2b2R/lFfP9A2mG8 4//XSrAqXsnRxawzFI3+Gw4QJrIw4Zq4a19n3vOLZgHP1lswoKgIWtgq6eInnSH8d3cN 75U/SqgHM5OaAUMriSV2epODUznZPyGhJWbkLYIiZ39+vbVSqcA7ECwdcmwVoWJv9xOL NbLRkrIEWF6E6nqolK5QTjlfBb376kx+BmMfqvVJWu91sq13HgQODTs3n0Fy+JFpfmn8 VaNMoDTIvuxjIsxNOcVMB3tJSDvB7OIAjKh+nJ3fpzVq8ITbwi3v49sMQ4vUiT5C+QYj rIiA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:in-reply-to :content-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=/FuzALXECHqoocD8Ass+d81bVkCF0EOizPDi9GCy9zk=; b=HgAdoWqtNOwcuAIqsaTY7F5U6KGdv1dJIOAfVQszvGRttldwmNuHM/Du4AybMTJF5z rnkwmCxD1u9wu3A08nDgZfH92Qlt7pD69wLUyWpQmXQjyUzBlEFQ0zFXi3EKAnUi5VzW vX8ierbYQclE7Fd8KiPoafDLs77Pn/KUFqk86+AAb92fFhNRioVtScTNP3P/nTu5xJ6J 9KSKoW0AjAdFIxdQer4HV5VTnLisgnpuCoPdSkmfcgneNQjr+VTg2tPLre4kbIIUBJT+ yvQlgGGe7k4Uh4ulEA1IRYpVhqMhl9Zc9dSqzWvunZOVBxmYdksMfcakmV48V6dzdnrw EYhA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=O6F4GQ2z; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id bl3-20020a05620a1a8300b006b2543c5866si5575321qkb.18.2022.10.10.10.42.34 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 10 Oct 2022 10:42:34 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=O6F4GQ2z; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from localhost ([::1]:39554 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ohwnQ-0000Q2-Tr for patch@linaro.org; Mon, 10 Oct 2022 13:42:32 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:40726) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ohwaW-0008KB-DN for qemu-devel@nongnu.org; Mon, 10 Oct 2022 13:29:12 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]:56931) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ohwaT-0006T5-59 for qemu-devel@nongnu.org; Mon, 10 Oct 2022 13:29:12 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1665422948; 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=/FuzALXECHqoocD8Ass+d81bVkCF0EOizPDi9GCy9zk=; b=O6F4GQ2z3ofTdKl+KqdIIhznfqYvr4I96SgMOP85wax8/uceb7K38WXHwncqsRt+zTOuJo YdyUuvEAzJW4dju/cMkQ6krGRufiTjypjzBCHF7n5cg+h0yBDKbPps2tRxiVqLi/vUbru4 j9Bu3WoSulbbiXTQpSorv8z2GmbQ20Q= Received: from mail-wm1-f72.google.com (mail-wm1-f72.google.com [209.85.128.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-389-y-5j2JHJO-21mHZSYQimMw-1; Mon, 10 Oct 2022 13:29:07 -0400 X-MC-Unique: y-5j2JHJO-21mHZSYQimMw-1 Received: by mail-wm1-f72.google.com with SMTP id c130-20020a1c3588000000b003b56be513e1so7308223wma.0 for ; Mon, 10 Oct 2022 10:29:07 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=/FuzALXECHqoocD8Ass+d81bVkCF0EOizPDi9GCy9zk=; b=AxRfgi5KlokJaV4FBe/Ydhu+V6KnZK2hJ3Wv6rgMKqyaPfba0RDEQux0G/qfFZE732 5KKuD6nj7RqvMV3x2sAvlO2DDBqwXYpNSUOLnmOnebq8rxEmshQlazvWD+YedwRh8Anr 8tVXUlyo/mje35TOSLRh9zDKiCDYOtSkJ1UP9oqgFRYzoeXz8me545Vp6itBghf3jBCQ tY6V6unUXNmwKb/wUUVohBnt67WLZUAx9uncYLWkDikzxkFFP61aUC+D/mkvvGw4Rfrs /K+rJTd+Gmq/goBJ4GpVClHdadpsPMU7ENIeQAOxiyHV+w5b4FtmakD/zEO90rd9AHZL I6Xg== X-Gm-Message-State: ACrzQf2yJAhOMZI1VwDrtlSy5ZYDqoVduYRc1yRV+PwXEbIRwT7yOXK9 oPTDr/FiUFD+V/ERXf7lGNTYwcK5LEbkavCZoilD2lTBLI1pTxo5M7qLSF5oiTL5IcEM/w+VrXY 8Ph+/eGAnFXmw2a2YWkPJADrpuNbBphERYSEs5CJMFglEYWljZLgkf+QIZfCD X-Received: by 2002:a05:600c:4849:b0:3c6:7e82:a9d7 with SMTP id j9-20020a05600c484900b003c67e82a9d7mr4905679wmo.75.1665422946018; Mon, 10 Oct 2022 10:29:06 -0700 (PDT) X-Received: by 2002:a05:600c:4849:b0:3c6:7e82:a9d7 with SMTP id j9-20020a05600c484900b003c67e82a9d7mr4905662wmo.75.1665422945641; Mon, 10 Oct 2022 10:29:05 -0700 (PDT) Received: from redhat.com ([2.55.183.131]) by smtp.gmail.com with ESMTPSA id bv10-20020a0560001f0a00b00228fa832b7asm9286506wrb.52.2022.10.10.10.29.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 10 Oct 2022 10:29:05 -0700 (PDT) Date: Mon, 10 Oct 2022 13:29:02 -0400 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Cc: Peter Maydell , Alex =?utf-8?q?Benn=C3=A9e?= , Philippe =?utf-8?q?M?= =?utf-8?q?athieu-Daud=C3=A9?= Subject: [PULL 06/55] hw/virtio: add some vhost-user trace events Message-ID: <20221010172813.204597-7-mst@redhat.com> References: <20221010172813.204597-1-mst@redhat.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20221010172813.204597-1-mst@redhat.com> X-Mailer: git-send-email 2.27.0.106.g8ac3dc51b1 X-Mutt-Fcc: =sent Received-SPF: pass client-ip=170.10.129.124; envelope-from=mst@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Alex Bennée These are useful for tracing the lifetime of vhost-user connections. Signed-off-by: Alex Bennée Message-Id: <20220802095010.3330793-10-alex.bennee@linaro.org> Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin Reviewed-by: Philippe Mathieu-Daudé --- hw/virtio/vhost.c | 6 ++++++ hw/virtio/trace-events | 4 ++++ 2 files changed, 10 insertions(+) diff --git a/hw/virtio/vhost.c b/hw/virtio/vhost.c index f758f177bb..5185c15295 100644 --- a/hw/virtio/vhost.c +++ b/hw/virtio/vhost.c @@ -1477,6 +1477,8 @@ void vhost_dev_cleanup(struct vhost_dev *hdev) { int i; + trace_vhost_dev_cleanup(hdev); + for (i = 0; i < hdev->nvqs; ++i) { vhost_virtqueue_cleanup(hdev->vqs + i); } @@ -1783,6 +1785,8 @@ int vhost_dev_start(struct vhost_dev *hdev, VirtIODevice *vdev) /* should only be called after backend is connected */ assert(hdev->vhost_ops); + trace_vhost_dev_start(hdev, vdev->name); + vdev->vhost_started = true; hdev->started = true; hdev->vdev = vdev; @@ -1869,6 +1873,8 @@ void vhost_dev_stop(struct vhost_dev *hdev, VirtIODevice *vdev) /* should only be called after backend is connected */ assert(hdev->vhost_ops); + trace_vhost_dev_stop(hdev, vdev->name); + if (hdev->vhost_ops->vhost_dev_start) { hdev->vhost_ops->vhost_dev_start(hdev, false); } diff --git a/hw/virtio/trace-events b/hw/virtio/trace-events index 20af2e7ebd..887ca7afa8 100644 --- a/hw/virtio/trace-events +++ b/hw/virtio/trace-events @@ -8,6 +8,10 @@ vhost_region_add_section_aligned(const char *name, uint64_t gpa, uint64_t size, vhost_section(const char *name) "%s" vhost_reject_section(const char *name, int d) "%s:%d" vhost_iotlb_miss(void *dev, int step) "%p step %d" +vhost_dev_cleanup(void *dev) "%p" +vhost_dev_start(void *dev, const char *name) "%p:%s" +vhost_dev_stop(void *dev, const char *name) "%p:%s" + # vhost-user.c vhost_user_postcopy_end_entry(void) ""